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