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