2 -include $(ROOTDIR
)/modules
/.config
4 OCF_OBJS
= crypto.o criov.o
6 ifdef CONFIG_OCF_RANDOMHARVEST
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
)
24 mod-subdirs
:= safe hifn ixp4xx talitos ocfnull
25 export-objs
+= crypto.o criov.o random.o
33 EXTRA_CFLAGS
+= -I
$(obj
)/.
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
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
)
52 ocf-objs
:= $(OCF_OBJS
)
55 @echo
"Please consult the README for how to build OCF."
56 @echo
"If you can't wait then the following should do it:"
58 @echo
" make ocf_modules"
59 @echo
" sudo make ocf_install"
63 $(list-multi
) dummy1
: $(ocf-objs
)
64 $(LD
) -r
-o
$@
$(ocf-objs
)
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
73 -include $(TOPDIR
)/Rules.make
77 # targets to build easily on the current machine
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
88 $(MAKE
) ocf_make OCF_TARGET
=modules
91 $(MAKE
) ocf_make OCF_TARGET
="modules modules_install"
93 mkdir
-p
/usr
/include/crypto
94 cp cryptodev.h
/usr
/include/crypto
/.
97 # generate full kernel patches for 2.4 and 2.6 kernels to make patching
104 [ -d
$$patchbase/patches
] || patchbase
=..
; \
105 patch
=ocf-linux-base.patch
; \
106 patch24
=ocf-linux-24.patch
; \
107 patch26
=ocf-linux-26.patch
; \
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/?'; \
117 cat
$$patchbase/patches
/linux-2.4
.35-ocf.patch
$$patch > $$patch24; \
118 cat
$$patchbase/patches
/linux-2.6
.38-ocf.patch
$$patch > $$patch26; \
121 # this target probably does nothing for anyone but me - davidm
126 REL
=`date +%Y%m%d`; RELDIR
=/tmp
/ocf-linux-
$$REL; \
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
; \
143 tar cvf ocf-linux-
$$REL.
tar ocf-linux-
$$REL; \
144 gzip
-9 ocf-linux-
$$REL.
tar