ipif: Fix deprecation of udptunnel so it builds
[userv-utils] / ipif / Makefile
... / ...
CommitLineData
1# Makefile for ipif/udptunnel stuff
2
3# This file is part of ipif, part of userv-util
4#
5# Copyright 1996-2013 Ian Jackson <ijackson@chiark.greenend.org.uk>
6# Copyright 1998 David Damerell <damerell@chiark.greenend.org.uk>
7# Copyright 1999,2003
8# Chancellor Masters and Scholars of the University of Cambridge
9# Copyright 2010 Tony Finch <fanf@dotat.at>
10#
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.
15#
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.
20#
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/.
23
24include ../settings.make
25
26varlibvpn= $(varlibuserv)/vpn
27etcuserv= $(etcdir)/userv
28etcvpn= $(etcuserv)/vpn
29
30PROGRAM_TARGETS+=
31PROGRAM_TARGETS$(depr)+= udptunnel-forwarder udptunnel-reconf
32
33TARGETS+= service
34TARGETS$(depr)+= blowfishtest
35TARGETS+= $(PROGRAM_TARGETS)
36
37PROGRAMS$(depr)+= udptunnel
38PROGRAMS+= $(PROGRAM_TARGETS)
39
40DIRS+= $(libuserv) $(etcuserv) $(services)
41DIRS$(depr)+= $(bindir) $(varlibvpn) $(shareuserv)
42
43SHAREFILES$(depr)+= udptunnel-vpn-config.m4 udptunnel-vpn-defaults
44
45MECHFILES= null pkcs5 timestamp sequence blowfish
46MECHOBJS= $(foreach m, $(MECHFILES), mech-$m.o)
47
48OBJS_FORWARD= forwarder.o $(MECHOBJS) blowfish.o automech.c utils.c
49OBJS_BFTEST= blowfishtest.o blowfish.o hex.o
50
51all: $(TARGETS)
52
53install: all
54 mkdir -p $(DIRS)
55 cp -b service $(libuserv)/ipif
56 set -e; for f in $(PROGRAMS); do cp -b $$f $(bindir)/.; done
57 cp ipif $(services)/ipif:new
58 set -e; cd $(services); test -f ipif || mv ipif:new ipif
59 set -e; for f in $(SHAREFILES); do cp $$f $(shareuserv)/.; done
60
61install-docs:
62
63install-examples:
64 set -e; if [ "x$depr" = x ]; then \
65 mkdir -p $(etcvpn); \
66 cp *.example $(etcvpn)/.; \
67 fi
68
69udptunnel-reconf: udptunnel-reconf.pl Makefile
70 perl -p \
71 -e ' print " ' \
72 -e '\$$shareuserv= \"$(shareuserv)\";\n ' \
73 -e '\$$etcvpn= \"$(etcvpn)\";\n ' \
74 -e '\$$varlibvpn= \"$(varlibvpn)\";\n" if m#^\# \@\@\@\-#; ' \
75 -e ' $$_="" if m/^\# \@\@\@\-/ .. m/^\# \-\@\@\@/; ' \
76 <$< >$@.new
77 chmod +x $@.new
78 mv -f $@.new $@
79
80
81udptunnel-forwarder: $(OBJS_FORWARD)
82 $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(OBJS_FORWARD)
83
84blowfishtest: $(OBJS_BFTEST)
85 $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(OBJS_BFTEST)
86
87automech.h: automechgen.sh Makefile
88 ./$< $(MECHFILES)
89
90automech.c: automech.h
91
92clean:
93 rm -f *.o core automech.[ch] *~ ./#*#
94
95realclean distclean: clean
96 rm -f $(TARGETS)
97
98forwarder.o $(MECHOBJS) automech.o utils.o: forwarder.h automech.h
99blowfish.o mech-blowfish.o blowfishtest.o: blowfish.h
100blowfishtest.o hex.o: hex.h