1 # /**********************************************************
2 # SixXS - Automatic IPv6 Connectivity Configuration Utility
3 # ***********************************************************
4 # Copyright 2003-2005 SixXS - http://www.sixxs.net
5 # ***********************************************************
6 # unix-client/Makefile - Makefile for the UNIX client
7 # ***********************************************************
9 # $Id: Makefile,v 1.32 2007-01-15 11:04:27 jeroen Exp $
10 # $Date: 2007-01-15 11:04:27 $
11 # **********************************************************/
13 SRCS
= main.c ..
/common
/tun.c ..
/common
/aiccu.c ..
/common
/hash_md5.c ..
/common
/hash_sha1.c ..
/common
/common.c ..
/common
/heartbeat.c ..
/common
/tic.c ..
/common
/ayiya.c ..
/common
/aiccu_test.c ..
/common
/resolver.c
14 INCS
= ..
/common
/tun.h ..
/common
/aiccu.h ..
/common
/hash_md5.h ..
/common
/hash_sha1.h ..
/common
/common.h ..
/common
/heartbeat.h ..
/common
/tic.h ..
/common
/ayiya.h ..
/common
/resolver.h
15 OBJS
= main.o ..
/common
/tun.o ..
/common
/aiccu.o ..
/common
/hash_md5.o ..
/common
/hash_sha1.o ..
/common
/common.o ..
/common
/heartbeat.o ..
/common
/tic.o ..
/common
/ayiya.o ..
/common
/aiccu_test.o ..
/common
/resolver.o
17 # New features not fully implemented and thus disabled for now
18 #CFLAGS += -D NEWSTUFF_TSP -D NEWSTUFF_TEEPEE
19 #SRCS += ../common/tsp.c ../common/teepee.c
20 #OBJS += ../common/tsp.o ../common/teepee.o
21 #INCS += ../common/tsp.h ../common/teepee.h
23 # Our very *bliep* set of options to make sure that these things can't cause any issues
24 CWARNS
+= -W
-Wall
-Wshadow
-Wpointer-arith
-Wcast-align
-Wwrite-strings
-Waggregate-return
-Wstrict-prototypes
-Wmissing-prototypes
-Wmissing-declarations
-Wredundant-decls
-Wnested-externs
-Winline
-Wbad-function-cast
-fshort-enums
-fstrict-aliasing
-fno-common
-Wpadded
-pedantic
-D_REENTRANT
27 #CFLAGS += $(CWARNS) -D_GNU_SOURCE -D_DEBUG -g3 -O0
28 CFLAGS
+= $(CWARNS
) -D_GNU_SOURCE
32 # Add -O3 when nothing is specified yet
33 ifeq ($(shell echo
$(CFLAGS
) | grep
-c
"\-O"),0)
37 # This is a console client
38 CFLAGS
+= -D AICCU_CONSOLE
41 # Used by TIC to secure that communication
42 # Currently defaultly builds only on Linux, but other platforms might easily also support it
43 ifeq ($(shell uname | grep
-c
"Linux"),1)
44 CFLAGS
+= -D AICCU_GNUTLS
49 ifeq ($(shell uname | grep
-c
"Linux"),1)
50 CFLAGS
+= -D_LINUX
-D HAS_IFHEAD
-D AICCU_TYPE
="\"linux\""
51 SRCS
+= ..
/common
/aiccu_linux.c
52 OBJS
+= ..
/common
/aiccu_linux.o
53 LDFLAGS
+= -lpthread
-lresolv
57 ifeq ($(shell uname | grep
-c
"FreeBSD"),1)
61 ifeq ($(shell uname
-r | cut
-c
1),4)
62 CFLAGS
+= -D AICCU_TYPE
="\"freebsd4\""
63 SRCS
+= ..
/common
/aiccu_freebsd4.c
64 OBJS
+= ..
/common
/aiccu_freebsd4.o
67 CFLAGS
+= -D NEED_IFHEAD
-D AICCU_TYPE
="\"kame\""
68 SRCS
+= ..
/common
/aiccu_kame.c
69 OBJS
+= ..
/common
/aiccu_kame.o
74 ifeq ($(shell uname | grep
-c
"DragonFly"),1)
75 CFLAGS
+= -D_DFBSD
-D NEED_IFHEAD
-D AICCU_TYPE
="\"dragonfly\""
76 SRCS
+= ..
/common
/aiccu_freebsd4.c
77 OBJS
+= ..
/common
/aiccu_freebsd4.o
82 ifeq ($(shell uname | grep
-c
"NetBSD"),1)
83 CFLAGS
+= -D_NETBSD
-D AICCU_TYPE
="\"kame\""
85 # Check if net/if_tun.h has TUNSIFHEAD and enable support for it
86 ifneq ($(shell grep
-c TUNSIFHEAD
/usr
/include/net
/if_tun.h
2>/dev
/null
),1)
87 # Supports TUNSIFHEAD -> AYIYA/l2tp available
88 CFLAGS
+= -D NEED_IFHEAD
90 # Doesn't support TUNSIFHEAD -> No AYIYA/l2tp available
91 CFLAGS
+= -D NO_IFHEAD
94 SRCS
+= ..
/common
/aiccu_kame.c
95 OBJS
+= ..
/common
/aiccu_kame.o
96 CFLAGS
+= -pthread
-D_NETBSD_SOURCE
100 ifeq ($(shell uname | grep
-c
"OpenBSD"),1)
101 CFLAGS
+= -D_OPENBSD
-D HAS_IFHEAD
103 ifeq ($(shell uname
-r | cut
-c
1),2)
104 CFLAGS
+= -D AICCU_TYPE
="\"openbsd2\""
105 SRCS
+= ..
/common
/aiccu_openbsd2.c
106 OBJS
+= ..
/common
/aiccu_openbsd2.o
109 CFLAGS
+= -D AICCU_TYPE
="\"openbsd\""
110 SRCS
+= ..
/common
/aiccu_openbsd.c
111 OBJS
+= ..
/common
/aiccu_openbsd.o
117 ifeq ($(shell uname | grep
-c
"Darwin"),1)
118 CFLAGS
+= -D_DARWIN
-D NEED_IFHEAD
-D AICCU_TYPE
="\"darwin\""
119 SRCS
+= ..
/common
/aiccu_darwin.c
120 OBJS
+= ..
/common
/aiccu_darwin.o
125 ifeq ($(shell uname | grep
-c
"SunOS"),1)
126 CFLAGS
+= -D_SUNOS
-D AICCU_TYPE
="\"sunos\""
127 SRCS
+= ..
/common
/aiccu_sunos.c
128 OBJS
+= ..
/common
/aiccu_sunos.o
129 LDFLAGS
+= -lsocket
-lnsl
-lresolv
133 ifeq ($(shell uname | grep
-c
"AIX"),1)
134 CC
= @
/usr
/vac
/bin
/xlc_r
135 CFLAGS
= -qthreaded
-q64
-qlanglvl
=stdc99
-bmaxdata
:0xD0000000 -D_64BIT
-g
-qdbxextra
-qfullpath
-qheapdebug
-qformat
=all -qcheck
=all
136 CFLAGS
+= -D AICCU_CONSOLE
137 CFLAGS
+= -D_AIX
-D AICCU_TYPE
="\"aix\""
138 SRCS
+= ..
/common
/aiccu_aix.c
139 OBJS
+= ..
/common
/aiccu_aix.o
146 aiccu
: $(OBJS
) ${SRCS} ${INCS}
147 $(CC
) $(CFLAGS
) $(LDFLAGS
) -o
$@
$(OBJS
)
148 ifeq ($(shell echo
$(CFLAGS
) | grep
-c
"DEBUG"),0)
149 ifeq ($(shell echo
"$(RPM_OPT_FLAGS)" | wc
-c
),1)
155 $(RM
) -f
$(OBJS
) aiccu
158 cp aiccu
${DESTDIR}${dirsbin}aiccu