2 # Copyright (C) 1998-2001 Henry Spencer.
4 # This program is free software; you can redistribute it and/or modify it
5 # under the terms of the GNU General Public License as published by the
6 # Free Software Foundation; either version 2 of the License, or (at your
7 # option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>.
9 # This program is distributed in the hope that it will be useful, but
10 # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
11 # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 # RCSID $Id: Makefile,v 1.50 2002/03/27 23:08:24 mcr Exp $
18 include ../Makefile.inc
19 include ../Makefile.ver
23 MANDIR=$(MANTREE)/man3
25 SRCS=addrtoa.c addrtot.c addrtypeof.c anyaddr.c atoaddr.c \
26 atoasr.c atosa.c atosubnet.c atoul.c copyright.c datatot.c \
27 goodmask.c initaddr.c initsaid.c initsubnet.c keyblobtoid.c \
28 optionsfrom.c pfkey_v2_build.c pfkey_v2_ext_bits.c pfkey_v2_parse.c \
30 portof.c prng.c rangetoa.c rangetosubnet.c sameaddr.c \
31 satoa.c satot.c subnetof.c subnettoa.c subnettot.c \
32 subnettypeof.c ttoaddr.c ttodata.c \
33 ttosa.c ttosubnet.c ttoul.c ultoa.c ultot.c \
36 OBJS=${SRCS:.c=.o} version.o
38 HDRS=freeswan.h internal.h
41 CFLAGS=-I. $(USERCOMPILE)
43 #CFLAGS+= -Wconversion
44 #CFLAGS+= -Wmissing-prototypes
45 CFLAGS+= -Wpointer-arith
47 #CFLAGS+= -Wmissing-declarations
48 CFLAGS+= -Wstrict-prototypes
51 #CFLAGS+= -Wwrite-strings
52 CFLAGS+= -Wbad-function-cast
57 MANS=anyaddr.3 atoaddr.3 atoasr.3 atosa.3 atoul.3 goodmask.3 \
58 initaddr.3 initsubnet.3 keyblobtoid.3 \
59 optionsfrom.3 portof.3 prng.3 rangetosubnet.3 \
60 sameaddr.3 subnetof.3 ttoaddr.3 ttodata.3 ttosa.3 ttoul.3 version.3
61 .PHONY: all install clean l t lt tar check depend checkprograms
65 all: $(EXTHDRS) $(LIB) $(EXTLIBS)
72 $(INSTALL) $(INSTMANFLAGS) $$f $(MANDIR)/ipsec_$$f || exit 1 ; \
73 ../utils/manlink $(MANDIR) ipsec_$$f ; \
77 $(AR) $(ARFLAGS) $(LIB) $(OBJS)
81 # build version.c using version number from Makefile.ver
82 version.c: version.in.c ../Makefile.ver
83 sed '/"/s/xxx/$(IPSECVERSION)/' version.in.c >$@
88 libdes.a: ../libdes/libdes.a
89 ln -f -s ../libdes/libdes.a
91 # yes, that's CFLAG=, not CFLAGS=
94 if test " `arch | sed 's/^i[3456]/x/'`" = " x86" ; \
95 then $(MAKE) CC='$(CC)' CFLAG='$(CFLAGS)' TESTING='' x86-elf ; \
96 else $(MAKE) CC='$(CC)' CFLAG='$(CFLAGS)' libdes.a ; \
100 rm -f $(LIB) *.o try* core *.core $(EXTHDRS) $(EXTLIBS) version.c
101 cd ../libdes ; $(MAKE) clean
105 # developer-only stuff
107 $(MAKE) $(LIB) ARFLAGS=crv CFLAGS=-O
112 cc -DATOSUBNET_MAIN try.c $(LIB) -o try
114 cp ttosubnet.c try1a.c
115 cc -DTTOSUBNET_MAIN try1a.c $(LIB) -o try1a
118 cc -DTTODATA_MAIN try2.c $(LIB) -o try2
121 cc -DATOASR_MAIN try3.c $(LIB) -o try3
124 cc -DATOSA_MAIN try4.c $(LIB) -o try4
127 cc -DTTOSA_MAIN try4a.c $(LIB) -o try4a
129 cp rangetosubnet.c try6.c
130 cc -DRANGETOSUBNET_MAIN try6.c $(LIB) -o try6
132 cp keyblobtoid.c try7.c
133 cc -DKEYID_MAIN try7.c $(LIB) -o try7
136 cc -DPRNG_MAIN try8.c $(LIB) -o try8
141 cp optionsfrom.c try5.c
142 cc -DTEST try5.c $(LIB) -o try5
143 echo --foo --bar >try5in1
144 echo --optionsfrom >>try5in1
145 echo try5in2 >>try5in1
147 ./try5 --foo --bar --optionsfrom try5in1 --bar something
150 tar -cvf /tmp/lib.tar Makefile [a-z]*
153 echo no checks in lib right now.
156 makedepend -Y -- $(CFLAGS) -- $(SRCS)
162 pfkey_v2_build.o: freeswan.h ../pluto/constants.h
163 pfkey_v2_build.o: ../pluto/defs.h ../pluto/log.h ./pfkeyv2.h ./pfkey.h
164 pfkey_v2_ext_bits.o: freeswan.h ./pfkeyv2.h ./pfkey.h
165 pfkey_v2_parse.o: freeswan.h ../pluto/constants.h
166 pfkey_v2_parse.o: ../pluto/defs.h ../pluto/log.h ./pfkeyv2.h ./pfkey.h
167 pfkey_v2_debug.o: freeswan.h ./pfkeyv2.h ./pfkey.h