Import release 0.1.16
[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
d3fe100d 18.PHONY: all clean realclean distclean dist install
2fe58dfd
SE
19
20PACKAGE:=secnet
3b83c932 21VERSION:=0.1.16
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
3b83c932
SE
34# Use -DHACKY_PARALLEL if you are compiling secnet for an extremely
35# slow machine
36#CFLAGS:=-Wall @WRITESTRINGS@ @CFLAGS@ -DHACKY_PARALLEL
fe5e9cc4
SE
37CFLAGS:=-Wall @WRITESTRINGS@ @CFLAGS@
38ALL_CFLAGS:=@DEFS@ -I$(srcdir) -I. $(CFLAGS)
2fe58dfd 39LDFLAGS:=@LDFLAGS@
2fe58dfd
SE
40LDLIBS:=@LIBS@
41
974d0468
SE
42prefix:=@prefix@
43exec_prefix:=@exec_prefix@
44sbindir:=@sbindir@
45sysconfdir:=@sysconfdir@
46transform:=@program_transform_name@
47
2fe58dfd
SE
48TARGETS:=secnet
49
50OBJECTS:=secnet.o util.o conffile.yy.o conffile.tab.o conffile.o modules.o \
51 resolver.o random.o udp.o site.o transform.o netlink.o rsa.o dh.o \
7138d0c5 52 serpent.o md5.o version.o tun.o slip.o sha1.o ipaddr.o log.o \
3b83c932
SE
53 process.o @LIBOBJS@ \
54 hackypar.o
9d3a4132 55
3b83c932 56DISTDIRS:=debian
794f2398 57DISTFILES:=BUGS COPYING CREDITS INSTALL LICENSE.txt Makefile.in \
8dea8d37 58 NEWS NOTES README TODO \
3b83c932 59 ac_prog_cc_no_writeable_strings.m4 \
9d3a4132
SE
60 conffile.c conffile.fl conffile.h conffile.y \
61 conffile_internal.h config.h.bot \
62 config.h.in config.h.top configure \
3b83c932 63 configure.in depend.sh dh.c \
8dea8d37
SE
64 example.conf \
65 getopt.c getopt1.c getopt.h \
ff05a229
SE
66 install-sh ipaddr.c ipaddr.h ipaddr.py linux log.c \
67 magic.h md5.c md5.h \
8dea8d37 68 make-secnet-sites \
7138d0c5 69 modules.c netlink.c netlink.h process.c process.h \
9d3a4132 70 random.c resolver.c rsa.c \
974d0468 71 secnet.c secnet.h serpent.c serpent.h serpentsboxes.h \
8dea8d37 72 snprintf.c snprintf.h \
3454dce4 73 sha1.c site.c slip.c stamp-h.in transform.c tun.c udp.c \
3b83c932
SE
74 unaligned.h util.c util.h \
75 hackypar.c hackypar.h
76DISTSUBDIRS:=debian/conffiles debian/copyright debian/changelog \
77 debian/control debian/init debian/rules
2fe58dfd
SE
78
79%.c: %.y
80
81%.yy.c: %.fl
82 flex -o$@ $<
83
84%.tab.c: %.y
8689b3a9 85 bison -d -o $@ $<
2fe58dfd 86
fe5e9cc4
SE
87%.o: %.c
88 $(CC) $(CPPFLAGS) $(ALL_CFLAGS) -c $< -o $@
2fe58dfd
SE
89
90all: $(TARGETS)
91
8689b3a9
SE
92# Automatic remaking of configuration files, from autoconf documentation
93${srcdir}/configure: configure.in
94 cd ${srcdir} && autoconf
95
96# autoheader might not change config.h.in, so touch a stamp file.
97${srcdir}/config.h.in: stamp-h.in
98${srcdir}/stamp-h.in: configure.in config.h.top config.h.bot
99 cd ${srcdir} && autoheader
100 echo timestamp > ${srcdir}/stamp-h.in
101
102config.h: stamp-h
103stamp-h: config.h.in config.status
104 ./config.status
105
974d0468 106Makefile: Makefile.in config.status
8689b3a9 107 ./config.status
974d0468
SE
108
109config.status: configure
8689b3a9
SE
110 ./config.status --recheck
111# End of config file remaking rules
59635212 112
d3fe100d
SE
113# C and header file dependency rules
114SOURCES:=$(OBJECTS:.o=.c)
115DEPENDS:=$(OBJECTS:.o=.d)
116
117$(DEPENDS): ${srcdir}/depend.sh
118
119%.d: %.c
fe5e9cc4 120 ${srcdir}/depend.sh $(srcdir) $(ALL_CFLAGS) $< > $@
d3fe100d
SE
121
122-include $(DEPENDS)
123
124# Manual dependencies section
8689b3a9
SE
125conffile.yy.c: conffile.fl conffile.tab.c
126conffile.tab.c: conffile.y
127# End of manual dependencies section
974d0468 128
2fe58dfd 129secnet: $(OBJECTS)
fe5e9cc4 130 $(CC) $(LDFLAGS) $(ALL_CFLAGS) -o $@ $(OBJECTS) $(LDLIBS)
2fe58dfd 131
974d0468 132version.c: Makefile
4f5e39ec 133 echo "char version[]=\"secnet $(VERSION)\";" >version.c
974d0468
SE
134
135install: all
d3fe100d
SE
136 $(INSTALL) -d $(prefix)/share/secnet $(sbindir)
137 $(INSTALL_PROGRAM) secnet $(sbindir)/`echo secnet|sed '$(transform)'`
138 $(INSTALL_PROGRAM) ${srcdir}/make-secnet-sites $(sbindir)/`echo make-secnet-sites|sed '$(transform)'`
139 $(INSTALL) ${srcdir}/ipaddr.py $(prefix)/share/secnet/ipaddr.py
974d0468 140
2fe58dfd 141clean:
8689b3a9 142 $(RM) -f *.o *.yy.c *.tab.[ch] $(TARGETS) core version.c
2fe58dfd
SE
143
144realclean: clean
d3fe100d 145 $(RM) -f *~ Makefile config.h *.d \
8689b3a9
SE
146 config.log config.status config.cache \
147 stamp-h Makefile.bak
2fe58dfd 148
469fd1d9
SE
149distclean: realclean
150
974d0468
SE
151pfname:=$(PACKAGE)-$(VERSION)
152dist:
153 $(RM) -rf $(pfname)
154 mkdir $(pfname)
3b83c932 155 for i in $(DISTDIRS) ; do mkdir $(pfname)/$$i ; done
8689b3a9 156 for i in $(DISTFILES) ; do ln -s ../$(srcdir)/$$i $(pfname)/ ; done
3b83c932 157 for i in $(DISTSUBDIRS) ; do ln -s ../../$(srcdir)/$$i $(pfname)/$$i ; done
fe5e9cc4 158 tar hcf ../$(pfname).tar --exclude=CVS --exclude=.cvsignore $(pfname)
974d0468
SE
159 gzip -9f ../$(pfname).tar
160 $(RM) -rf $(pfname)