From 88d181c25d2f99f8b510afe2f2cc7e1ba1fa012c Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Wed, 10 Aug 2016 11:22:38 -0400 Subject: (systemd) fix build system --- build-aux/Makefile.once.head/10-dist.mk | 4 ++- build-aux/Makefile.once.head/10-files.mk | 5 +++- build-aux/Makefile.once.head/10-lt.mk | 12 -------- build-aux/Makefile.once.head/10-write-ifchanged.mk | 3 +- build-aux/Makefile.once.head/zz-mod.mk | 32 ++++++++++++++++------ 5 files changed, 33 insertions(+), 23 deletions(-) delete mode 100644 build-aux/Makefile.once.head/10-lt.mk (limited to 'build-aux/Makefile.once.head') diff --git a/build-aux/Makefile.once.head/10-dist.mk b/build-aux/Makefile.once.head/10-dist.mk index 0e13ea2..e139096 100644 --- a/build-aux/Makefile.once.head/10-dist.mk +++ b/build-aux/Makefile.once.head/10-dist.mk @@ -13,7 +13,7 @@ # 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 +mod.dist.description = `dist` target for distribution tarballs # Developer configuration @@ -28,6 +28,8 @@ ifeq ($(dist.version),) $(error Autothing module: dist: dist.version must be set) endif +_dist.files = + # User configuration CP ?= cp diff --git a/build-aux/Makefile.once.head/10-files.mk b/build-aux/Makefile.once.head/10-files.mk index 2af7bf8..5441735 100644 --- a/build-aux/Makefile.once.head/10-files.mk +++ b/build-aux/Makefile.once.head/10-files.mk @@ -24,7 +24,10 @@ files.generate ?= files.generate .DEFAULT_GOAL = $(files.default) # Standard creative PHONY targets -nested.targets += $(foreach g,$(files.groups), $g install-$g install-$gdirs) +nested.targets += $(files.generate) +nested.targets += install installdirs +nested.targets += $(foreach g,$(files.groups),$g) +nested.targets += $(foreach g,$(filter-out $(files.default),$(files.groups)),install-$g install-$gdirs) # Standard destructive PHONY targets nested.targets += uninstall mostlyclean clean distclean maintainer-clean diff --git a/build-aux/Makefile.once.head/10-lt.mk b/build-aux/Makefile.once.head/10-lt.mk deleted file mode 100644 index c8410d4..0000000 --- a/build-aux/Makefile.once.head/10-lt.mk +++ /dev/null @@ -1,12 +0,0 @@ -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-write-ifchanged.mk b/build-aux/Makefile.once.head/10-write-ifchanged.mk index 7917201..b0a5ac4 100644 --- a/build-aux/Makefile.once.head/10-write-ifchanged.mk +++ b/build-aux/Makefile.once.head/10-write-ifchanged.mk @@ -1,3 +1,4 @@ -mod.write-ifchanged.description = build-aux/write-ifchanged helper script +mod.write-ifchanged.description = `write-ifchanged` auxiliary build script +mod.write-ifchanged.files += $(topsrcdir)/build-aux/write-ifchanged WRITE_IFCHANGED ?= $(topsrcdir)/build-aux/write-ifchanged diff --git a/build-aux/Makefile.once.head/zz-mod.mk b/build-aux/Makefile.once.head/zz-mod.mk index 7e52606..438f01e 100644 --- a/build-aux/Makefile.once.head/zz-mod.mk +++ b/build-aux/Makefile.once.head/zz-mod.mk @@ -13,14 +13,30 @@ # 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.mod.description = Display 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)' +# The trickery that is _mod.empty/_mod.space is from ยง6.2 of the GNU Make +# manual, "The Two Flavors of Variables". +_mod.empty := +_mod.space := $(_mod.empty) # +undefine _mod.empty +# _mod.rest is equivalent to GMSL rest. +_mod.rest = $(wordlist 2,$(words $1),$1) -$(eval $(foreach _mod.tmp,$(_mod.modules),mod.$(_mod.tmp).description ?=$(at.nl)mod.$(_mod.tmp).depends ?=$(at.nl))) +_mod.file2mod = $(foreach _mod.tmp,$(patsubst %.mk,%,$(notdir $1)),$(subst $(_mod.space),-,$(call _mod.rest,$(subst -, ,$(_mod.tmp))))) -_mod.vars = $(filter $(addsuffix .%,$(_mod.modules)),$(.VARIABLES)) -_mod.once := $(_mod.vars) -_mod.each := +_mod.modules := $(sort $(call _mod.file2mod,$(wildcard $(topsrcdir)/build-aux/Makefile.*/??-*.mk))) +undefine _mod.rest +undefine _mod.file2mod + +$(eval $(foreach _mod.tmp,$(_mod.modules),\ + mod.$(_mod.tmp).description ?=$(at.nl)\ + mod.$(_mod.tmp).depends ?=$(at.nl)\ + mod.$(_mod.tmp).files ?=$(at.nl))) + +_mod.quote-pattern = $(subst %,\%,$(subst \,\\,$1)) +_mod.quote-shell-each = $(foreach _mod.tmp,$1,$(call _mod.quote-shell,$(_mod.tmp))) + +# I put this as the last line in the file because it confuses Emacs syntax +# highlighting and makes the remainder of the file difficult to edit. +_mod.quote-shell = $(subst $(at.nl),'$$'\n'','$(subst ','\'',$1)') -- cgit v1.2.3