3 define $(module_canonical_name)_BUILD_CMD
4 (mkdir -p $($(module_canonical_name)_src_dir) && \
5 (test -e $(abs_builddir)/$($(module_canonical_name)_src_dir)/Kbuild || \
6 ln -s $(abs_srcdir)/$($(module_canonical_name)_src_dir)/Kbuild $(abs_builddir)/$($(module_canonical_name)_src_dir)/Kbuild) && \
7 cd $($(module_canonical_name)_src_dir) && \
8 echo -n > .mtlk_kernel_target && \
9 { test x"$(mtlk_build_kernel_library)" = x"y" || echo modules > .mtlk_kernel_target; } && \
10 $(MAKE) $(KERNEL_MAKE_EXT_PARAMS) -C @kernel_dir@ SUBDIRS=$(CURDIR)/$($(module_canonical_name)_src_dir) `cat .mtlk_kernel_target` \
11 abs_srcdir=$(abs_srcdir)/$($(module_canonical_name)_src_dir)/ \
12 top_srcdir=../$(top_srcdir)/ \
13 abs_top_builddir=$(abs_top_builddir)/ \
14 abs_builddir=$(abs_builddir)/$($(module_canonical_name)_src_dir)/ \
15 top_builddir=../$(top_builddir)/ \
16 abs_top_srcdir=$(abs_top_srcdir)/ \
17 srcdir=../$(srcdir)/$($(module_canonical_name)_src_dir)/ \
18 KERNELDIR=@kernel_dir@ \
19 MTLK_KERNEL_CFLAGS="@kernel_cflags@" \
21 CROSS_COMPILE="$(abs_top_srcdir)/support/mtlkfront.sh @kernel_cross_compile@" \
22 CUSTOM_DRV_ENV_INFO=@CUSTOM_DRV_ENV_INFO@ \
23 LD_LIBRARY_PATH=@env_lib_path@ \
24 mtlk_build_kernel_library=$(mtlk_build_kernel_library) && \
25 { { test x"$(mtlk_build_kernel_library)" != x"y"; } || echo lib.a > .built_binary_name; } && \
26 { { test x"$(mtlk_build_kernel_library)" = x"y"; } || echo $($(module_canonical_name)_binary_name) > .built_binary_name; } && \
27 ( @kernel_cross_compile@strip -dx `cat .built_binary_name`; true) && \
28 ( $(rebase_copy_cmd) drv_toolchain_info $(abs_builddir)) && \
29 $(rebase_copy_cmd) `cat .built_binary_name` $(abs_builddir)/$($(module_canonical_name)_binary_name) || \
30 ( rm -f $(abs_builddir)/$($(module_canonical_name)_binary_name) && exit 11 ) )
33 define $(module_canonical_name)_CLEAN_CMD
34 test ! -d $($(module_canonical_name)_src_dir) || \
35 (find $($(module_canonical_name)_src_dir) \! -name Makefile -type f -delete && \
36 find $($(module_canonical_name)_src_dir) \! -name Makefile -type l -delete && \
37 find $($(module_canonical_name)_src_dir) -depth -type d -empty -exec rmdir \{\} \; ); \
38 rm -f $(abs_builddir)/drv_toolchain_info