]> git.ipfire.org Git - thirdparty/strongswan.git/blob - linux/net/ipsec/alg/Makefile
- import of strongswan-2.7.0
[thirdparty/strongswan.git] / linux / net / ipsec / alg / Makefile
1 # $Id: Makefile,v 1.2 2004/03/22 21:53:19 as Exp $
2 ifeq ($(strip $(KLIPSMODULE)),)
3 FREESWANSRCDIR=.
4 else
5 FREESWANSRCDIR=../../../..
6 endif
7 ifeq ($(strip $(KLIPS_TOP)),)
8 KLIPS_TOP=../../..
9 override EXTRA_CFLAGS += -I$(KLIPS_TOP)/include
10 endif
11
12 ifeq ($(CONFIG_IPSEC_DEBUG),y)
13 override EXTRA_CFLAGS += -g
14 endif
15
16 # LIBCRYPTO normally comes as an argument from "parent" Makefile
17 # (this applies both to FS' "make module" and eg. Linux' "make modules"
18 # But make dep doest follow same evaluations, so we need this default:
19 LIBCRYPTO=$(TOPDIR)/lib/libcrypto
20
21 override EXTRA_CFLAGS += -I$(LIBCRYPTO)/include
22 override EXTRA_CFLAGS += -Wall -Wpointer-arith -Wstrict-prototypes
23
24 MOD_LIST_NAME := NET_MISC_MODULES
25
26 #O_TARGET := static_init.o
27
28 subdir- :=
29 subdir-n :=
30 subdir-y :=
31 subdir-m :=
32
33 obj-y := static_init.o
34
35 ARCH_ASM-y :=
36 ARCH_ASM-$(CONFIG_M586) := i586
37 ARCH_ASM-$(CONFIG_M586TSC) := i586
38 ARCH_ASM-$(CONFIG_M586MMX) := i586
39 ARCH_ASM-$(CONFIG_MK6) := i586
40 ARCH_ASM-$(CONFIG_M686) := i686
41 ARCH_ASM-$(CONFIG_MPENTIUMIII) := i686
42 ARCH_ASM-$(CONFIG_MPENTIUM4) := i686
43 ARCH_ASM-$(CONFIG_MK7) := i686
44 ARCH_ASM-$(CONFIG_MCRUSOE) := i586
45 ARCH_ASM-$(CONFIG_MWINCHIPC6) := i586
46 ARCH_ASM-$(CONFIG_MWINCHIP2) := i586
47 ARCH_ASM-$(CONFIG_MWINCHIP3D) := i586
48 ARCH_ASM-$(CONFIG_USERMODE) := i586
49
50 ARCH_ASM :=$(ARCH_ASM-y)
51 ifdef NO_ASM
52 ARCH_ASM :=
53 endif
54
55 # The algorithm makefiles may put dependences, short-circuit them
56 null:
57
58 makefiles=$(filter-out %.preipsec, $(wildcard Makefile.alg_*))
59 ifneq ($(makefiles),)
60 #include Makefile.alg_aes
61 #include Makefile.alg_aes-opt
62 include $(makefiles)
63 endif
64
65 # These rules translate from new to old makefile rules
66 # Translate to Rules.make lists.
67 multi-used := $(filter $(list-multi), $(obj-y) $(obj-m))
68 multi-objs := $(foreach m, $(multi-used), $($(basename $(m))-objs))
69 active-objs := $(sort $(multi-objs) $(obj-y) $(obj-m))
70 O_OBJS := $(obj-y)
71 M_OBJS := $(obj-m)
72 MIX_OBJS := $(filter $(export-objs), $(active-objs))
73 #OX_OBJS := $(export-objs)
74 SUB_DIRS := $(subdir-y)
75 ALL_SUB_DIRS := $(subdir-y) $(subdir-m)
76 MOD_SUB_DIRS := $(subdir-m)
77
78
79 static_init_mod.o: $(obj-y)
80 rm -f $@
81 $(LD) $(LD_EXTRAFLAGS) $(obj-y) -r -o $@
82
83 perlasm: $(LIBCRYPTO)/perlasm
84 ln -sf $? $@
85
86 $(obj-y) $(obj-m): $(TOPDIR)/include/linux/config.h $(TOPDIR)/include/linux/autoconf.h $(KLIPS_TOP)/include/freeswan/ipsec_alg.h
87 $(alg_obj-y) $(alg_obj-m): perlasm $(TOPDIR)/include/linux/config.h $(TOPDIR)/include/linux/autoconf.h $(KLIPS_TOP)/include/freeswan/ipsec_alg.h
88
89
90 all_alg_modules: perlasm $(ALG_MODULES)
91 @echo "ALG_MODULES=$(ALG_MODULES)"
92
93
94 #
95 # Construct alg. init. function: call ipsec_ALGO_init() for every static algo
96 # Needed when there are static algos (with static or modular ipsec.o)
97 #
98 static_init.c: $(TOPDIR)/include/linux/autoconf.h Makefile $(makefiles) scripts/mk-static_init.c.sh
99 @echo "Re-creating $@"
100 $(SHELL) scripts/mk-static_init.c.sh $(static_init-func-y) > $@
101
102 clean:
103 @for i in $(ALG_SUBDIRS);do test -d $$i && make -C $$i clean;done;exit 0
104 @find . -type l -exec rm -f {} \;
105 -rm -f perlasm
106 -rm -rf $(ALG_SUBDIRS)
107 -rm -f *.o .*.o.flags static_init.c
108
109 ifdef TOPDIR
110 include $(TOPDIR)/Rules.make
111 endif
112