1 # Makefile for ipif/udptunnel stuff
3 # Copyright (C) 1999-2000 Ian Jackson
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.
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.
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.
22 CFLAGS
= -Wall
-Wmissing-prototypes
-Wstrict-prototypes
-Wpointer-arith \
23 -Wwrite-strings
-g
$(OPTIMISE
) -D_GNU_SOURCE \
32 sharedir
= $(prefix)/share
33 libuserv
= $(libdir)/userv
34 shareuserv
= $(sharedir
)/userv
36 varlibuserv
= $(varlib
)/userv
37 varlibvpn
= $(varlibuserv
)/vpn
39 etcuserv
= $(etcdir
)/userv
40 etcvpn
= $(etcdir
)/userv
/vpn
41 services
= $(etcuserv
)/services.d
43 PROGRAM_TARGETS
= udptunnel-forwarder udptunnel-reconf
44 TARGETS
= service blowfishtest
$(PROGRAM_TARGETS
)
45 PROGRAMS
= udptunnel
$(PROGRAM_TARGETS
)
47 MECHFILES
= null pkcs5 timestamp sequence blowfish
48 MECHOBJS
= $(foreach m
, $(MECHFILES
), mech-
$m.o
)
50 OBJS_FORWARD
= forwarder.o
$(MECHOBJS
) blowfish.o automech.c utils.c
51 OBJS_BFTEST
= blowfishtest.o blowfish.o hex.o
56 mkdir
-p
$(libuserv
) $(services
) $(etcvpn
) \
57 $(varlibvpn
) $(shareuserv
)
58 cp
-b service
$(libuserv
)/ipif
59 cp
-b
$(PROGRAMS
) $(bindir)/.
60 cp ipif
$(services
)/ipif
:new
61 set
-e
; cd
$(services
); test -f ipif || mv ipif
:new ipif
62 cp
*.example
$(etcvpn
)/.
63 cp udptunnel-vpn-config.m4 udptunnel-vpn-defaults \
66 udptunnel-reconf
: udptunnel-reconf.pl Makefile
69 \$$shareuserv= \"$(shareuserv)\";\n\
70 \$$etcvpn= \"$(etcvpn)\";\n\
71 \$$varlibvpn= \"$(varlibvpn)\";\n" if m#^\# \@\@\@\-#; \
72 $$_="" if m/^\# \@\@\@\-/ .. m/^\# \-\@\@\@/; \
79 udptunnel-forwarder
: $(OBJS_FORWARD
)
80 $(CC
) $(CFLAGS
) $(LDFLAGS
) -o
$@
$(OBJS_FORWARD
)
82 blowfishtest
: $(OBJS_BFTEST
)
83 $(CC
) $(CFLAGS
) $(LDFLAGS
) -o
$@
$(OBJS_BFTEST
)
85 automech.h
: automechgen.sh Makefile
88 automech.c
: automech.h
91 rm -f
*.o core automech.
[ch
] *~ .
/#*#
93 realclean distclean: clean
96 forwarder.o
$(MECHOBJS
) automech.o utils.o
: forwarder.h automech.h
97 blowfish.o mech-blowfish.o blowfishtest.o
: blowfish.h
98 blowfishtest.o hex.o
: hex.h