From 2abe0f2d527c7b3f6b97bd6519bf0e35a266ea68 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sun, 7 Aug 2016 21:03:44 -0400 Subject: stuff --- build-aux/Makefile.once.head/00-dist.mk | 44 ----- build-aux/Makefile.once.head/00-gnuconf.mk | 160 --------------- build-aux/Makefile.once.head/00-write-ifchanged.mk | 1 - build-aux/Makefile.once.head/10-dist.mk | 42 ++++ build-aux/Makefile.once.head/10-files.mk | 37 ++++ build-aux/Makefile.once.head/10-gnuconf.mk | 188 ++++++++++++++++++ build-aux/Makefile.once.head/10-lt.mk | 12 ++ build-aux/Makefile.once.head/10-nested.mk | 18 ++ build-aux/Makefile.once.head/10-std.mk | 39 ---- build-aux/Makefile.once.head/10-write-ifchanged.mk | 3 + build-aux/Makefile.once.head/20-sd.mk | 217 ++++++++++++++++++++ build-aux/Makefile.once.head/20-systemd.mk | 220 --------------------- build-aux/Makefile.once.head/30-am.mk | 28 +++ .../Makefile.once.head/30-automake2autothing.mk | 11 -- build-aux/Makefile.once.head/zz-mod.mk | 24 +++ 15 files changed, 569 insertions(+), 475 deletions(-) delete mode 100644 build-aux/Makefile.once.head/00-dist.mk delete mode 100644 build-aux/Makefile.once.head/00-gnuconf.mk delete mode 100644 build-aux/Makefile.once.head/00-write-ifchanged.mk create mode 100644 build-aux/Makefile.once.head/10-dist.mk create mode 100644 build-aux/Makefile.once.head/10-files.mk create mode 100644 build-aux/Makefile.once.head/10-gnuconf.mk create mode 100644 build-aux/Makefile.once.head/10-lt.mk create mode 100644 build-aux/Makefile.once.head/10-nested.mk delete mode 100644 build-aux/Makefile.once.head/10-std.mk create mode 100644 build-aux/Makefile.once.head/10-write-ifchanged.mk create mode 100644 build-aux/Makefile.once.head/20-sd.mk delete mode 100644 build-aux/Makefile.once.head/20-systemd.mk create mode 100644 build-aux/Makefile.once.head/30-am.mk delete mode 100644 build-aux/Makefile.once.head/30-automake2autothing.mk create mode 100644 build-aux/Makefile.once.head/zz-mod.mk (limited to 'build-aux/Makefile.once.head') diff --git a/build-aux/Makefile.once.head/00-dist.mk b/build-aux/Makefile.once.head/00-dist.mk deleted file mode 100644 index 4326cde72a..0000000000 --- a/build-aux/Makefile.once.head/00-dist.mk +++ /dev/null @@ -1,44 +0,0 @@ -# Copyright (C) 2015-2016 Luke Shumaker -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . - -# Developer configuration - -dist.exts ?= .tar.gz -dist.pkgname ?= $(firstword $(PACKAGE_TARNAME) $(PACKAGE) $(PACKAGE_NAME)) -dist.version ?= $(firstword $(PACKAGE_VERSION) $(VERSION)) - -ifeq ($(dist.pkgname),) -$(error dist.pkgname must be set) -endif -ifeq ($(dist.version),) -$(error dist.version must be set) -endif - -# User configuration - -CP ?= cp -GZIP ?= gzip -MKDIR ?= mkdir -MKDIR_P ?= mkdir -p -MV ?= mv -RM ?= rm -f -TAR ?= tar - -GZIPFLAGS ?= $(GZIP_ENV) -GZIP_ENV ?= --best - -# Implementation - -at.phony += dist diff --git a/build-aux/Makefile.once.head/00-gnuconf.mk b/build-aux/Makefile.once.head/00-gnuconf.mk deleted file mode 100644 index 83cb110c59..0000000000 --- a/build-aux/Makefile.once.head/00-gnuconf.mk +++ /dev/null @@ -1,160 +0,0 @@ -# Copyright (C) 2016 Luke Shumaker -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . - -# This file is based on §7.2 "Makefile Conventions" of the release of -# the GNU Coding Standards dated April 13, 2016. - -gnuconf.pkgname ?= $(firstword $(PACKAGE_TARNAME) $(PACKAGE) $(PACKAGE_NAME)) -ifeq ($(gnuconf.pkgname),) -$(error gnuconf.pkgname must be set) -endif - -# 7.2.2: Utilities in Makefiles -# ----------------------------- - -# It's ok to hard-code these commands in rules, but who wants to -# memorize the list of what's ok? -AWK ?= awk -CAT ?= cat -CMP ?= cmp -CP ?= cp -DIFF ?= diff -ECHO ?= echo -EGREP ?= egrep -EXPR ?= expr -FALSE ?= false -GREP ?= grep -INSTALL_INFO ?= install-info -LN ?= ln -LS ?= ls -MKDIR ?= mkdir -MV ?= mv -PRINTF ?= printf -PWD ?= pwd -RM ?= rm -RMDIR ?= rmdir -SED ?= sed -SLEEP ?= sleep -SORT ?= sort -TAR ?= tar -TEST ?= test -TOUCH ?= touch -TR ?= tr -TRUE ?= true - -# These must be user-configurable -AR ?= ar -ARFLAGS ?= -BISON ?= bison -BISONFLAGS ?= -CC ?= cc -CCFLAGS ?= $(CFLAGS) -FLEX ?= flex -FLEXFLAGS ?= -INSTALL ?= install -#INSTALLFLAGS ?= -LD ?= ld -LDFLAGS ?= -LDCONFIG ?= ldconfig #TODO -LDCONFIGFLAGS ?= -LEX ?= lex -LEXFLAGS ?= $(LFLAGS) -#MAKE -MAKEINFO ?= makeinfo -MAKEINFOFLAGS ?= -RANLIB ?= ranlib #TODO -RANLIBFLAGS ?= -TEXI2DVI ?= texi2dvi -TEXI2DVIFLAGS ?= -YACC ?= yacc -YACCFLAGS ?= $(YFLAGS) - -CFLAGS ?= -LFLAGS ?= -YFLAGS ?= - -LN_S ?= ln -s #TODO - -CHGRP ?= chgrp -CHMOD ?= chmod -CHOWN ?= chown -MKNOD ?= mknod - -# 7.2.3: Variables for Specifying Commands -# ---------------------------------------- - -INSTALL_PROGRAM ?= $(INSTALL) -INSTALL_DATA ?= ${INSTALL} -m 644 - -# 7.2.5: Variables for Installation Directories -# --------------------------------------------- - -# Root for the installation -prefix ?= /usr/local -exec_prefix ?= $(prefix) -# Executable programs -bindir ?= $(exec_prefix)/bin -sbindir ?= $(exec_prefix)/sbin -libexecdir ?= $(exec_prefix)/libexec -# Data files -datarootdir ?= $(prefix)/share -datadir ?= $(datarootdir) -sysconfdir ?= $(prefix)/etc -sharedstatedir ?= $(prefix)/com -localstatedir ?= $(prefix)/var -runstatedir ?= $(localstatedir)/run -# Specific types of files -includedir ?= $(prefix)/include -oldincludedir ?= /usr/include -docdir ?= $(datarootdir)/doc/$(gnuconf.pkgname) -infodir ?= $(datarootdir)/info -htmldir ?= $(docdir) -dvidir ?= $(docdir) -pdfdir ?= $(docdir) -psdir ?= $(docdir) -libdir ?= $(exec_prefix)/lib -lispdir ?= $(datarootdir)/emacs/site-lisp -localedir ?= $(datarootdir)/locale - -mandir ?= $(datarootdir)/man -man1dir ?= $(mandir)/man1 -man2dir ?= $(mandir)/man2 -man3dir ?= $(mandir)/man3 -man4dir ?= $(mandir)/man4 -man5dir ?= $(mandir)/man5 -man6dir ?= $(mandir)/man6 -man7dir ?= $(mandir)/man7 -man8dir ?= $(mandir)/man8 - -manext ?= .1 -man1ext ?= .1 -man2ext ?= .2 -man3ext ?= .3 -man4ext ?= .4 -man5ext ?= .5 -man6ext ?= .6 -man7ext ?= .7 -man8ext ?= .8 - -# 7.2.7: Install Command Categories -# --------------------------------- - -PRE_INSTALL ?= -POST_INSTALL ?= -NORMAL_INSTALL ?= - -PRE_UNINSTALL ?= -POST_UNINSTALL ?= -NORMAL_UNINSTALL ?= diff --git a/build-aux/Makefile.once.head/00-write-ifchanged.mk b/build-aux/Makefile.once.head/00-write-ifchanged.mk deleted file mode 100644 index 79ef1c419c..0000000000 --- a/build-aux/Makefile.once.head/00-write-ifchanged.mk +++ /dev/null @@ -1 +0,0 @@ -WRITE_IFCHANGED = $(topsrcdir)/build-aux/write-ifchanged diff --git a/build-aux/Makefile.once.head/10-dist.mk b/build-aux/Makefile.once.head/10-dist.mk new file mode 100644 index 0000000000..0e13ea2e28 --- /dev/null +++ b/build-aux/Makefile.once.head/10-dist.mk @@ -0,0 +1,42 @@ +# Copyright (C) 2015-2016 Luke Shumaker +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . + +mod.dist.description = Make distribution tarballs + +# Developer configuration + +dist.exts ?= .tar.gz +dist.pkgname ?= $(firstword $(PACKAGE_TARNAME) $(PACKAGE) $(PACKAGE_NAME)) +dist.version ?= $(firstword $(PACKAGE_VERSION) $(VERSION)) + +ifeq ($(dist.pkgname),) +$(error Autothing module: dist: dist.pkgname must be set) +endif +ifeq ($(dist.version),) +$(error Autothing module: dist: dist.version must be set) +endif + +# User configuration + +CP ?= cp +GZIP ?= gzip +MKDIR ?= mkdir +MKDIR_P ?= mkdir -p +MV ?= mv +RM ?= rm -f +TAR ?= tar + +GZIPFLAGS ?= $(GZIP_ENV) +GZIP_ENV ?= --best diff --git a/build-aux/Makefile.once.head/10-files.mk b/build-aux/Makefile.once.head/10-files.mk new file mode 100644 index 0000000000..56e06acc34 --- /dev/null +++ b/build-aux/Makefile.once.head/10-files.mk @@ -0,0 +1,37 @@ +# Copyright (C) 2015-2016 Luke Shumaker +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . + +mod.files.description = Keeping track of groups of files +mod.files.depends += nested + +files.groups ?= all +files.default ?= all +files.vcsclean ?= files.vcsclean +files.generate ?= files.generate + +.DEFAULT_GOAL = $(files.default_group) + +# Standard creative PHONY targets +nested.targets += $(foreach g,$(files.groups), $g install-$g install-$gdirs) +# Standard destructive PHONY targets +nested.targets += uninstall mostlyclean clean distclean maintainer-clean + +# User configuration + +DESTDIR ?= + +RM ?= rm -f +RMDIR_P ?= rmdir -p --ignore-fail-on-non-empty +TRUE ?= true diff --git a/build-aux/Makefile.once.head/10-gnuconf.mk b/build-aux/Makefile.once.head/10-gnuconf.mk new file mode 100644 index 0000000000..c07cfb5cf3 --- /dev/null +++ b/build-aux/Makefile.once.head/10-gnuconf.mk @@ -0,0 +1,188 @@ +# Copyright (C) 2016 Luke Shumaker +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . + +# This file is based on §7.2 "Makefile Conventions" of the release of +# the GNU Coding Standards dated July 25, 2016. + +mod.gnuconf.description = GNU standard configuration variables + +gnuconf.pkgname ?= $(firstword $(PACKAGE_TARNAME) $(PACKAGE) $(PACKAGE_NAME)) +ifeq ($(gnuconf.pkgname),) +$(error Autothing module: gnuconf: gnuconf.pkgname must be set) +endif + +# 7.2.2: Utilities in Makefiles +# ----------------------------- + +# It's ok to hard-code these commands in rules, but who wants to +# memorize the list of what's ok? +AWK ?= awk +CAT ?= cat +CMP ?= cmp +CP ?= cp +DIFF ?= diff +ECHO ?= echo +EGREP ?= egrep +EXPR ?= expr +FALSE ?= false +GREP ?= grep +INSTALL_INFO ?= install-info +LN ?= ln +LS ?= ls +MKDIR ?= mkdir +MV ?= mv +PRINTF ?= printf +PWD ?= pwd +RM ?= rm +RMDIR ?= rmdir +SED ?= sed +SLEEP ?= sleep +SORT ?= sort +TAR ?= tar +TEST ?= test +TOUCH ?= touch +TR ?= tr +TRUE ?= true + +# 7.2.2: Utilities in Makefiles/7.2.3: Variables for Specifying Commands +# ---------------------------------------------------------------------- + +# Standard user-configurable programs. +# +# The list of programs here is specified in §7.2.2, but the associated FLAGS +# variables are specified in §7.2.3. I found it cleaner to list them together. +AR ?= ar +ARFLAGS ?= +BISON ?= bison +BISONFLAGS ?= +CC ?= cc +CFLAGS ?= # CFLAGS instead of CCFLAGS +FLEX ?= flex +FLEXFLAGS ?= +INSTALL ?= install +# There is no INSTALLFLAGS[0] +LD ?= ld +LDFLAGS ?= +LDCONFIG ?= ldconfig # TODO[1] +LDCONFIGFLAGS ?= +LEX ?= lex +LFLAGS ?= # LFLAGS instead of LEXFLAGS +#MAKE +MAKEINFO ?= makeinfo +MAKEINFOFLAGS ?= +RANLIB ?= ranlib # TODO[1] +RANLIBFLAGS ?= +TEXI2DVI ?= texi2dvi +TEXI2DVIFLAGS ?= +YACC ?= yacc +YFLAGS ?= # YFLAGS instead of YACCFLAGS + +LN_S ?= ln -s # TODO[2] + +CHGRP ?= chgrp +CHGRPFLAGS ?= +CHMOD ?= chmod +CHMODFLAGS ?= +CHOWN ?= chown +CHOWNFLAGS ?= +MKNOD ?= mknod +MKNODFLAGS ?= + +# [0]: There is no INSTALLFLAGS because it would be inconsistent with how the +# standards otherwise recommend using $(INSTALL); with INSTALL_PROGRAM and +# INSTALL_DATA; which are specified in a way precluding the use of +# INSTALLFLAGS. To have the variable, but to ignore it in the common case +# would be confusing. +# +# [1]: The RANLIB and LDCONFIG variables need some extra smarts; §7.2.2 says: +# +# > When you use ranlib or ldconfig, you should make sure nothing bad +# > happens if the system does not have the program in question. Arrange +# > to ignore an error from that command, and print a message before the +# > command to tell the user that failure of this command does not mean a +# > problem. (The Autoconf ‘AC_PROG_RANLIB’ macro can help with this.) +# +# [2]: The LN_S variable isn't standard, but we have it here as an (incomplete) +# stub to help support this bit of §7.2.2: +# +# > If you use symbolic links, you should implement a fallback for +# > systems that don’t have symbolic links. + +# 7.2.3: Variables for Specifying Commands +# ---------------------------------------- + +INSTALL_PROGRAM ?= $(INSTALL) +INSTALL_DATA ?= ${INSTALL} -m 644 + +# 7.2.5: Variables for Installation Directories +# --------------------------------------------- + +# Root for the installation +prefix ?= /usr/local +exec_prefix ?= $(prefix) +# Executable programs +bindir ?= $(exec_prefix)/bin +sbindir ?= $(exec_prefix)/sbin +libexecdir ?= $(exec_prefix)/libexec +# Data files +datarootdir ?= $(prefix)/share +datadir ?= $(datarootdir) +sysconfdir ?= $(prefix)/etc +sharedstatedir ?= $(prefix)/com +localstatedir ?= $(prefix)/var +runstatedir ?= $(localstatedir)/run +# Specific types of files +includedir ?= $(prefix)/include +oldincludedir ?= /usr/include +docdir ?= $(datarootdir)/doc/$(gnuconf.pkgname) +infodir ?= $(datarootdir)/info +htmldir ?= $(docdir) +dvidir ?= $(docdir) +pdfdir ?= $(docdir) +psdir ?= $(docdir) +libdir ?= $(exec_prefix)/lib +lispdir ?= $(datarootdir)/emacs/site-lisp +localedir ?= $(datarootdir)/locale + +mandir ?= $(datarootdir)/man +man1dir ?= $(mandir)/man1 +man2dir ?= $(mandir)/man2 +man3dir ?= $(mandir)/man3 +man4dir ?= $(mandir)/man4 +man5dir ?= $(mandir)/man5 +man6dir ?= $(mandir)/man6 +man7dir ?= $(mandir)/man7 +man8dir ?= $(mandir)/man8 + +manext ?= .1 +man1ext ?= .1 +man2ext ?= .2 +man3ext ?= .3 +man4ext ?= .4 +man5ext ?= .5 +man6ext ?= .6 +man7ext ?= .7 +man8ext ?= .8 + +# 7.2.7: Install Command Categories +# --------------------------------- + +PRE_INSTALL ?= +POST_INSTALL ?= +NORMAL_INSTALL ?= + +PRE_UNINSTALL ?= +POST_UNINSTALL ?= +NORMAL_UNINSTALL ?= diff --git a/build-aux/Makefile.once.head/10-lt.mk b/build-aux/Makefile.once.head/10-lt.mk new file mode 100644 index 0000000000..c8410d4e38 --- /dev/null +++ b/build-aux/Makefile.once.head/10-lt.mk @@ -0,0 +1,12 @@ +mod.lt.description = Easy handling of libtool dependencies +mod.lt.deps += files + +_lt.dups = $(sort $(foreach l,$1,$(if $(filter-out 1,$(words $(filter $l,$1))),$l))) +_lt.patsubst-all = $(if $1,$(call _sd.patsubst-all,$(wordlist 2,$(words $1),$1),$2,$(patsubst $(firstword $1),$2,$3)),$3) +_lt.unLIBPATTERNS = $(foreach _lt.tmp,$1,$(if $(filter $(.LIBPATTERNS),$(_lt.tmp)),$(call _lt.patsubst-all,$(.LIBPATTERNS),-l%,$(_lt.tmp)),$(_lt.tmp))) + +# The semantics for the de-dup bit are a bit weird. My head hurts thinking +# about them. TODO: clarify/simplify/something +lt.rpath = $(dir $(patsubst $(DESTDIR)%,%,$(filter %/$(@F),$(files.sys)))) +_lt.link_files = $(filter %.o %.lo %.la -l%,$(call _lt.unLIBPATTERNS$,$^)) +lt.link_files = $(filter-out $(call _lt.dups,$(_lt.link_files)),$(_lt.link_files)) diff --git a/build-aux/Makefile.once.head/10-nested.mk b/build-aux/Makefile.once.head/10-nested.mk new file mode 100644 index 0000000000..af9fdf7d8a --- /dev/null +++ b/build-aux/Makefile.once.head/10-nested.mk @@ -0,0 +1,18 @@ +# Copyright (C) 2016 Luke Shumaker +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . + +mod.nested.description = Easy nested .PHONY targets + +nested.targets ?= diff --git a/build-aux/Makefile.once.head/10-std.mk b/build-aux/Makefile.once.head/10-std.mk deleted file mode 100644 index 3e058eca57..0000000000 --- a/build-aux/Makefile.once.head/10-std.mk +++ /dev/null @@ -1,39 +0,0 @@ -# Copyright (C) 2015-2016 Luke Shumaker -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . - -# Declare the default target -all: build -.PHONY: all noop - -# Standard creative PHONY targets -at.phony += build install installdirs -# Standard destructive PHONY targets -at.phony += uninstall mostlyclean clean distclean maintainer-clean - -at.dirlocal += std.src_files -at.dirlocal += std.gen_files -at.dirlocal += std.cfg_files -at.dirlocal += std.out_files -at.dirlocal += std.sys_files -at.dirlocal += std.clean_files -at.dirlocal += std.slow_files - -# User configuration - -DESTDIR ?= - -RM ?= rm -f -RMDIR_P ?= rmdir -p -TRUE ?= true diff --git a/build-aux/Makefile.once.head/10-write-ifchanged.mk b/build-aux/Makefile.once.head/10-write-ifchanged.mk new file mode 100644 index 0000000000..7917201159 --- /dev/null +++ b/build-aux/Makefile.once.head/10-write-ifchanged.mk @@ -0,0 +1,3 @@ +mod.write-ifchanged.description = build-aux/write-ifchanged helper script + +WRITE_IFCHANGED ?= $(topsrcdir)/build-aux/write-ifchanged diff --git a/build-aux/Makefile.once.head/20-sd.mk b/build-aux/Makefile.once.head/20-sd.mk new file mode 100644 index 0000000000..c8462f285c --- /dev/null +++ b/build-aux/Makefile.once.head/20-sd.mk @@ -0,0 +1,217 @@ +# -*- Mode: makefile; indent-tabs-mode: t -*- +# +# This file is part of systemd. +# +# Copyright 2010-2012 Lennart Poettering +# Copyright 2010-2012 Kay Sievers +# Copyright 2013 Zbigniew Jędrzejewski-Szmek +# Copyright 2013 David Strauss +# Copyright 2016 Luke Shumaker +# +# systemd is free software; you can redistribute it and/or modify it +# under the terms of the GNU Lesser General Public License as published by +# the Free Software Foundation; either version 2.1 of the License, or +# (at your option) any later version. +# +# systemd is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with systemd; If not, see . + +mod.sd.description = systemd build rules +mod.sd.depends += am + +TESTS ?= + +# Make behavior +SHELL = bash -o pipefail + +.DELETE_ON_ERROR: +.SECONDARY: + +# Autoconf +OUR_CPPFLAGS += -MT $@ -MD -MP -MF $(@D)/$(DEPDIR)/$(basename $(@F)).P$(patsubst .%,%,$(suffix $(@F))) +OUR_CPPFLAGS += -include $(topoutdir)/config.h +OUR_CPPFLAGS += $(sort -I$(@D) $(if $( $@ diff --git a/build-aux/Makefile.once.head/20-systemd.mk b/build-aux/Makefile.once.head/20-systemd.mk deleted file mode 100644 index 04627a9497..0000000000 --- a/build-aux/Makefile.once.head/20-systemd.mk +++ /dev/null @@ -1,220 +0,0 @@ -# -*- Mode: makefile; indent-tabs-mode: t -*- -# -# This file is part of systemd. -# -# Copyright 2010-2012 Lennart Poettering -# Copyright 2010-2012 Kay Sievers -# Copyright 2013 Zbigniew Jędrzejewski-Szmek -# Copyright 2013 David Strauss -# Copyright 2016 Luke Shumaker -# -# systemd is free software; you can redistribute it and/or modify it -# under the terms of the GNU Lesser General Public License as published by -# the Free Software Foundation; either version 2.1 of the License, or -# (at your option) any later version. -# -# systemd is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public License -# along with systemd; If not, see . - -TESTS ?= - - -SHELL = bash -o pipefail - -OUR_CPPFLAGS += -MT $@ -MD -MP -MF $(@D)/$(DEPDIR)/$(basename $(@F)).P$(patsubst .%,%,$(suffix $(@F))) -OUR_CPPFLAGS += -include $(topoutdir)/config.h -OUR_CPPFLAGS += $(sort $(if $( $@ - -# Stupid test that everything purported to be exported really is -define generate-sym-test - $(AM_V_at)$(MKDIR_P) $(dir $@) - $(AM_V_at)printf '#include \n' > $@ - $(AM_V_at)printf '#include "%s"\n' $(notdir $(filter %.h, $^)) >> $@ - $(AM_V_at)printf 'void* functions[] = {\n' >> $@ - $(AM_V_GEN)sed -r -n 's/^ +([a-zA-Z0-9_]+);/\1,/p' $< >> $@ - $(AM_V_at)printf '};\nint main(void) {\n' >> $@ - $(AM_V_at)printf 'unsigned i; for (i=0;i> $@ - $(AM_V_at)printf 'return 0; }\n' >> $@ -endef - -at.dirlocal += systemd.sed_files diff --git a/build-aux/Makefile.once.head/30-am.mk b/build-aux/Makefile.once.head/30-am.mk new file mode 100644 index 0000000000..9049f2c88a --- /dev/null +++ b/build-aux/Makefile.once.head/30-am.mk @@ -0,0 +1,28 @@ +mod.am.description = Support for Automake variables (systemd specific) +mod.am.depends += gnuconf + +am.inst2noinst_DATA = $(notdir \ + $(patsubst $(sysusersdir)/%.conf,%.sysusers,\ + $(patsubst $(sysctldir)/%.conf,%.sysctl,\ + $1))) +am.var_PROGRAMS = $1_SOURCES nodist_$1_SOURCES $1_CFLAGS $1_CPPFLAGS $1_LDFLAGS $1_LDADD +am.var_LTLIBRARIES = $1_SOURCES nodist_$1_SOURCES $1_CFLAGS $1_CPPFLAGS $1_LDFLAGS $1_LIBADD + +am.INSTALL_PROGRAM ?= $(INSTALL_PROGRAM) $< $@ +am.INSTALL_SCRIPT ?= $(INSTALL) $< $@ +am.INSTALL_LTLIBRARY ?= $(INSTALL) $< $@ +am.INSTALL_DATA ?= $(INSTALL_DATA) $< $@ + +################################################################################ + +# this list of primaries is based on the Automake 1.15 manual +am.primaries ?= PROGRAMS LIBRARIES LTLIBRARIES LISP PYTHON JAVA SCRIPTS DATA HEADERS MANS TEXINFOS +$(foreach p,$(am.primaries),$(eval am.inst2noinst_$p ?= $$(notdir $$1))) + +am.file2var = $(subst -,_,$(subst .,_,$1)) +am.file2sources = $(addprefix $(srcdir)/,$(notdir $($(am.file2var)_SOURCES))) +am.file2sources += $(addprefix $(outdir)/,$(notdir $(nodist_$(am.file2var)_SOURCES))) +am.file2.o = $(patsubst $(srcdir)/%,$(outdir)/%,$(patsubst %.c,%.o ,$(filter %.c,$(am.file2sources)))) +am.file2.lo = $(patsubst %.o,%.lo,$(am.file2.o)) +am.file2lib = $(foreach l, $($(am.file2var)_$2),$(if $(filter lib%.la,$l), $($(l:.la=).DEPENDS) , $l )) +am.file2cpp = $(foreach l,$1 $($(am.file2var)_$2),$(if $(filter lib%.la,$l), $($(l:.la=).CPPFLAGS) , )) diff --git a/build-aux/Makefile.once.head/30-automake2autothing.mk b/build-aux/Makefile.once.head/30-automake2autothing.mk deleted file mode 100644 index ee21fba45a..0000000000 --- a/build-aux/Makefile.once.head/30-automake2autothing.mk +++ /dev/null @@ -1,11 +0,0 @@ -am.bindirs = bin rootbin libexec rootlibexec systemgenerator udevlibexec -at.dirlocal += am.CFLAGS am.CPPFLAGS am.LDFLAGS am.LIBTOOLFLAGS -at.dirlocal += noinst_LTLIBRARIES lib_LTLIBRARIES -at.dirlocal += $(addsuffix _PROGRAMS,noinst $(am.bindirs)) -at.dirlocal += pkgconfiglib_DATA -automake_name = $(subst -,_,$(subst .,_,$1)) -automake_sources = $(addprefix $(outdir)/,$(notdir $($(automake_name)_SOURCES) $(nodist_$(automake_name)_SOURCES))) -automake_lo = $(patsubst %.c,%.lo,$(filter %.c,$(automake_sources))) -automake_o = $(patsubst %.c,%.o,$(filter %.c,$(automake_sources))) -automake_lib = $(foreach l, $($(automake_name)_$2),$(if $(filter lib%.la,$l), $($(l:.la=).DEPENDS) , $l )) -automake_cpp = $(foreach l,$1 $($(automake_name)_$2),$(if $(filter lib%.la,$l), $($(l:.la=).CPPFLAGS) , )) diff --git a/build-aux/Makefile.once.head/zz-mod.mk b/build-aux/Makefile.once.head/zz-mod.mk new file mode 100644 index 0000000000..3bf6398e13 --- /dev/null +++ b/build-aux/Makefile.once.head/zz-mod.mk @@ -0,0 +1,24 @@ +# Copyright (C) 2016 Luke Shumaker +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . + +mod.mod.description = Print information about Autothing modules + +_mod.target = at-mod-info +_mod.modules := $(sort $(patsubst %.mk,%,$(filter %.mk,$(subst -, ,$(notdir $(wildcard $(topsrcdir)/build-aux/Makefile.*/??-*.mk)))))) +_mod.quote = '$(subst ','\'',$1)' + +_mod.vars = $(filter $(addsuffix .%,$(_mod.modules)),$(.VARIABLES)) +_mod.once := $(_mod.vars) +_mod.each := -- cgit v1.2.3-54-g00ecf