Makefile: New target for tracking diversions.
authorMark Wooding <mdw@distorted.org.uk>
Mon, 5 Mar 2012 10:40:30 +0000 (10:40 +0000)
committerMark Wooding <mdw@distorted.org.uk>
Mon, 5 Mar 2012 23:54:58 +0000 (23:54 +0000)
Makefile

index b69ddd0..b0f4612 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -111,6 +111,16 @@ dummy-inst.sh: dummy.sh
        $(V_AT)chmod +x $@.new && mv $@.new $@
 
 ###--------------------------------------------------------------------------
+### Other utilities.
+
+## A list of diversions in ascending numerical order.
+CLEANFILES             += divs
+divs: $(M4_SOURCES) $(addsuffix .m4,$(HOSTS))
+       $(V_GEN)grep -n m4_divert $^ | \
+               grep -v 'm4_divert(-1)' | \
+               sort -t\( -k2n >$@
+
+###--------------------------------------------------------------------------
 ### Building.
 
 all: $(TARGETS)
@@ -120,7 +130,7 @@ all: $(TARGETS)
        $(V_M4)-DFWHOST=$* base.m4 $*.m4 $(MAIN_M4_SOURCES) >$@.new
        $(V_AT)chmod +x $@.new && mv $@.new $@
 
-clean:; rm -f $(TARGETS) *.new
+clean:; rm -f $(TARGETS) *.new $(CLEANFILES)
 .PHONY: clean
 
 ###--------------------------------------------------------------------------