import of 0.2-rm+zomb-pre8
[vpnc.git] / Makefile
blob9975ae1f82f64d79c600dba0692c866aa96ad5ea
1 # Makefile for an IPSec VPN client compatible with Cisco equipment.
2 # Copyright (C) 2002 Geoffrey Keating
4 # This program is free software; you can redistribute it and/or modify
5 # it under the terms of the GNU General Public License as published by
6 # the Free Software Foundation; either version 2 of the License, or
7 # (at your option) any later version.
8 #
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
14 # You should have received a copy of the GNU General Public License
15 # along with this program; if not, write to the Free Software
16 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 CC=gcc
19 CFLAGS=-W -Wall -O -g '-DVERSION="$(shell cat VERSION)"' $(shell libgcrypt-config --cflags)
20 LDFLAGS=-g $(shell libgcrypt-config --libs)
22 ifeq ($(shell uname -s), Linux)
23 SYSDEP=sysdep-linux.o
24 endif
25 ifeq ($(shell uname -s), FreeBSD)
26 CFLAGS += -DSOCKADDR_IN_SIN_LEN -DHAVE_SA_LEN
27 SYSDEP=sysdep-bsd.o
28 endif
29 ifeq ($(shell uname -s), NetBSD)
30 CFLAGS += -DSOCKADDR_IN_SIN_LEN -DHAVE_SA_LEN
31 SYSDEP=sysdep-bsd.o
32 endif
33 ifeq ($(shell uname -s), OpenBSD)
34 CFLAGS += -DSOCKADDR_IN_SIN_LEN -DHAVE_SA_LEN -DNEED_IPLEN_FIX -DNEW_TUN
35 SYSDEP=sysdep-bsd.o
36 endif
37 ifeq ($(shell uname -s), SunOS)
38 SYSDEP=sysdep-svr4.o
39 endif
41 vpnc : vpnc.o isakmp-pkt.o tunip.o $(SYSDEP) dh.o math_group.o
42 $(CC) -o $@ $^ $(LDFLAGS)
44 vpnc.o : isakmp.h isakmp-pkt.h dh.h sysdep.h math_group.h vpnc.h VERSION
45 isakmp-pkt.o : isakmp.h isakmp-pkt.h vpnc.h
46 tunip.o : sysdep.h vpnc.h
47 dh.o : dh.h math_group.h
48 math_group.o : math_group.h
50 FILELIST := $(shell echo *.c *.h vpnc-*) Makefile README ChangeLog COPYING TODO VERSION vpnc.conf vpnc.8
52 ../vpnc-%.tar.gz : vpnc-$*.tar.gz
54 vpnc-%.tar.gz : $(FILELIST)
55 mkdir vpnc-$*
56 cp -al $(FILELIST) vpnc-$*/
57 tar zcf ../$@ vpnc-$*
58 rm -rf vpnc-$*
60 release: VERSION vpnc-$(shell cat VERSION).tar.gz
62 clean:
63 -rm -f vpnc *.o
65 .PHONY : clean