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