Commit | Line | Data |
---|---|---|
974d0468 SE |
1 | # Makefile for secnet |
2 | # Copyright (C) 1995-2001 Stephen Early <steve@greenend.org.uk> | |
3 | ||
4 | # This program is free software; you can redistribute it and/or modify | |
5 | # it under the terms of the GNU General Public License as published by | |
6 | # the Free Software Foundation; either version 2, or (at your option) | |
7 | # any later version. | |
8 | ||
9 | # This program is distributed in the hope that it will be useful, | |
10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | |
11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
12 | # GNU General Public License for more details. | |
13 | ||
14 | # You should have received a copy of the GNU General Public License | |
15 | # along with this program; if not, write to the Free Software | |
16 | # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | |
17 | ||
18 | .PHONY: all clean realclean dist install | |
2fe58dfd SE |
19 | |
20 | PACKAGE:=secnet | |
c6f79b17 | 21 | VERSION:=0.1.8 |
2fe58dfd SE |
22 | |
23 | @SET_MAKE@ | |
24 | ||
25 | srcdir:=@srcdir@ | |
26 | VPATH:=@srcdir@ | |
27 | ||
974d0468 SE |
28 | SHELL:=/bin/sh |
29 | RM:=@RM@ | |
30 | CC:=@CC@ | |
31 | INSTALL:=@INSTALL@ | |
32 | INSTALL_PROGRAM:=@INSTALL_PROGRAM@ | |
2fe58dfd | 33 | |
8689b3a9 | 34 | CFLAGS:=@CFLAGS@ @DEFS@ -Wall -I$(srcdir) -I. |
2fe58dfd | 35 | LDFLAGS:=@LDFLAGS@ |
2fe58dfd SE |
36 | LDLIBS:=@LIBS@ |
37 | ||
974d0468 SE |
38 | prefix:=@prefix@ |
39 | exec_prefix:=@exec_prefix@ | |
40 | sbindir:=@sbindir@ | |
41 | sysconfdir:=@sysconfdir@ | |
42 | transform:=@program_transform_name@ | |
43 | ||
2fe58dfd SE |
44 | TARGETS:=secnet |
45 | ||
46 | OBJECTS:=secnet.o util.o conffile.yy.o conffile.tab.o conffile.o modules.o \ | |
47 | resolver.o random.o udp.o site.o transform.o netlink.o rsa.o dh.o \ | |
7138d0c5 SE |
48 | serpent.o md5.o version.o tun.o slip.o sha1.o ipaddr.o log.o \ |
49 | process.o | |
9d3a4132 | 50 | |
c6f79b17 | 51 | DISTFILES:=COPYING CREDITS INSTALL Makefile.in NEWS NOTES README TODO \ |
9d3a4132 SE |
52 | conffile.c conffile.fl conffile.h conffile.y \ |
53 | conffile_internal.h config.h.bot \ | |
54 | config.h.in config.h.top configure \ | |
55 | configure.in debian dh.c \ | |
c6f79b17 | 56 | example.conf make-secnet-sites.py \ |
7138d0c5 SE |
57 | install.sh ipaddr.c ipaddr.h ipaddr.py linux log.c md5.c md5.h \ |
58 | modules.c netlink.c netlink.h process.c process.h \ | |
9d3a4132 | 59 | random.c resolver.c rsa.c \ |
974d0468 | 60 | secnet.c secnet.h serpent.c serpent.h serpentsboxes.h \ |
3454dce4 | 61 | sha1.c site.c slip.c stamp-h.in transform.c tun.c udp.c \ |
9d3a4132 | 62 | unaligned.h util.c util.h |
2fe58dfd SE |
63 | |
64 | %.c: %.y | |
65 | ||
66 | %.yy.c: %.fl | |
67 | flex -o$@ $< | |
68 | ||
69 | %.tab.c: %.y | |
8689b3a9 | 70 | bison -d -o $@ $< |
2fe58dfd | 71 | |
2fe58dfd SE |
72 | |
73 | all: $(TARGETS) | |
74 | ||
8689b3a9 SE |
75 | # Automatic remaking of configuration files, from autoconf documentation |
76 | ${srcdir}/configure: configure.in | |
77 | cd ${srcdir} && autoconf | |
78 | ||
79 | # autoheader might not change config.h.in, so touch a stamp file. | |
80 | ${srcdir}/config.h.in: stamp-h.in | |
81 | ${srcdir}/stamp-h.in: configure.in config.h.top config.h.bot | |
82 | cd ${srcdir} && autoheader | |
83 | echo timestamp > ${srcdir}/stamp-h.in | |
84 | ||
85 | config.h: stamp-h | |
86 | stamp-h: config.h.in config.status | |
87 | ./config.status | |
88 | ||
974d0468 | 89 | Makefile: Makefile.in config.status |
8689b3a9 | 90 | ./config.status |
974d0468 SE |
91 | |
92 | config.status: configure | |
8689b3a9 SE |
93 | ./config.status --recheck |
94 | # End of config file remaking rules | |
59635212 | 95 | |
8689b3a9 | 96 | # Manual dependencies section - XXX use autodep eventually |
974d0468 SE |
97 | $(OBJECTS): config.h secnet.h util.h |
98 | conffile.o conffile.tab.o conffile.yy.o: conffile.h conffile_internal.h | |
042a8da9 SE |
99 | secnet.o: conffile.h process.h |
100 | process.o: process.h | |
101 | log.o: process.h | |
974d0468 SE |
102 | md5.o: md5.h |
103 | serpent.o transform.o: serpent.h | |
104 | serpent.o: serpentsboxes.h | |
7138d0c5 | 105 | conffile.o: ipaddr.h |
59635212 | 106 | site.c util.c: unaligned.h |
8689b3a9 SE |
107 | conffile.yy.c: conffile.fl conffile.tab.c |
108 | conffile.tab.c: conffile.y | |
9d3a4132 | 109 | netlink.o tun.o slip.o: netlink.h |
8689b3a9 | 110 | # End of manual dependencies section |
974d0468 | 111 | |
2fe58dfd SE |
112 | secnet: $(OBJECTS) |
113 | ||
974d0468 SE |
114 | version.c: Makefile |
115 | echo "char version[]=\"secnet-$(VERSION)\";" >version.c | |
116 | ||
117 | install: all | |
9d3a4132 | 118 | $(INSTALL_PROGRAM) -D secnet $(sbindir)/`echo secnet|sed '$(transform)'` |
974d0468 | 119 | |
2fe58dfd | 120 | clean: |
8689b3a9 | 121 | $(RM) -f *.o *.yy.c *.tab.[ch] $(TARGETS) core version.c |
2fe58dfd SE |
122 | |
123 | realclean: clean | |
8689b3a9 SE |
124 | $(RM) -f *~ Makefile config.h \ |
125 | config.log config.status config.cache \ | |
126 | stamp-h Makefile.bak | |
2fe58dfd | 127 | |
974d0468 SE |
128 | pfname:=$(PACKAGE)-$(VERSION) |
129 | dist: | |
130 | $(RM) -rf $(pfname) | |
131 | mkdir $(pfname) | |
8689b3a9 | 132 | for i in $(DISTFILES) ; do ln -s ../$(srcdir)/$$i $(pfname)/ ; done |
974d0468 SE |
133 | tar hcf ../$(pfname).tar $(pfname) |
134 | gzip -9f ../$(pfname).tar | |
135 | $(RM) -rf $(pfname) |