1 # Makefile for ipif/udptunnel stuff
3 # This file is part of ipif, part of userv-util
5 # Copyright 1996-2013 Ian Jackson <ijackson@chiark.greenend.org.uk>
6 # Copyright 1998 David Damerell <damerell@chiark.greenend.org.uk>
8 # Chancellor Masters and Scholars of the University of Cambridge
9 # Copyright 2010 Tony Finch <fanf@dotat.at>
11 # This is free software; you can redistribute it and/or modify it
12 # under the terms of the GNU General Public License as published by
13 # the Free Software Foundation; either version 3 of the License, or
14 # (at your option) any later version.
16 # This program is distributed in the hope that it will be useful, but
17 # WITHOUT ANY WARRANTY; without even the implied warranty of
18 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 # General Public License for more details.
21 # You should have received a copy of the GNU General Public License
22 # along with userv-utils; if not, see http://www.gnu.org/licenses/.
24 include ../settings.make
26 varlibvpn= $(varlibuserv)/vpn
27 etcuserv= $(etcdir)/userv
28 etcvpn= $(etcuserv)/vpn
31 PROGRAM_TARGETS$(depr)+= udptunnel-forwarder udptunnel-reconf
34 TARGETS$(depr)+= blowfishtest
35 TARGETS+= $(PROGRAM_TARGETS)
37 PROGRAMS$(depr)+= udptunnel
38 PROGRAMS+= $(PROGRAM_TARGETS)
40 DIRS+= $(libuserv) $(etcuserv) $(services)
41 DIRS+= $(docdir)/userv-ipif
42 DIRS+= $(etcuserv)/ipif-access
43 DIRS$(depr)+= $(bindir) $(varlibvpn) $(shareuserv)
45 SHAREFILES$(depr)+= udptunnel-vpn-config.m4 udptunnel-vpn-defaults
47 MECHFILES= null pkcs5 timestamp sequence blowfish
48 MECHOBJS= $(foreach m, $(MECHFILES), mech-$m.o)
50 OBJS_FORWARD= forwarder.o $(MECHOBJS) blowfish.o automech.c utils.c
51 OBJS_BFTEST= blowfishtest.o blowfish.o hex.o
57 cp -b service $(libuserv)/ipif
58 cp -b service-wrap $(libuserv)/ipif-access
59 set -e; for f in $(PROGRAMS); do cp -b $$f $(bindir)/.; done
60 cp ipif $(services)/ipif:new
61 set -e; cd $(services); test -f ipif || mv ipif:new ipif
62 set -e; for f in $(SHAREFILES); do cp $$f $(shareuserv)/.; done
65 sed -n '1,/^$$/p' service.c >$(docdir)/userv-ipif/service.c.txt
68 set -e; if [ "x$depr" = x ]; then \
70 cp *.example $(etcvpn)/.; \
73 udptunnel-reconf: udptunnel-reconf.pl Makefile
76 -e '\$$shareuserv= \"$(shareuserv)\";\n ' \
77 -e '\$$etcvpn= \"$(etcvpn)\";\n ' \
78 -e '\$$varlibvpn= \"$(varlibvpn)\";\n" if m#^\# \@\@\@\-#; ' \
79 -e ' $$_="" if m/^\# \@\@\@\-/ .. m/^\# \-\@\@\@/; ' \
85 udptunnel-forwarder: $(OBJS_FORWARD)
86 $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(OBJS_FORWARD)
88 blowfishtest: $(OBJS_BFTEST)
89 $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(OBJS_BFTEST)
91 automech.h: automechgen.sh Makefile
94 automech.c: automech.h
97 rm -f *.o core automech.[ch] *~ ./#*#
99 realclean distclean: clean
102 forwarder.o $(MECHOBJS) automech.o utils.o: forwarder.h automech.h
103 blowfish.o mech-blowfish.o blowfishtest.o: blowfish.h
104 blowfishtest.o hex.o: hex.h