| 1 | # Copyright (C) 1999 Ian Jackson |
| 2 | # |
| 3 | # This is free software; you can redistribute it and/or modify it |
| 4 | # under the terms of the GNU General Public License as published by |
| 5 | # the Free Software Foundation; either version 2 of the License, or |
| 6 | # (at your option) any later version. |
| 7 | # |
| 8 | # This program is distributed in the hope that it will be useful, but |
| 9 | # WITHOUT ANY WARRANTY; without even the implied warranty of |
| 10 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 11 | # General Public License for more details. |
| 12 | # |
| 13 | # You should have received a copy of the GNU General Public License |
| 14 | # along with userv-utils; if not, write to the Free Software |
| 15 | # Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
| 16 | # |
| 17 | # $Id: Makefile,v 1.11 2000/05/30 18:48:16 ian Exp $ |
| 18 | |
| 19 | OPTIMISE= -O2 |
| 20 | CFLAGS= -Wall -Wmissing-prototypes -Wstrict-prototypes -Wpointer-arith \ |
| 21 | -Wwrite-strings -g $(OPTIMISE) -D_GNU_SOURCE |
| 22 | |
| 23 | etcdir= /etc |
| 24 | prefix= /usr/local |
| 25 | bindir= $(prefix)/bin |
| 26 | |
| 27 | libdir= $(prefix)/lib |
| 28 | libuserv= $(libdir)/userv |
| 29 | |
| 30 | etcuserv= $(etcdir)/userv |
| 31 | services= $(etcuserv)/services.d |
| 32 | |
| 33 | TARGETS= service udptunnel-forwarder |
| 34 | |
| 35 | MECHFILES= null pkcs5 timestamp sequence blowfish |
| 36 | MECHOBJS= $(foreach m, $(MECHFILES), mech-$m.o) |
| 37 | |
| 38 | OBJS_FORWARD= forwarder.o $(MECHOBJS) blowfish.o automech.c utils.c |
| 39 | |
| 40 | all: $(TARGETS) |
| 41 | |
| 42 | install: all |
| 43 | mkdir -p $(libuserv) $(services) |
| 44 | cp -b service $(libuserv)/ipif |
| 45 | cp ipif $(services)/ipif:new |
| 46 | cp -b udptunnel $(bindir)/. |
| 47 | set -e; cd $(services); test -f ipif || mv ipif:new ipif |
| 48 | |
| 49 | udptunnel-forwarder: $(OBJS_FORWARD) |
| 50 | $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(OBJS_FORWARD) |
| 51 | |
| 52 | automech.c automech.h: automechgen.sh Makefile |
| 53 | ./$< $(MECHFILES) |
| 54 | |
| 55 | forwarder.o $(MECHOBJS) automech.o utils.o: forwarder.h automech.h |
| 56 | blowfish.o mech-blowfish.o: blowfish.h |