Makefile: Add licence block at the top.
[firewall] / Makefile
1 ### -*-makefile-*-
2 ###
3 ### Makefile for firewall scripts
4 ###
5 ### (c) 2008 Mark Wooding
6 ###
7
8 ###----- Licensing notice ---------------------------------------------------
9 ###
10 ### This program is free software; you can redistribute it and/or modify
11 ### it under the terms of the GNU General Public License as published by
12 ### the Free Software Foundation; either version 2 of the License, or
13 ### (at your option) any later version.
14 ###
15 ### This program is distributed in the hope that it will be useful,
16 ### but WITHOUT ANY WARRANTY; without even the implied warranty of
17 ### MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 ### GNU General Public License for more details.
19 ###
20 ### You should have received a copy of the GNU General Public License
21 ### along with this program; if not, write to the Free Software Foundation,
22 ### Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
23 ### Makefile for firewall scripts
24
25 ###--------------------------------------------------------------------------
26 ### Preamble.
27
28 ## Extend these variables in `local.mk' to match your site.
29 MAIN_M4_SOURCES =
30 HOSTS =
31
32 SCRIPTS =
33
34 default: all
35 .PHONY: default
36
37 ###--------------------------------------------------------------------------
38 ### Local configuration.
39
40 ## Should set up HOSTS and add stuff to MAIN_M4_SOURCES if necessary. Feel
41 ## free to define additional targets here.
42 include local.mk
43
44 ###--------------------------------------------------------------------------
45 ### Configuration.
46
47 ## The main m4 inputs which construct the firewall. These are read in last
48 ## to allow local configuration to change their environments.
49 MAIN_M4_SOURCES += config.m4
50 MAIN_M4_SOURCES += prologue.m4
51 MAIN_M4_SOURCES += functions.m4
52 MAIN_M4_SOURCES += numbers.m4
53 MAIN_M4_SOURCES += bookends.m4
54 MAIN_M4_SOURCES += classify.m4
55 MAIN_M4_SOURCES += icmp.m4
56
57 ## All of our m4 inputs. The base gets read first to set things up.
58 M4_SOURCES = base.m4
59 M4_SOURCES += $(MAIN_M4_SOURCES)
60
61 ###--------------------------------------------------------------------------
62 ### Hosts.
63
64 TARGETS = $(addsuffix .sh,$(HOSTS))
65
66 ###--------------------------------------------------------------------------
67 ### Building.
68
69 all: $(TARGETS)
70 .PHONY: all
71
72 %.sh: %.m4 $(M4_SOURCES)
73 m4 -P base.m4 $*.m4 $(MAIN_M4_SOURCES) >$@.new
74 chmod +x $@.new
75 mv $@.new $@
76
77 clean:; rm -f $(TARGETS) *.new
78 .PHONY: clean
79
80 ###----- That's all, folks --------------------------------------------------