Import release 0.1.5
[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
b2a56f7c 21VERSION:=0.1.5
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 \
3454dce4 48 serpent.o md5.o version.o tun.o slip.o sha1.o
9d3a4132
SE
49
50DISTFILES:=COPYING CREDITS INSTALL Makefile.in NOTES README TODO \
51 conffile.c conffile.fl conffile.h conffile.y \
52 conffile_internal.h config.h.bot \
53 config.h.in config.h.top configure \
54 configure.in debian dh.c \
3454dce4
SE
55 example-sites-file example.conf make-secnet-sites.py \
56 install.sh ipaddr.py linux md5.c md5.h \
9d3a4132
SE
57 modules.c modules.h netlink.c netlink.h \
58 random.c resolver.c rsa.c \
974d0468 59 secnet.c secnet.h serpent.c serpent.h serpentsboxes.h \
3454dce4 60 sha1.c site.c slip.c stamp-h.in transform.c tun.c udp.c \
9d3a4132 61 unaligned.h util.c util.h
2fe58dfd
SE
62
63%.c: %.y
64
65%.yy.c: %.fl
66 flex -o$@ $<
67
68%.tab.c: %.y
8689b3a9 69 bison -d -o $@ $<
2fe58dfd 70
2fe58dfd
SE
71
72all: $(TARGETS)
73
8689b3a9
SE
74# Automatic remaking of configuration files, from autoconf documentation
75${srcdir}/configure: configure.in
76 cd ${srcdir} && autoconf
77
78# autoheader might not change config.h.in, so touch a stamp file.
79${srcdir}/config.h.in: stamp-h.in
80${srcdir}/stamp-h.in: configure.in config.h.top config.h.bot
81 cd ${srcdir} && autoheader
82 echo timestamp > ${srcdir}/stamp-h.in
83
84config.h: stamp-h
85stamp-h: config.h.in config.status
86 ./config.status
87
974d0468 88Makefile: Makefile.in config.status
8689b3a9 89 ./config.status
974d0468
SE
90
91config.status: configure
8689b3a9
SE
92 ./config.status --recheck
93# End of config file remaking rules
59635212 94
8689b3a9 95# Manual dependencies section - XXX use autodep eventually
974d0468
SE
96$(OBJECTS): config.h secnet.h util.h
97conffile.o conffile.tab.o conffile.yy.o: conffile.h conffile_internal.h
98secnet.c: conffile.h
99md5.o: md5.h
100serpent.o transform.o: serpent.h
101serpent.o: serpentsboxes.h
102conffile.o: modules.h
59635212 103site.c util.c: unaligned.h
8689b3a9
SE
104conffile.yy.c: conffile.fl conffile.tab.c
105conffile.tab.c: conffile.y
9d3a4132 106netlink.o tun.o slip.o: netlink.h
8689b3a9 107# End of manual dependencies section
974d0468 108
2fe58dfd
SE
109secnet: $(OBJECTS)
110
974d0468
SE
111version.c: Makefile
112 echo "char version[]=\"secnet-$(VERSION)\";" >version.c
113
114install: all
9d3a4132 115 $(INSTALL_PROGRAM) -D secnet $(sbindir)/`echo secnet|sed '$(transform)'`
974d0468 116
2fe58dfd 117clean:
8689b3a9 118 $(RM) -f *.o *.yy.c *.tab.[ch] $(TARGETS) core version.c
2fe58dfd
SE
119
120realclean: clean
8689b3a9
SE
121 $(RM) -f *~ Makefile config.h \
122 config.log config.status config.cache \
123 stamp-h Makefile.bak
2fe58dfd 124
974d0468
SE
125pfname:=$(PACKAGE)-$(VERSION)
126dist:
127 $(RM) -rf $(pfname)
128 mkdir $(pfname)
8689b3a9 129 for i in $(DISTFILES) ; do ln -s ../$(srcdir)/$$i $(pfname)/ ; done
974d0468
SE
130 tar hcf ../$(pfname).tar $(pfname)
131 gzip -9f ../$(pfname).tar
132 $(RM) -rf $(pfname)