Import release 0.1.9
[secnet] / Makefile.in
CommitLineData
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
20PACKAGE:=secnet
8dea8d37 21VERSION:=0.1.9
2fe58dfd
SE
22
23@SET_MAKE@
24
25srcdir:=@srcdir@
26VPATH:=@srcdir@
27
974d0468
SE
28SHELL:=/bin/sh
29RM:=@RM@
30CC:=@CC@
31INSTALL:=@INSTALL@
32INSTALL_PROGRAM:=@INSTALL_PROGRAM@
2fe58dfd 33
8689b3a9 34CFLAGS:=@CFLAGS@ @DEFS@ -Wall -I$(srcdir) -I.
2fe58dfd 35LDFLAGS:=@LDFLAGS@
2fe58dfd
SE
36LDLIBS:=@LIBS@
37
974d0468
SE
38prefix:=@prefix@
39exec_prefix:=@exec_prefix@
40sbindir:=@sbindir@
41sysconfdir:=@sysconfdir@
42transform:=@program_transform_name@
43
2fe58dfd
SE
44TARGETS:=secnet
45
46OBJECTS:=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 48 serpent.o md5.o version.o tun.o slip.o sha1.o ipaddr.o log.o \
8dea8d37 49 process.o @LIBOBJS@
9d3a4132 50
8dea8d37
SE
51DISTFILES:=COPYING CREDITS INSTALL LICENSE.txt Makefile.in \
52 NEWS NOTES README TODO \
53 alloca.c \
9d3a4132
SE
54 conffile.c conffile.fl conffile.h conffile.y \
55 conffile_internal.h config.h.bot \
56 config.h.in config.h.top configure \
57 configure.in debian dh.c \
8dea8d37
SE
58 example.conf \
59 getopt.c getopt1.c getopt.h \
7138d0c5 60 install.sh ipaddr.c ipaddr.h ipaddr.py linux log.c md5.c md5.h \
8dea8d37 61 make-secnet-sites \
7138d0c5 62 modules.c netlink.c netlink.h process.c process.h \
9d3a4132 63 random.c resolver.c rsa.c \
974d0468 64 secnet.c secnet.h serpent.c serpent.h serpentsboxes.h \
8dea8d37 65 snprintf.c snprintf.h \
3454dce4 66 sha1.c site.c slip.c stamp-h.in transform.c tun.c udp.c \
9d3a4132 67 unaligned.h util.c util.h
2fe58dfd
SE
68
69%.c: %.y
70
71%.yy.c: %.fl
72 flex -o$@ $<
73
74%.tab.c: %.y
8689b3a9 75 bison -d -o $@ $<
2fe58dfd 76
2fe58dfd
SE
77
78all: $(TARGETS)
79
8689b3a9
SE
80# Automatic remaking of configuration files, from autoconf documentation
81${srcdir}/configure: configure.in
82 cd ${srcdir} && autoconf
83
84# autoheader might not change config.h.in, so touch a stamp file.
85${srcdir}/config.h.in: stamp-h.in
86${srcdir}/stamp-h.in: configure.in config.h.top config.h.bot
87 cd ${srcdir} && autoheader
88 echo timestamp > ${srcdir}/stamp-h.in
89
90config.h: stamp-h
91stamp-h: config.h.in config.status
92 ./config.status
93
974d0468 94Makefile: Makefile.in config.status
8689b3a9 95 ./config.status
974d0468
SE
96
97config.status: configure
8689b3a9
SE
98 ./config.status --recheck
99# End of config file remaking rules
59635212 100
8689b3a9 101# Manual dependencies section - XXX use autodep eventually
974d0468
SE
102$(OBJECTS): config.h secnet.h util.h
103conffile.o conffile.tab.o conffile.yy.o: conffile.h conffile_internal.h
042a8da9
SE
104secnet.o: conffile.h process.h
105process.o: process.h
106log.o: process.h
974d0468
SE
107md5.o: md5.h
108serpent.o transform.o: serpent.h
109serpent.o: serpentsboxes.h
7138d0c5 110conffile.o: ipaddr.h
59635212 111site.c util.c: unaligned.h
8689b3a9
SE
112conffile.yy.c: conffile.fl conffile.tab.c
113conffile.tab.c: conffile.y
9d3a4132 114netlink.o tun.o slip.o: netlink.h
8689b3a9 115# End of manual dependencies section
974d0468 116
2fe58dfd
SE
117secnet: $(OBJECTS)
118
974d0468
SE
119version.c: Makefile
120 echo "char version[]=\"secnet-$(VERSION)\";" >version.c
121
122install: all
9d3a4132 123 $(INSTALL_PROGRAM) -D secnet $(sbindir)/`echo secnet|sed '$(transform)'`
8dea8d37
SE
124 $(INSTALL_PROGRAM) -D make-secnet-sites $(sbindir)/`echo make-secnet-sites|sed '$(transform)'`
125 $(INSTALL) -D ipaddr.py $(prefix)/share/secnet/ipaddr.py
974d0468 126
2fe58dfd 127clean:
8689b3a9 128 $(RM) -f *.o *.yy.c *.tab.[ch] $(TARGETS) core version.c
2fe58dfd
SE
129
130realclean: clean
8689b3a9
SE
131 $(RM) -f *~ Makefile config.h \
132 config.log config.status config.cache \
133 stamp-h Makefile.bak
2fe58dfd 134
974d0468
SE
135pfname:=$(PACKAGE)-$(VERSION)
136dist:
137 $(RM) -rf $(pfname)
138 mkdir $(pfname)
8689b3a9 139 for i in $(DISTFILES) ; do ln -s ../$(srcdir)/$$i $(pfname)/ ; done
974d0468
SE
140 tar hcf ../$(pfname).tar $(pfname)
141 gzip -9f ../$(pfname).tar
142 $(RM) -rf $(pfname)