### Makefile for firewall scripts MAIN_M4_SOURCES = HOSTS = default: all .PHONY: default ###-------------------------------------------------------------------------- ### Local configuration. ## Should set up HOSTS and add stuff to MAIN_M4_SOURCES if necessary. include local.mk ###-------------------------------------------------------------------------- ### Configuration. ## The main m4 inputs which construct the firewall. These are read in last ## to allow local configuration to change their environments. MAIN_M4_SOURCES += config.m4 MAIN_M4_SOURCES += prologue.m4 MAIN_M4_SOURCES += functions.m4 MAIN_M4_SOURCES += numbers.m4 MAIN_M4_SOURCES += bookends.m4 MAIN_M4_SOURCES += classify.m4 MAIN_M4_SOURCES += icmp.m4 ## All of our m4 inputs. The base gets read first to set things up. M4_SOURCES = base.m4 M4_SOURCES += $(MAIN_M4_SOURCES) ###-------------------------------------------------------------------------- ### Hosts. TARGETS = $(addsuffix .sh,$(HOSTS)) ###-------------------------------------------------------------------------- ### Building. all: $(TARGETS) .PHONY: all %.sh: %.m4 $(M4_SOURCES) m4 -P base.m4 $*.m4 $(MAIN_M4_SOURCES) >$@.new chmod +x $@.new mv $@.new $@ clean:; rm -f $(TARGETS) *.new .PHONY: clean ###----- That's all, folks --------------------------------------------------