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