1
# Makefile for KLIPS kernel code as a module for 2.4 kernels
3
# Makefile for KLIPS kernel code as a module
4
# Copyright (C) 1998, 1999, 2000,2001 Richard Guy Briggs.
5
# Copyright (C) 2002,2003 Michael Richardson <mcr@freeswan.org>
6
# Copyright (C) 2004 Michael Richardson <mcr@xelerance.com>
8
# This program is free software; you can redistribute it and/or modify it
9
# under the terms of the GNU General Public License as published by the
10
# Free Software Foundation; either version 2 of the License, or (at your
11
# option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>.
13
# This program is distributed in the hope that it will be useful, but
14
# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
15
# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
18
# RCSID $Id: Makefile.fs2_4,v 1.5 2004/09/14 00:03:47 mcr Exp $
20
# Note! Dependencies are done automagically by 'make dep', which also
21
# removes any old dependencies. DON'T put your own dependencies here
22
# unless it's something special (ie not a .c file).
25
ifeq ($(strip $(KLIPSMODULE)),)
28
OPENSWANSRCDIR=../../..
30
-include ${OPENSWANSRCDIR}/Makefile.ver
32
ifeq ($(strip $(KLIPS_TOP)),)
36
ifneq ($(strip $(KLIPSMODULE)),)
39
TOPDIR:=/usr/src/linux
52
MOD_DESTDIR:=net/ipsec
59
echo KERNEL: ${KERNEL_CFLAGS}
60
echo MODULE: ${MODULE_CFLAGS}
69
obj-y := ipsec_init.o ipsec_sa.o ipsec_radij.o radij.o
70
obj-y += ipsec_life.o ipsec_proc.o
71
obj-y += ipsec_tunnel.o ipsec_xmit.o ipsec_rcv.o ipsec_ipip.o
72
obj-y += sysctl_net_ipsec.o
73
obj-y += pfkey_v2.o pfkey_v2_parser.o pfkey_v2_ext_process.o
75
obj-$(CONFIG_KLIPS_ESP) += ipsec_esp.o
76
obj-$(CONFIG_KLIPS_IPCOMP) += ipsec_ipcomp.o
78
# AH, if you really think you need it.
79
obj-$(CONFIG_KLIPS_AH) += ipsec_ah.o
81
CFLAGS_ipsec_alg.o += -DEXPORT_SYMTAB
82
obj-$(CONFIG_KLIPS_ALG) += ipsec_alg.o
84
obj-$(CONFIG_KLIPS_ENC_AES) += ipsec_alg_aes.o
85
obj-$(CONFIG_KLIPS_ENC_CRYPTOAPI) += ipsec_alg_cryptoapi.o
87
VPATH+=${KLIPS_TOP}/net/ipsec/des
89
obj-$(CONFIG_KLIPS_ENC_3DES) += cbc_enc.o
90
obj-$(CONFIG_KLIPS_ENC_3DES) += ecb_enc.o
91
obj-$(CONFIG_KLIPS_ENC_3DES) += set_key.o
94
VPATH+=${KLIPS_TOP}/net/ipsec/aes
96
ASM_X86:=$(ASM-i586)$(ASM-i686)
98
ifneq ($(strip $(ASM_X86)),)
99
obj-$(CONFIG_KLIPS_ENC_AES) += aes-i586.o
101
# and use assembly version of zlib code.
104
obj-$(CONFIG_KLIPS_ENC_AES) += aes.o
107
obj-$(CONFIG_KLIPS_ENC_AES) += aes_cbc.o
108
obj-$(CONFIG_KLIPS_ENC_AES) += aes_xcbc_mac.o
110
ifeq ($(strip ${SUBARCH}),)
114
ifeq (${SUBARCH},i386)
115
obj-$(CONFIG_KLIPS_ENC_3DES) += dx86unix.o
117
obj-$(CONFIG_KLIPS_ENC_3DES) += des_enc.o
123
obj-y += addrtypeof.o
134
obj-y += pfkey_v2_parse.o
135
obj-y += pfkey_v2_build.o
136
obj-y += pfkey_v2_debug.o
137
obj-y += pfkey_v2_ext_bits.o
140
obj-$(CONFIG_KLIPS_IPCOMP) += ipcomp.o
142
obj-$(CONFIG_KLIPS_IPCOMP) += adler32.o
143
obj-$(CONFIG_KLIPS_IPCOMP) += deflate.o
144
obj-$(CONFIG_KLIPS_IPCOMP) += infblock.o
145
obj-$(CONFIG_KLIPS_IPCOMP) += infcodes.o
146
obj-$(CONFIG_KLIPS_IPCOMP) += inffast.o
147
obj-$(CONFIG_KLIPS_IPCOMP) += inflate.o
148
obj-$(CONFIG_KLIPS_IPCOMP) += inftrees.o
149
obj-$(CONFIG_KLIPS_IPCOMP) += infutil.o
150
obj-$(CONFIG_KLIPS_IPCOMP) += trees.o
151
obj-$(CONFIG_KLIPS_IPCOMP) += zutil.o
153
asm-obj-$(CONFIG_M586) += match586.o
154
asm-obj-$(CONFIG_M586TSC) += match586.o
155
asm-obj-$(CONFIG_M586MMX) += match586.o
156
asm-obj-$(CONFIG_M686) += match686.o
157
asm-obj-$(CONFIG_MPENTIUMIII) += match686.o
158
asm-obj-$(CONFIG_MPENTIUM4) += match686.o
159
asm-obj-$(CONFIG_MK6) += match586.o
160
asm-obj-$(CONFIG_MK7) += match686.o
161
asm-obj-$(CONFIG_MCRUSOE) += match586.o
162
asm-obj-$(CONFIG_MWINCHIPC6) += match586.o
163
asm-obj-$(CONFIG_MWINCHIP2) += match686.o
164
asm-obj-$(CONFIG_MWINCHIP3D) += match686.o
169
#ifeq ($(CONFIG_KLIPS_DEBUG),y)
173
# MOST of these flags are in KERNEL_CFLAGS already!
175
# cannot use both -Wpointer-arith and -Werror with CONFIG_HIGHMEM
176
# include/linux/highmem.h has an inline function definition that uses void* arithmentic.
177
ifeq ($(CONFIG_NOHIGHMEM),y)
178
#EXTRA_CFLAGS += -Wpointer-arith
180
#EXTRA_CFLAGS += -Wcast-qual
181
#EXTRA_CFLAGS += -Wmissing-declarations
182
#EXTRA_CFLAGS += -Wstrict-prototypes
183
#EXTRA_CFLAGS += -pedantic
186
#EXTRA_CFLAGS += -Wwrite-strings
187
#EXTRA_CFLAGS += -Wbad-function-cast
188
EXTRA_CFLAGS += -DIPCOMP_PREFIX
190
ifneq ($(strip $(KLIPSMODULE)),)
191
# for when we aren't building in the kernel tree
192
EXTRA_CFLAGS += -DARCH=${ARCH}
193
EXTRA_CFLAGS += -DMODVERSIONS
194
EXTRA_CFLAGS += -include ${TOPDIR}/include/linux/modversions.h
195
EXTRA_CFLAGS += ${MODULE_CFLAGS}
198
# GCC 3.2 (and we presume any other 3.x) wants -falign-functions
199
# in place of the traditional -malign-functions. Getting this
200
# wrong leads to a warning, which is fatal due to our use of -Werror.
201
ifeq ($(patsubst 3.%,3,$(shell $(CC) -dumpversion)),3)
202
override CFLAGS:=$(subst -malign-functions=,-falign-functions=,$(CFLAGS))
206
obj-$(CONFIG_KLIPS_AUTH_HMAC_MD5) += ipsec_md5c.o
207
obj-$(CONFIG_KLIPS_AUTH_HMAC_SHA1) += ipsec_sha1.o
209
# These rules translate from new to old makefile rules
210
# Translate to Rules.make lists.
211
multi-used := $(filter $(list-multi), $(obj-y) $(obj-m))
212
multi-objs := $(foreach m, $(multi-used), $($(basename $(m))-objs))
213
active-objs := $(sort $(multi-objs) $(obj-y) $(obj-m))
215
O_OBJS := $(filter-out $(export-objs), $(obj-y))
216
OX_OBJS := $(filter $(export-objs), $(obj-y))
217
M_OBJS := $(sort $(filter-out $(export-objs), $(obj-m)))
218
MX_OBJS := $(sort $(filter $(export-objs), $(obj-m)))
220
SUB_DIRS := $(subdir-y)
221
ALL_SUB_DIRS := $(subdir-y) $(subdir-m)
222
MOD_SUB_DIRS := $(subdir-m)
224
include $(TOPDIR)/Rules.make
226
$(obj-y) $(obj-m): $(TOPDIR)/include/linux/config.h $(TOPDIR)/include/linux/autoconf.h
228
USE_STANDARD_AS_RULE=true
230
tags TAGS: *.c *.h libfreeswan/*.c libfreeswan/*.h
231
etags *.c ../../include/*.h ../../include/freeswan/*.h
232
ctags *.c ../../include/*.h ../../include/freeswan/*.h
236
@echo MIX: ${MIX_OBJS}
244
# $Log: Makefile.fs2_4,v $
245
# Revision 1.5 2004/09/14 00:03:47 mcr
246
# use assembly code on i586/i686 for zlib.
248
# Revision 1.4 2004/07/22 02:09:12 mcr
249
# do not use export-objs on ipsec_alg.c, as the rule does not
250
# work with VPATH for silly reasons.
251
# Instead, define -DEXPORT_SYMTAB directly.
253
# Revision 1.3 2004/07/19 01:48:54 mcr
254
# adjustment of Makefile to use split OX/O_OBJS.
256
# Revision 1.2 2004/07/18 16:17:10 mcr
257
# list ipsec_alg.o as both an export object and an object
258
# that has to be compiled.
260
# Revision 1.1 2004/07/10 19:11:18 mcr
261
# CONFIG_IPSEC -> CONFIG_KLIPS.
263
# Revision 1.3 2004/02/24 17:17:04 mcr
264
# s/CONFIG_IPSEC/CONFIG_KLIPS/ as 26sec uses "CONFIG_IPSEC" to
265
# turn it on/off as well.
267
# Revision 1.2 2004/02/22 06:50:42 mcr
268
# kernel 2.6 port - merged with 2.4 code.
270
# Revision 1.1 2004/02/14 21:59:19 mcr
271
# split up Makefile into kernel specific versions.
273
# Revision 1.68 2003/12/15 20:38:11 mcr
274
# make sure that IPIP is always on.
276
# Revision 1.67 2003/12/15 15:42:27 mcr
277
# make sure that ESP is always on, and AH is no more.
279
# Revision 1.66 2003/12/13 04:09:21 mcr
280
# AH transform removed.
282
# Revision 1.65 2003/12/11 20:15:04 mcr
283
# refactored the xmit code, to move all encapsulation
284
# code into protocol functions. Note that all functions
285
# are essentially done by a single function, which is probably
287
# the rcv_functions structures are renamed xform_functions.
289
# Revision 1.64 2003/12/06 21:21:38 mcr
290
# split up receive path into per-transform files, for
291
# easier later removal.
293
# Revision 1.63 2003/11/07 02:58:06 mcr
294
# backout of port-selector and X.509 patches
296
# Revision 1.61 2003/06/22 21:07:46 mcr
297
# adjusted TAGS target in makefile to be useful in 2.00 source layout.
299
# Revision 1.60 2003/05/03 23:45:23 mcr
300
# rm .o.flags and generated version.c file.
302
# Revision 1.59 2003/02/12 19:32:47 rgb
303
# Added ipsec_xmit to the list of object files.
305
# Revision 1.58 2003/01/03 00:36:44 rgb
307
# Added emacs compile-command.
309
# Revision 1.57 2002/11/08 23:49:53 mcr
310
# use KERNEL_CFLAGS and MODULE_CFLAGS to get proper list
311
# of include directories.
312
# This also eliminates some of the guesswork in the kernel
313
# configuration file.
315
# Revision 1.56 2002/11/08 23:23:18 mcr
316
# attempt to guess kernel compilation flags (i.e. list of -I)
317
# by using some magic targets in the kernel makefile.
319
# Revision 1.55 2002/11/08 10:13:33 mcr
320
# added additional include directories for module builds for 2.4.19.
322
# Revision 1.54 2002/10/20 06:10:30 build
323
# CONFIG_NOHIGHMEM for -Wpointer-arith RPM building issues.
325
# Revision 1.53 2002/10/17 16:32:01 mcr
326
# enable standard AS rules.
328
# Revision 1.52 2002/10/06 06:13:44 sam
329
# Altering order of includes, so that architecture-specific header files,
330
# used for building RPM modules specifically, are processed first.
332
# Revision 1.51 2002/10/05 15:06:38 dhr
334
# - To allow for gcc3.2 (used in Red Hat Linux 8.0): adjust CFLAGS (set
335
# by kernel machinery) to use -falign-functions= in place of
336
# -malign-functions=. Eliminates a warning (fatal with -Werror).
338
# - When CONFIG_HIGHMEM is on, -Wpointer-arith will warn about
339
# include/linux/highmem.h. Since this is fatal with -Werror, we
340
# suppress -Wpointer-arith if CONFIG_HIGHMEM is set.
342
# Revision 1.50 2002/09/16 21:19:45 mcr
343
# enable -Werror for production - this helps a lot (found a bug in ipsec_rcv.c)
345
# Revision 1.49 2002/07/29 05:12:39 mcr
346
# get rid of some extraneous stuff, now handled by a prefix
347
# Makefile when building as a module.
349
# Revision 1.48 2002/07/28 23:13:49 mcr
350
# set KLIPS_TOP and use it instead of ../..
351
# if KLIPSMODULE, then include a bunch of stuff defined in Makefile.inc
352
# that gets us the "typical" configuration that we want.
354
# Revision 1.47 2002/06/02 21:51:41 mcr
355
# changed TOPDIR->FREESWANSRCDIR in all Makefiles.
356
# (note that linux/net/ipsec/Makefile uses TOPDIR because this is the
359
# Revision 1.46 2002/05/14 02:35:51 rgb
360
# Added file pfkey_v2_ext_process.c.
362
# Revision 1.45 2002/05/13 17:21:40 mcr
363
# mkdep dies when given a -I to a directory that does not exist.
364
# arch/${ARCH}/include is for UM arch only, so include it for that
367
# Revision 1.44 2002/04/24 20:38:12 mcr
368
# moved more stuff behind $KLIPSMODULE=y to get static linking to work.
370
# Revision 1.43 2002/04/24 09:16:18 mcr
371
# include local Makefile.ver as well as FS_rootdir version.
373
# Revision 1.42 2002/04/24 08:50:08 mcr
374
# critical patch is to set TOPDIR with :=.
376
# Revision 1.40 2002/04/24 00:41:07 mcr
377
# Moved from ./klips/net/ipsec/Makefile,v
379
# Revision 1.39 2002/01/17 04:39:40 rgb
380
# Take compile options from top level Makefile.inc
385
# compile-command: "(cd ../../.. && source umlsetup.sh && make -C ${POOLSPACE} module/ipsec.o)"