OSDN Git Service

2013.10.24
[uclinux-h8/uClinux-dist.git] / freeswan / klips / net / ipsec / Makefile
1 # Makefile for KLIPS kernel code
2 # Copyright (C) 1998, 1999, 2000,2001  Richard Guy Briggs.
3
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>.
8
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
12 # for more details.
13 #
14 # RCSID $Id: Makefile,v 1.39 2002/01/17 04:39:40 rgb Exp $
15 #
16 # Note! Dependencies are done automagically by 'make dep', which also
17 # removes any old dependencies. DON'T put your own dependencies here
18 # unless it's something special (ie not a .c file).
19 #
20 # Note 2! The CFLAGS definition is now in the main makefile...
21
22 ifndef TOPDIR
23 TOPDIR  := /usr/src/linux
24 endif
25
26 ifndef ARCH
27 ARCH = arch
28 endif
29
30 subdir-  := 
31 subdir-n := 
32 subdir-y :=
33 subdir-m :=
34
35 O_TARGET := ipsec.o
36 obj-y := ipsec_init.o ipsec_sa.o ipsec_radij.o radij.o
37 obj-y += ipsec_life.o ipsec_proc.o
38 obj-y += ipsec_tunnel.o ipsec_rcv.o sysctl_net_ipsec.o 
39 obj-y +=  pfkey_v2.o pfkey_v2_parser.o 
40 obj-$(CONFIG_IXP4XX_CRYPTO) += ipsec_glue_mbuf.o ipsec_glue.o ipsec_glue_desc.o
41
42 export-objs := radij.o
43
44 obj-$(CONFIG_IPSEC_ALG) +=ipsec_alg.o alg/ipsec_alg_static.o
45 export-objs += ipsec_alg.o
46 subdir-$(CONFIG_IPSEC_ALG) += alg
47
48 # 'override CFLAGS' should really be 'EXTRA_CFLAGS'
49 EXTRA_CFLAGS += -Ilibfreeswan -Ilibdes
50 ifeq ($(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION),2.4.2-2)
51 EXTRA_CFLAGS += -DREDHAT_BOGOSITY
52 endif
53 ifeq ($(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION),2.4.3-12)
54 EXTRA_CFLAGS += -DREDHAT_BOGOSITY
55 endif
56
57 ifdef CONFIG_IXP4XX_CRYPTO
58 ifdef CONFIG_CPU_IXP46X
59 IX_XSCALE_SW = $(ROOTDIR)/modules/ixp425/ixp400-2.1/ixp400_xscale_sw
60 OSAL_DIR     = $(ROOTDIR)/modules/ixp425/ixp400-2.1/ixp_osal
61 EXTRA_CFLAGS += \
62         -I$(IX_XSCALE_SW)/src/include \
63         -I$(OSAL_DIR)/ \
64         -I$(OSAL_DIR)/os/linux/include/ \
65         -I$(OSAL_DIR)/os/linux/include/modules/ \
66         -I$(OSAL_DIR)/os/linux/include/modules/ioMem/ \
67         -I$(OSAL_DIR)/os/linux/include/modules/bufferMgt/ \
68         -I$(OSAL_DIR)/os/linux/include/core/  \
69         -I$(OSAL_DIR)/os/linux/include/platforms/ \
70         -I$(OSAL_DIR)/os/linux/include/platforms/ixp400/ \
71         -I$(OSAL_DIR)/os/linux/include/platforms/ixp400/ixp425 \
72         -I$(OSAL_DIR)/os/linux/include/platforms/ixp400/ixp465 \
73         -I$(OSAL_DIR)/os/linux/include/core/ \
74         -I$(OSAL_DIR)/include/ \
75         -I$(OSAL_DIR)/include/modules/ \
76         -I$(OSAL_DIR)/include/modules/bufferMgt/ \
77         -I$(OSAL_DIR)/include/modules/ioMem/ \
78         -I$(OSAL_DIR)/include/platforms/ \
79         -I$(OSAL_DIR)/include/platforms/ixp400/ \
80         -D__ixp46X
81 else
82 EXTRA_CFLAGS +=         -I$(ROOTDIR)/modules/ixp425/ixp400-1.4/ixp400_xscale_sw/src/include
83 endif
84 EXTRA_CFLAGS +=         -I../../include/linux \
85                         -DUSE_IXP4XX_CRYPTO
86 endif
87
88 #ifeq ($(CONFIG_IPSEC_DEBUG),y)
89 #EXTRA_CFLAGS += -g
90 #endif
91
92 EXTRA_CFLAGS += $(KLIPSCOMPILE)
93 EXTRA_CFLAGS += -Wall
94 #EXTRA_CFLAGS += -Werror
95 #EXTRA_CFLAGS += -Wconversion 
96 #EXTRA_CFLAGS += -Wmissing-prototypes 
97 EXTRA_CFLAGS += -Wpointer-arith 
98 #EXTRA_CFLAGS += -Wcast-qual 
99 #EXTRA_CFLAGS += -Wmissing-declarations 
100 EXTRA_CFLAGS += -Wstrict-prototypes
101 #EXTRA_CFLAGS += -pedantic
102 #EXTRA_CFLAGS += -O3
103 #EXTRA_CFLAGS += -W
104 #EXTRA_CFLAGS += -Wwrite-strings 
105 #EXTRA_CFLAGS += -Wbad-function-cast
106
107 ifeq ($(ARCH),m68knommu)
108 CFLAGS_ipsec_sha1.o = -O1
109 endif
110
111 obj-$(CONFIG_IPSEC_ENC_3DES) += libdes/libdes.a
112 obj-$(CONFIG_IPSEC_AUTH_HMAC_MD5) += ipsec_md5c.o
113 obj-$(CONFIG_IPSEC_AUTH_HMAC_SHA1) += ipsec_sha1.o
114 obj-$(CONFIG_IPSEC_IPCOMP) += ipcomp.o zlib/zlib.a
115 subdir-$(CONFIG_IPSEC_IPCOMP) += zlib
116 subdir-$(CONFIG_IPSEC) += libfreeswan
117 obj-y += libfreeswan/libkernel.a
118
119 ###
120 ### Pre Rules.make
121 ###
122 # undo O_TARGET, obj-y if no static
123 ifneq ($(CONFIG_IPSEC),y)
124 O_TARGET := 
125 ipsec_obj-y := $(obj-y)
126 obj-y :=
127 subdir-y :=
128 endif
129
130 # Define obj-m if modular ipsec 
131 ifeq ($(CONFIG_IPSEC),m)
132 obj-m += ipsec.o
133 endif
134
135
136 # These rules translate from new to old makefile rules
137 # Translate to Rules.make lists.
138 multi-used      := $(filter $(list-multi), $(obj-y) $(obj-m))
139 multi-objs      := $(foreach m, $(multi-used), $($(basename $(m))-objs))
140 active-objs     := $(sort $(multi-objs) $(obj-y) $(obj-m))
141 O_OBJS          := $(obj-y)
142 M_OBJS          := $(obj-m)
143 MIX_OBJS        := $(filter $(export-objs), $(active-objs))
144 OX_OBJS := $(export-objs)
145 SUB_DIRS := $(subdir-y)
146 ALL_SUB_DIRS := $(subdir-y) $(subdir-m)
147 MOD_SUB_DIRS := $(subdir-m)
148
149 #   dunno why, but some 2.2 setups may need explicit -DEXPORT_SYMTAB
150 #   uncomment next line if ipsec_alg.c compilation fails with
151 #   "parse error before `EXPORT_SYMTAB_not_defined'"  --Juanjo
152 # CFLAGS_ipsec_alg.o += -DEXPORT_SYMTAB
153 #
154
155 include $(TOPDIR)/Rules.make
156
157 ###
158 ### Post Rules.make
159 ###
160 # for modular ipsec, no O_TARGET defined => define ipsec.o creation rules
161 ifeq ($(CONFIG_IPSEC),m)
162 ipsec.o : $(ipsec_obj-y)
163         rm -f $@
164         $(LD) $(LD_EXTRAFLAGS) -r $(ipsec_obj-y) -o $@
165 endif
166
167 $(ipsec_obj-y) $(obj-y) $(obj-m):  $(TOPDIR)/include/linux/config.h $(TOPDIR)/include/linux/autoconf.h
168
169 libdes/libdes.a:
170         ( cd libdes && $(MAKE) CC='$(CC)' CFLAG='$(CFLAGS)' libdes.a )
171
172 libfreeswan/libkernel.a:
173         $(MAKE) -C libfreeswan
174
175 zlib/zlib.a:
176         $(MAKE) -C zlib
177
178 alg/ipsec_alg_static.o: dummy
179         $(MAKE) -C alg CC='$(CC)' CFLAGS='$(CFLAGS)' ipsec_alg_static.o
180
181 clean:
182         -rm -f *.o
183
184 tags TAGS: *.c *.h libfreeswan/*.c libfreeswan/*.h
185         find . -name '*.[ch]' |xargs etags
186         find . -name '*.[ch]' |xargs ctags
187
188 tar:
189                 tar -cvf /dev/f1 .
190
191 #
192 # $Log: Makefile,v $
193 # Revision 1.39  2002/01/17 04:39:40  rgb
194 # Take compile options from top level Makefile.inc
195 #
196 # Revision 1.38  2001/11/27 05:28:07  rgb
197 # Shut off -Werror until we figure out a graceful way of quieting down the
198 # pfkey_ops defined but not used complaint in the case of SMP in
199 # pfkey_v2.c.
200 #
201 # Revision 1.37  2001/11/27 05:10:15  rgb
202 # Added -Ilibdes and removed lib/des* symlinks.
203 #
204 # Revision 1.36  2001/11/26 09:23:47  rgb
205 # Merge MCR's ipsec_sa, eroute, proc and struct lifetime changes.
206 #
207 # Revision 1.35.2.1  2001/09/25 02:17:50  mcr
208 #       added ipsec_sa, ipsec_life, ipsec_proc.
209 #       added -Werror to compile flags (see fix for zlib/zutil.h)
210 #
211 # Revision 1.3  2001/09/21 04:41:26  mcr
212 #       actually, ipsec_proc.c and ipsec_life.c were never actually compiled.
213 #
214 # Revision 1.2  2001/09/21 04:11:33  mcr
215 #       first compilable version.
216 #
217 # Revision 1.1.1.2  2001/09/17 01:17:52  mcr
218 #   snapshot 2001-09-16
219 #
220 # Revision 1.35  2001/09/07 22:09:12  rgb
221 # Quiet down compilation.
222 #
223 # Revision 1.34  2001/08/11 17:10:23  henry
224 # update bogosity stuff to cover RH7.1 update
225 #
226 # Revision 1.33  2001/06/14 19:35:07  rgb
227 # Update copyright date.
228 #
229 # Revision 1.32  2001/06/13 21:00:50  rgb
230 # Added a kludge to get around RedHat kernel version bogosity...
231 #
232 # Revision 1.31  2001/01/29 22:19:06  rgb
233 # Convert to 2.4 new style with back compat.
234 #
235 # Revision 1.30  2000/09/29 19:51:57  rgb
236 # Moved klips/net/ipsec/ipcomp_* to zlib/* (Svenning).
237 #
238 # Revision 1.29  2000/09/15 11:37:01  rgb
239 # Merge in heavily modified Svenning Soerensen's <svenning@post5.tele.dk>
240 # IPCOMP zlib deflate code.
241 #
242 # Revision 1.28  2000/09/15 04:55:25  rgb
243 # Clean up pfkey object inclusion into the default object.
244 #
245 # Revision 1.27  2000/09/12 03:20:47  rgb
246 # Cleared out now unused pfkeyv2 switch.
247 # Enabled sysctl.
248 #
249 # Revision 1.26  2000/09/08 19:12:55  rgb
250 # Change references from DEBUG_IPSEC to CONFIG_IPSEC_DEBUG.
251 #
252 # Revision 1.25  2000/06/16 03:09:16  rgb
253 # Shut up cast lost warning due to changes in 2.4.0-test1.
254 #
255 # Revision 1.24  2000/03/16 06:40:48  rgb
256 # Hardcode PF_KEYv2 support.
257 #
258 # Revision 1.23  2000/02/14 21:10:38  rgb
259 # Added gcc debug flag when KLIPS_DEBUG is swtiched on.
260 #
261 # Revision 1.22  2000/01/21 09:44:29  rgb
262 # Added compiler switches to be a lot more fussy.
263 #
264 # Revision 1.21  1999/11/25 23:35:20  rgb
265 # Removed quotes to fix Alpha compile issues.
266 #
267 # Revision 1.20  1999/11/17 15:49:34  rgb
268 # Changed all occurrences of ../../../lib in pathnames to libfreeswan,
269 # which refers to the /usr/src/linux/net/ipsec/lib directory setup by the
270 # klink target in the top-level Makefile; and libdeslite.o to
271 # libdes/libdes.a.
272 # Added SUB_DIRS := lib definition for the kernel libraries.
273 #
274 # Revision 1.19  1999/04/27 19:06:47  rgb
275 # dd libs and dependancies to tags generation.
276 #
277 # Revision 1.18  1999/04/16 16:28:12  rgb
278 # Minor bugfix to avoid including DES if only AH is used.
279 #
280 # Revision 1.17  1999/04/15 15:37:23  rgb
281 # Forward check changes from POST1_00 branch.
282 #
283 # Revision 1.14.2.1  1999/03/30 17:29:17  rgb
284 # Add support for pfkey.
285 #
286 # Revision 1.16  1999/04/11 00:28:56  henry
287 # GPL boilerplate
288 #
289 # Revision 1.15  1999/04/06 04:54:25  rgb
290 # Fix/Add RCSID Id: and Log: bits to make PHMDs happy.  This includes
291 # patch shell fixes.
292 #
293 # Revision 1.14  1999/02/18 16:50:45  henry
294 # update for new DES library
295 #
296 # Revision 1.13  1999/02/12 21:11:45  rgb
297 # Prepare for newer LIBDES (patch from P.Onion).
298 #
299 # Revision 1.12  1999/01/26 02:05:08  rgb
300 # Remove references to INET_GET_PROTOCOL.
301 # Removed CONFIG_IPSEC_ALGO_SWITCH macro.
302 # Change from transform switch to algorithm switch.
303 #
304 # Revision 1.11  1999/01/22 06:16:09  rgb
305 # Added algorithm switch code config option.
306 #
307 # Revision 1.10  1998/11/08 05:31:21  henry
308 # be a little fussier
309 #
310 # Revision 1.9  1998/11/08 05:29:41  henry
311 # revisions for new libdes handling
312 #
313 # Revision 1.8  1998/08/12 00:05:48  rgb
314 # Added new xforms to Makefile (moved des-cbc to des-old).
315 #
316 # Revision 1.7  1998/07/27 21:48:47  rgb
317 # Add libkernel.
318 #
319 # Revision 1.6  1998/07/14 15:50:47  rgb
320 # Add dependancies on linux config files.
321 #
322 # Revision 1.5  1998/07/09 17:44:06  rgb
323 # Added 'clean' and 'tags' targets.
324 # Added TOPDIR macro.
325 # Change module back from symbol exporting to not.
326 #
327 # Revision 1.3  1998/06/25 19:25:04  rgb
328 # Rearrange to support static linking and objects with exported symbol
329 # tables.
330 #
331 # Revision 1.1  1998/06/18 21:27:42  henry
332 # move sources from klips/src to klips/net/ipsec, to keep stupid
333 # kernel-build scripts happier in the presence of symlinks
334 #
335 # Revision 1.3  1998/04/15 23:18:43  rgb
336 # Unfixed the ../../libdes fix to avoid messing up Henry's script.
337 #
338 # Revision 1.2  1998/04/14 17:50:47  rgb
339 # Fixed to find the new location of libdes.
340 #
341 # Revision 1.1  1998/04/09 03:05:22  henry
342 # sources moved up from linux/net/ipsec
343 # modifications to centralize libdes code
344 #
345 # Revision 1.1.1.1  1998/04/08 05:35:02  henry
346 # RGB's ipsec-0.8pre2.tar.gz ipsec-0.8
347 #
348 # Revision 0.5  1997/06/03 04:24:48  ji
349 # Added ESP-3DES-MD5-96
350 #
351 # Revision 0.4  1997/01/15 01:32:59  ji
352 # Added new transforms.
353 #
354 # Revision 0.3  1996/11/20 14:22:53  ji
355 # *** empty log message ***
356 #