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 | |
2c310400 |
21 | OPTIMISE= -O2 |
1c1a9fa1 |
22 | CFLAGS= -Wall -Wmissing-prototypes -Wstrict-prototypes -Wpointer-arith \ |
31dcbf98 |
23 | -Wwrite-strings -g $(OPTIMISE) -D_GNU_SOURCE \ |
24 | $(XCFLAGS) |
1c1a9fa1 |
25 | |
e5e5fd4e |
26 | etcdir= /etc |
6d90651a |
27 | prefix= /usr/local |
caad5ebb |
28 | bindir= $(prefix)/bin |
e5e5fd4e |
29 | |
30 | libdir= $(prefix)/lib |
31 | libuserv= $(libdir)/userv |
32 | |
33 | etcuserv= $(etcdir)/userv |
34 | services= $(etcuserv)/services.d |
6d90651a |
35 | |
31dcbf98 |
36 | PROGRAM_TARGETS= udptunnel-forwarder |
37 | TARGETS= service blowfishtest $(PROGRAM_TARGETS) |
38 | PROGRAMS= udptunnel $(PROGRAM_TARGETS) |
1fb3cba0 |
39 | |
40 | MECHFILES= null pkcs5 timestamp sequence blowfish |
41 | MECHOBJS= $(foreach m, $(MECHFILES), mech-$m.o) |
42 | |
f9e59051 |
43 | OBJS_FORWARD= forwarder.o $(MECHOBJS) blowfish.o automech.c utils.c |
ed509ebd |
44 | OBJS_BFTEST= blowfishtest.o blowfish.o hex.o |
6d90651a |
45 | |
46 | all: $(TARGETS) |
47 | |
48 | install: all |
e5e5fd4e |
49 | mkdir -p $(libuserv) $(services) |
8d9c5866 |
50 | cp -b service $(libuserv)/ipif |
e5e5fd4e |
51 | cp ipif $(services)/ipif:new |
f0e54a99 |
52 | cp -b $(PROGRAMS) $(bindir)/. |
e5e5fd4e |
53 | set -e; cd $(services); test -f ipif || mv ipif:new ipif |
1fb3cba0 |
54 | |
55 | udptunnel-forwarder: $(OBJS_FORWARD) |
56 | $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(OBJS_FORWARD) |
57 | |
ed509ebd |
58 | blowfishtest: $(OBJS_BFTEST) |
59 | $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(OBJS_BFTEST) |
60 | |
31dcbf98 |
61 | automech.h: automechgen.sh Makefile |
1fb3cba0 |
62 | ./$< $(MECHFILES) |
63 | |
31dcbf98 |
64 | automech.c: automech.h |
65 | |
66 | clean: |
67 | rm -f *.o core automech.[ch] *~ ./#*# |
68 | |
69 | realclean: clean |
70 | rm -f $(TARGETS) |
71 | |
f9e59051 |
72 | forwarder.o $(MECHOBJS) automech.o utils.o: forwarder.h automech.h |
ed509ebd |
73 | blowfish.o mech-blowfish.o blowfishtest.o: blowfish.h |
74 | blowfishtest.o hex.o: hex.h |