*** empty log message ***
[userv-utils] / ipif / Makefile
CommitLineData
f0e54a99 1# Makefile for ipif/udptunnel stuff
2
3# Copyright (C) 1999-2000 Ian Jackson
1c1a9fa1 4#
caa68336 5# This is free software; you can redistribute it and/or modify it
6# under the terms of the GNU General Public License as published by
7# the Free Software Foundation; either version 2 of the License, or
8# (at your option) any later version.
9#
10# This program is distributed in the hope that it will be useful, but
11# WITHOUT ANY WARRANTY; without even the implied warranty of
12# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13# General Public License for more details.
14#
15# You should have received a copy of the GNU General Public License
16# along with userv-utils; if not, write to the Free Software
17# Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18#
19# $Id$
1c1a9fa1 20
6362f12c 21include ../settings.make
e5e5fd4e 22
6362f12c 23varlibvpn= $(varlibuserv)/vpn
2e082dfe 24etcvpn= $(etcdir)/userv/vpn
6d90651a 25
2e082dfe 26PROGRAM_TARGETS= udptunnel-forwarder udptunnel-reconf
31dcbf98 27TARGETS= service blowfishtest $(PROGRAM_TARGETS)
28PROGRAMS= udptunnel $(PROGRAM_TARGETS)
1fb3cba0 29
30MECHFILES= null pkcs5 timestamp sequence blowfish
31MECHOBJS= $(foreach m, $(MECHFILES), mech-$m.o)
32
f9e59051 33OBJS_FORWARD= forwarder.o $(MECHOBJS) blowfish.o automech.c utils.c
ed509ebd 34OBJS_BFTEST= blowfishtest.o blowfish.o hex.o
6d90651a 35
36all: $(TARGETS)
37
38install: all
6362f12c 39 mkdir -p $(bindir) $(libuserv) $(services) \
2e082dfe 40 $(varlibvpn) $(shareuserv)
8d9c5866 41 cp -b service $(libuserv)/ipif
f0e54a99 42 cp -b $(PROGRAMS) $(bindir)/.
2e082dfe 43 cp ipif $(services)/ipif:new
e5e5fd4e 44 set -e; cd $(services); test -f ipif || mv ipif:new ipif
2e082dfe 45 cp udptunnel-vpn-config.m4 udptunnel-vpn-defaults \
46 $(shareuserv)/.
47
6362f12c 48install-docs:
49
50install-examples:
51 mkdir -p $(etcvpn)
52 cp *.example $(etcvpn)/.
53
2e082dfe 54udptunnel-reconf: udptunnel-reconf.pl Makefile
55 perl -pe ' \
56 print "\
57\$$shareuserv= \"$(shareuserv)\";\n\
58\$$etcvpn= \"$(etcvpn)\";\n\
59\$$varlibvpn= \"$(varlibvpn)\";\n" if m#^\# \@\@\@\-#; \
60 $$_="" if m/^\# \@\@\@\-/ .. m/^\# \-\@\@\@/; \
61 ' \
62 <$< >$@.new
63 chmod +x $@.new
64 mv -f $@.new $@
65
1fb3cba0 66
67udptunnel-forwarder: $(OBJS_FORWARD)
68 $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(OBJS_FORWARD)
69
ed509ebd 70blowfishtest: $(OBJS_BFTEST)
71 $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(OBJS_BFTEST)
72
31dcbf98 73automech.h: automechgen.sh Makefile
1fb3cba0 74 ./$< $(MECHFILES)
75
31dcbf98 76automech.c: automech.h
77
78clean:
79 rm -f *.o core automech.[ch] *~ ./#*#
80
c62ccbd5 81realclean distclean: clean
31dcbf98 82 rm -f $(TARGETS)
83
f9e59051 84forwarder.o $(MECHOBJS) automech.o utils.o: forwarder.h automech.h
ed509ebd 85blowfish.o mech-blowfish.o blowfishtest.o: blowfish.h
86blowfishtest.o hex.o: hex.h