local.m4: Fix whitespace oddity.
[firewall] / Makefile
index b69ddd0..a0cc605 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
 
 ###--------------------------------------------------------------------------
@@ -137,7 +147,7 @@ check: $(THISHOST).sh
 ## Installation on a local host,
 install/$(THISHOST): $(THISHOST).sh
        [ "x$(SCRIPTS)" = x ] || $(ROOT) install -m755 $(SCRIPTS) $(sbindir)
-       $(ROOT) ./$(THISHOST).sh replace
+       $(ROOT) ./$(THISHOST).sh replace </dev/tty
 
 ## Installation on a remote host.
 $(addprefix install/, $(OTHERHOSTS)): install/%: %.sh
@@ -155,7 +165,7 @@ $(addprefix install/, $(OTHERHOSTS)): install/%: %.sh
        $(ROOT) ssh root@$* rm -f $(FIREWALL).new
 
 ## General installation target.
-install: all install/$(THISHOST) $(addprefix install/,$(HOSTS))
+install: all $(addprefix install/,$(HOSTS))
 .PHONY: install $(addprefix install/,$(HOSTS))
 
 ###----- That's all, folks --------------------------------------------------