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