From: Mark Wooding Date: Fri, 27 Apr 2018 11:42:59 +0000 (+0100) Subject: Makefile: Attach hooks to the main rules, for custom post-processing. X-Git-Url: https://git.distorted.org.uk/~mdw/profile/commitdiff_plain/f6c3a80bb46ab6f6ada3cd69eaca9a04e9db64c9 Makefile: Attach hooks to the main rules, for custom post-processing. --- diff --git a/Makefile b/Makefile index 21352b8..8a2de99 100644 --- a/Makefile +++ b/Makefile @@ -293,6 +293,7 @@ $(addprefix $(HOME)/, $(subst %,\%,$(DOTLINKS))): $(HOME)/%: \ rm -f $@.new && \ ln -s $(call dotfile-source,$*) $@.new && \ mv $@.new $@ + $(dotfile-hook/$*) ## Hack with the C preprocessor. all:: $(addprefix $(HOME)/, $(DOTCPP)) @@ -302,6 +303,7 @@ $(addprefix $(HOME)/, $(subst %,\%,$(DOTCPP))): $(HOME)/%: \ rm -f $@.new && \ cpp -P -o$@.new $($*_DEFS) $< && \ mv $@.new $@ + $(dotfile-hook/$*) ## Hack by making simple substitutions. substvar = -e $(call quote,s@$1@$2g) @@ -317,6 +319,7 @@ $(relax)### generated by $(HERE)/Makefile; do not edit!" \ $(SUBSTS) $($*_SUBSTS) \ $(call dotfile-source,$*,.in) >$@.new && \ mv $@.new $@ + $(dotfile-hook/$*) ###-------------------------------------------------------------------------- ### Processing script links. @@ -331,6 +334,7 @@ $(addprefix $(HOME)/bin/, $(SCRIPTLINKS)): $(HOME)/bin/%: \ rm -f $@.new && \ ln -s $(call script-source,$*) $@.new && \ mv $@.new $@ + $(script-hook/$*) all:: $(addprefix $(HOME)/bin/, $(SCRIPTLINKS)) @@ -387,6 +391,7 @@ $(foreach p, $(PACKAGES), $(call pkg-stamp,$p,install)): \ $(call v_tag,INSTALL)cd $(dir $@) && \ $(MAKE) $($*_MAKEFLAGS) install >>buildlog 2>&1 && \ touch install-stamp + $(package-hook/$*) all:: $(foreach p, $(PACKAGES), $(DEP_$p)) $(foreach p, $(PACKAGES), $(eval _pkg.$p: $(call pkg-stamp,$p,install)))