chiark / gitweb /
Initial commit of fancy firewall infrastructure.
[firewall] / Makefile
1 ### Makefile for firewall scripts
2
3 MAIN_M4_SOURCES          =
4 HOSTS                    =
5
6 ###--------------------------------------------------------------------------
7 ### Local configuration.
8
9 ## Should set up HOSTS and add stuff to MAIN_M4_SOURCES if necessary.
10 include local.mk
11
12 ###--------------------------------------------------------------------------
13 ### Configuration.
14
15 ## The main m4 inputs which construct the firewall.  These are read in last
16 ## to allow local configuration to change their environments.
17 MAIN_M4_SOURCES         += config.m4
18 MAIN_M4_SOURCES         += prologue.m4
19 MAIN_M4_SOURCES         += functions.m4
20 MAIN_M4_SOURCES         += numbers.m4
21 MAIN_M4_SOURCES         += bookends.m4
22 MAIN_M4_SOURCES         += classify.m4
23 MAIN_M4_SOURCES         += icmp.m4
24
25 ## All of our m4 inputs.  The base gets read first to set things up.
26 M4_SOURCES               = base.m4
27 M4_SOURCES              += $(MAIN_M4_SOURCES)
28
29 ###--------------------------------------------------------------------------
30 ### Hosts.
31
32 TARGETS                  = $(addsuffix .sh,$(HOSTS))
33
34 ###--------------------------------------------------------------------------
35 ### Building.
36
37 all: $(TARGETS)
38
39 %.sh: %.m4 $(M4_SOURCES)
40         m4 -P base.m4 $*.m4 $(MAIN_M4_SOURCES) >$@.new
41         chmod +x $@.new
42         mv $@.new $@
43
44 clean:; rm -f $(TARGETS) *.new
45
46 ###----- That's all, folks --------------------------------------------------