ar71xx: use AR8327 on the DB120 board
[openwrt.git] / target / linux / generic / files / crypto / ocf / Makefile
1 # for SGlinux builds
2 -include $(ROOTDIR)/modules/.config
3
4 OCF_OBJS = crypto.o criov.o
5
6 ifdef CONFIG_OCF_RANDOMHARVEST
7 OCF_OBJS += random.o
8 endif
9
10 ifdef CONFIG_OCF_FIPS
11 OCF_OBJS += rndtest.o
12 endif
13
14 # Add in autoconf.h to get #defines for CONFIG_xxx
15 AUTOCONF_H=$(ROOTDIR)/modules/autoconf.h
16 ifeq ($(AUTOCONF_H), $(wildcard $(AUTOCONF_H)))
17 EXTRA_CFLAGS += -include $(AUTOCONF_H)
18 export EXTRA_CFLAGS
19 endif
20
21 ifndef obj
22 obj ?= .
23 _obj = subdir
24 mod-subdirs := safe hifn ixp4xx talitos ocfnull
25 export-objs += crypto.o criov.o random.o
26 list-multi += ocf.o
27 _slash :=
28 else
29 _obj = obj
30 _slash := /
31 endif
32
33 EXTRA_CFLAGS += -I$(obj)/.
34
35 obj-$(CONFIG_OCF_OCF) += ocf.o
36 obj-$(CONFIG_OCF_CRYPTODEV) += cryptodev.o
37 obj-$(CONFIG_OCF_CRYPTOSOFT) += cryptosoft.o
38 obj-$(CONFIG_OCF_BENCH) += ocf-bench.o
39
40 $(_obj)-$(CONFIG_OCF_SAFE) += safe$(_slash)
41 $(_obj)-$(CONFIG_OCF_HIFN) += hifn$(_slash)
42 $(_obj)-$(CONFIG_OCF_IXP4XX) += ixp4xx$(_slash)
43 $(_obj)-$(CONFIG_OCF_TALITOS) += talitos$(_slash)
44 $(_obj)-$(CONFIG_OCF_PASEMI) += pasemi$(_slash)
45 $(_obj)-$(CONFIG_OCF_EP80579) += ep80579$(_slash)
46 $(_obj)-$(CONFIG_OCF_CRYPTOCTEON) += cryptocteon$(_slash)
47 $(_obj)-$(CONFIG_OCF_KIRKWOOD) += kirkwood$(_slash)
48 $(_obj)-$(CONFIG_OCF_OCFNULL) += ocfnull$(_slash)
49 $(_obj)-$(CONFIG_OCF_C7108) += c7108$(_slash)
50 $(_obj)-$(CONFIG_OCF_UBSEC_SSB) += ubsec_ssb$(_slash)
51
52 ocf-objs := $(OCF_OBJS)
53
54 dummy:
55 @echo "Please consult the README for how to build OCF."
56 @echo "If you can't wait then the following should do it:"
57 @echo ""
58 @echo " make ocf_modules"
59 @echo " sudo make ocf_install"
60 @echo ""
61 @exit 1
62
63 $(list-multi) dummy1: $(ocf-objs)
64 $(LD) -r -o $@ $(ocf-objs)
65
66 .PHONY:
67 clean:
68 rm -f *.o *.ko .*.o.flags .*.ko.cmd .*.o.cmd .*.mod.o.cmd *.mod.c
69 rm -f */*.o */*.ko */.*.o.cmd */.*.ko.cmd */.*.mod.o.cmd */*.mod.c */.*.o.flags
70 rm -f */modules.order */modules.builtin modules.order modules.builtin
71
72 ifdef TOPDIR
73 -include $(TOPDIR)/Rules.make
74 endif
75
76 #
77 # targets to build easily on the current machine
78 #
79
80 ocf_make:
81 make -C /lib/modules/$(shell uname -r)/build M=`pwd` $(OCF_TARGET) CONFIG_OCF_OCF=m
82 make -C /lib/modules/$(shell uname -r)/build M=`pwd` $(OCF_TARGET) CONFIG_OCF_OCF=m CONFIG_OCF_CRYPTOSOFT=m
83 -make -C /lib/modules/$(shell uname -r)/build M=`pwd` $(OCF_TARGET) CONFIG_OCF_OCF=m CONFIG_OCF_BENCH=m
84 -make -C /lib/modules/$(shell uname -r)/build M=`pwd` $(OCF_TARGET) CONFIG_OCF_OCF=m CONFIG_OCF_OCFNULL=m
85 -make -C /lib/modules/$(shell uname -r)/build M=`pwd` $(OCF_TARGET) CONFIG_OCF_OCF=m CONFIG_OCF_HIFN=m
86
87 ocf_modules:
88 $(MAKE) ocf_make OCF_TARGET=modules
89
90 ocf_install:
91 $(MAKE) ocf_make OCF_TARGET="modules modules_install"
92 depmod
93 mkdir -p /usr/include/crypto
94 cp cryptodev.h /usr/include/crypto/.
95
96 #
97 # generate full kernel patches for 2.4 and 2.6 kernels to make patching
98 # your kernel easier
99 #
100
101 .PHONY: patch
102 patch:
103 patchbase=.; \
104 [ -d $$patchbase/patches ] || patchbase=..; \
105 patch=ocf-linux-base.patch; \
106 patch24=ocf-linux-24.patch; \
107 patch26=ocf-linux-26.patch; \
108 ( \
109 find . -name Makefile; \
110 find . -name Config.in; \
111 find . -name Kconfig; \
112 find . -name README; \
113 find . -name '*.[ch]' | grep -v '.mod.c'; \
114 ) | while read t; do \
115 diff -Nau /dev/null $$t | sed 's?^+++ \./?+++ linux/crypto/ocf/?'; \
116 done > $$patch; \
117 cat $$patchbase/patches/linux-2.4.35-ocf.patch $$patch > $$patch24; \
118 cat $$patchbase/patches/linux-2.6.38-ocf.patch $$patch > $$patch26; \
119
120 #
121 # this target probably does nothing for anyone but me - davidm
122 #
123
124 .PHONY: release
125 release:
126 REL=`date +%Y%m%d`; RELDIR=/tmp/ocf-linux-$$REL; \
127 CURDIR=`pwd`; \
128 rm -rf /tmp/ocf-linux-$$REL*; \
129 mkdir -p $$RELDIR/ocf; \
130 mkdir -p $$RELDIR/patches; \
131 mkdir -p $$RELDIR/crypto-tools; \
132 cp README* $$RELDIR/.; \
133 cp patches/[!C]* $$RELDIR/patches/.; \
134 cp tools/[!C]* $$RELDIR/crypto-tools/.; \
135 cp -r [!C]* Config.in $$RELDIR/ocf/.; \
136 rm -rf $$RELDIR/ocf/patches $$RELDIR/ocf/tools; \
137 rm -f $$RELDIR/ocf/README*; \
138 cp $$CURDIR/../../user/crypto-tools/[!C]* $$RELDIR/crypto-tools/.; \
139 make -C $$RELDIR/crypto-tools clean; \
140 make -C $$RELDIR/ocf clean; \
141 find $$RELDIR/ocf -name CVS | xargs rm -rf; \
142 cd $$RELDIR/..; \
143 tar cvf ocf-linux-$$REL.tar ocf-linux-$$REL; \
144 gzip -9 ocf-linux-$$REL.tar
145
This page took 0.04788 seconds and 5 git commands to generate.