add 'swap_ksyms' module
[kernel/swap-modules.git] / ksyms / Makefile.am
1 target_kernel_src = @KERNEL@
2 target_arch = @ARCH@
3 module_dir = $(realpath $(top_srcdir)/src/modules/ksyms)
4 module_name = swap_ksyms
5 cross_compiler = $(subst gcc,,$(CC))
6 module_path = $(module_dir)/$(module_name).ko
7
8
9 all-local:
10         $(MAKE) CROSS_COMPILE=$(cross_compiler) ARCH=$(target_arch) $(AM_MAKEFLAGS) -C $(target_kernel_src) M=$(module_dir) modules
11
12         if [ -e $(module_path) ] ; then \
13                 echo "generate data for version patching <$(OBJDUMP)><$(READELF)>" ; \
14                 PATH=$(PATH) $(top_srcdir)/src/modules/driver/patchko.sh -g $(module_dir)/$(module_name).ko $(OBJDUMP) $(READELF) ; \
15         fi
16
17 clean-local:
18         $(MAKE) CROSS_COMPILE=$(cross_compiler) ARCH=$(target_arch) $(AM_MAKEFLAGS) -C $(target_kernel_src) M=$(module_dir) clean
19
20 install-exec-local:
21         if [ -e $(module_path) ] ; then \
22                 install -m 644 $(module_path) $(prefix) ; \
23                 install -m 644 $(module_path).addr $(prefix) ; \
24         \
25                 if [ "$(android)" != "yes" ] ; then install -m 755 $(module_dir)/$(module_name).sh $(prefix) ; fi ; \
26         fi