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