@@ -1,11 +1,12 @@
[userv-utils] / ipif / Makefile
CommitLineData
935da5a4 1# Makefile for ipif/udptunnel stuff
2
3# Copyright (C) 1999-2000 Ian Jackson
1c1a9fa1 4#
12ecfeab 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#
f4562dd7 19# $Id: Makefile,v 1.16 2000/12/11 02:46:04 ian Exp $
1c1a9fa1 20
2c310400 21OPTIMISE= -O2
1c1a9fa1 22CFLAGS= -Wall -Wmissing-prototypes -Wstrict-prototypes -Wpointer-arith \
4fa63592 23 -Wwrite-strings -g $(OPTIMISE) -D_GNU_SOURCE \
24 $(XCFLAGS)
1c1a9fa1 25
e5e5fd4e 26etcdir= /etc
6d90651a 27prefix= /usr/local
caad5ebb 28bindir= $(prefix)/bin
c852886b 29vardir= /var
e5e5fd4e 30
31libdir= $(prefix)/lib
c852886b 32sharedir= $(prefix)/share
e5e5fd4e 33libuserv= $(libdir)/userv
c852886b 34shareuserv= $(sharedir)/userv
35varlib= $(vardir)/lib
36varlibuserv= $(varlib)/userv
37varlibvpn= $(varlibuserv)/vpn
e5e5fd4e 38
39etcuserv= $(etcdir)/userv
c852886b 40etcvpn= $(etcdir)/userv/vpn
e5e5fd4e 41services= $(etcuserv)/services.d
6d90651a 42
c852886b 43PROGRAM_TARGETS= udptunnel-forwarder udptunnel-reconf
4fa63592 44TARGETS= service blowfishtest $(PROGRAM_TARGETS)
45PROGRAMS= udptunnel $(PROGRAM_TARGETS)
84f87e82 46
47MECHFILES= null pkcs5 timestamp sequence blowfish
48MECHOBJS= $(foreach m, $(MECHFILES), mech-$m.o)
49
aaa9ab3a 50OBJS_FORWARD= forwarder.o $(MECHOBJS) blowfish.o automech.c utils.c
8bb9d875 51OBJS_BFTEST= blowfishtest.o blowfish.o hex.o
6d90651a 52
53all: $(TARGETS)
54
55install: all
c852886b 56 mkdir -p $(libuserv) $(services) $(etcvpn) \
57 $(varlibvpn) $(shareuserv)
8d9c5866 58 cp -b service $(libuserv)/ipif
935da5a4 59 cp -b $(PROGRAMS) $(bindir)/.
c852886b 60 cp ipif $(services)/ipif:new
e5e5fd4e 61 set -e; cd $(services); test -f ipif || mv ipif:new ipif
c852886b 62 cp *.example $(etcvpn)/.
63 cp udptunnel-vpn-config.m4 udptunnel-vpn-defaults \
64 $(shareuserv)/.
65
66udptunnel-reconf: udptunnel-reconf.pl Makefile
67 perl -pe ' \
68 print "\
69\$$shareuserv= \"$(shareuserv)\";\n\
70\$$etcvpn= \"$(etcvpn)\";\n\
71\$$varlibvpn= \"$(varlibvpn)\";\n" if m#^\# \@\@\@\-#; \
72 $$_="" if m/^\# \@\@\@\-/ .. m/^\# \-\@\@\@/; \
73 ' \
74 <$< >$@.new
75 chmod +x $@.new
76 mv -f $@.new $@
77
84f87e82 78
79udptunnel-forwarder: $(OBJS_FORWARD)
80 $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(OBJS_FORWARD)
81
8bb9d875 82blowfishtest: $(OBJS_BFTEST)
83 $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(OBJS_BFTEST)
84
4fa63592 85automech.h: automechgen.sh Makefile
84f87e82 86 ./$< $(MECHFILES)
87
4fa63592 88automech.c: automech.h
89
90clean:
91 rm -f *.o core automech.[ch] *~ ./#*#
92
f4562dd7 93realclean distclean: clean
4fa63592 94 rm -f $(TARGETS)
95
aaa9ab3a 96forwarder.o $(MECHOBJS) automech.o utils.o: forwarder.h automech.h
8bb9d875 97blowfish.o mech-blowfish.o blowfishtest.o: blowfish.h
98blowfishtest.o hex.o: hex.h