5 board_opt = -DBOARD_@BOARD@
7 target_kernel_src = @KERNEL@
10 kprobes_module_dir = $(realpath $(top_srcdir)/src/modules/kprobe)
11 module_name = swap_kprobe
12 cross_compiler = $(subst gcc,,$(CC))
14 inlude_opt = -I$(realpath $(top_srcdir)/src/modules/ksyms) \
15 -I$(realpath $(top_srcdir)/src/modules/kprobe) \
16 -I$(realpath $(top_srcdir)/src/modules/kprobe/arch)
17 extra_cflags = "$(inlude_opt) $(android_opt) $(board_opt)"
20 rm -rf $(top_srcdir)/src/modules/kprobe/arch/asm && $(LN_S) asm-${target_arch} $(top_srcdir)/src/modules/kprobe/arch/asm
21 $(MAKE) CROSS_COMPILE=$(cross_compiler) ARCH=$(target_arch) extra_cflags=$(extra_cflags) $(AM_MAKEFLAGS) -C $(target_kernel_src) $(sparse_output) M=$(kprobes_module_dir) modules
24 echo "generate data for version patching <$(OBJDUMP)><$(READELF)>"
25 PATH=$(PATH) $(top_srcdir)/src/modules/driver/patchko.sh -g $(kprobes_module_dir)/$(module_name).ko $(OBJDUMP) $(READELF)
28 $(MAKE) CROSS_COMPILE=$(cross_compiler) ARCH=$(target_arch) $(AM_MAKEFLAGS) -C $(target_kernel_src) M=$(kprobes_module_dir) clean
32 install -m 644 $(kprobes_module_dir)/$(module_name).ko $(prefix)
33 install -m 644 $(kprobes_module_dir)/$(module_name).ko.addr $(prefix)
35 if [ "$(android)" != "yes" ] ; then install -m 755 $(kprobes_module_dir)/$(module_name).sh $(prefix) ; fi