chiark / gitweb /
Makefile: Attach hooks to the main rules, for custom post-processing.
authorMark Wooding <mdw@distorted.org.uk>
Fri, 27 Apr 2018 11:42:59 +0000 (12:42 +0100)
committerMark Wooding <mdw@distorted.org.uk>
Fri, 27 Apr 2018 11:48:11 +0000 (12:48 +0100)
Makefile

index 21352b8ac46325163a176cd5dd3202b4f1caedad..8a2de99516436f28b6c2a2a152b9b9c07cc0d156 100644 (file)
--- 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\a@$1@\a$2\ag)
@@ -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)))