ipif: Update docs to reflect fact that we are now using tun/tap.
[userv-utils] / ipif / Makefile
CommitLineData
f0e54a99 1# Makefile for ipif/udptunnel stuff
2
9028e234
IJ
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>
1c1a9fa1 10#
caa68336 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
9028e234 13# the Free Software Foundation; either version 3 of the License, or
caa68336 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
9028e234 22# along with userv-utils; if not, see http://www.gnu.org/licenses/.
1c1a9fa1 23
6362f12c 24include ../settings.make
e5e5fd4e 25
6362f12c 26varlibvpn= $(varlibuserv)/vpn
2e082dfe 27etcvpn= $(etcdir)/userv/vpn
6d90651a 28
2e082dfe 29PROGRAM_TARGETS= udptunnel-forwarder udptunnel-reconf
31dcbf98 30TARGETS= service blowfishtest $(PROGRAM_TARGETS)
31PROGRAMS= udptunnel $(PROGRAM_TARGETS)
1fb3cba0 32
33MECHFILES= null pkcs5 timestamp sequence blowfish
34MECHOBJS= $(foreach m, $(MECHFILES), mech-$m.o)
35
f9e59051 36OBJS_FORWARD= forwarder.o $(MECHOBJS) blowfish.o automech.c utils.c
ed509ebd 37OBJS_BFTEST= blowfishtest.o blowfish.o hex.o
6d90651a 38
39all: $(TARGETS)
40
41install: all
6362f12c 42 mkdir -p $(bindir) $(libuserv) $(services) \
2e082dfe 43 $(varlibvpn) $(shareuserv)
8d9c5866 44 cp -b service $(libuserv)/ipif
f0e54a99 45 cp -b $(PROGRAMS) $(bindir)/.
2e082dfe 46 cp ipif $(services)/ipif:new
e5e5fd4e 47 set -e; cd $(services); test -f ipif || mv ipif:new ipif
2e082dfe 48 cp udptunnel-vpn-config.m4 udptunnel-vpn-defaults \
49 $(shareuserv)/.
50
6362f12c 51install-docs:
52
53install-examples:
54 mkdir -p $(etcvpn)
55 cp *.example $(etcvpn)/.
56
2e082dfe 57udptunnel-reconf: udptunnel-reconf.pl Makefile
80ebbf9e
IJ
58 perl -p \
59 -e ' print " ' \
60 -e '\$$shareuserv= \"$(shareuserv)\";\n ' \
61 -e '\$$etcvpn= \"$(etcvpn)\";\n ' \
62 -e '\$$varlibvpn= \"$(varlibvpn)\";\n" if m#^\# \@\@\@\-#; ' \
63 -e ' $$_="" if m/^\# \@\@\@\-/ .. m/^\# \-\@\@\@/; ' \
2e082dfe 64 <$< >$@.new
65 chmod +x $@.new
66 mv -f $@.new $@
67
1fb3cba0 68
69udptunnel-forwarder: $(OBJS_FORWARD)
70 $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(OBJS_FORWARD)
71
ed509ebd 72blowfishtest: $(OBJS_BFTEST)
73 $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(OBJS_BFTEST)
74
31dcbf98 75automech.h: automechgen.sh Makefile
1fb3cba0 76 ./$< $(MECHFILES)
77
31dcbf98 78automech.c: automech.h
79
80clean:
81 rm -f *.o core automech.[ch] *~ ./#*#
82
c62ccbd5 83realclean distclean: clean
31dcbf98 84 rm -f $(TARGETS)
85
f9e59051 86forwarder.o $(MECHOBJS) automech.o utils.o: forwarder.h automech.h
ed509ebd 87blowfish.o mech-blowfish.o blowfishtest.o: blowfish.h
88blowfishtest.o hex.o: hex.h