-include $(project_pwd)/common.mk
+EXTRA_CFLAGS := -I$(src)/../../common -I$(src)/../../profile -DEC_ARCH_$(ARCH)
-program_name := $(driver_name)
-source_dirs := $(project_pwd)/$(src_path)/$(driver_path)
-include_dirs := $(project_pwd)/$(src_path)/$(common_path) \
- $(project_pwd)/$(src_path)/$(probes_path)
-include_libs :=
-special_defines := EC_ARCH_$(target_cpu)
-ifeq ($(specific_target), chelsea)
- special_defines += KERNEL_HAS_ISPAGEPRESENT
-endif
-special_compiling_flags :=
-special_linking_flags :=
-ifeq ($(memory_checker), yes)
-special_defines += MEMORY_CHECKER
-endif
-ifeq ($(thread_profiler), yes)
-special_defines += THREAD_PROFILER
-endif
-
-include $(project_pwd)/rules-m.mk
+obj-m := inperfa_driver.o
+inperfa_driver-y := device_driver.o ec.o legacy.o module.o probes.o probes_manager.o storage.o us_proc_inst.o
--- /dev/null
+target_kernel_src="/home/kain/dev/inperfa/kernel/tegra/linux-2.6.29-tegra250-9.12.8"
+driver_module_dir=$(realpath $(top_srcdir)/src/modules/driver)
+
+all-local:
+ $(MAKE) $(AM_MAKEFLAGS) -C $(target_kernel_src) M=$(driver_module_dir) modules
+
+clean-local:
+ $(MAKE) $(AM_MAKEFLAGS) -C $(target_kernel_src) M=$(driver_module_dir) clean
--- /dev/null
+include Makefile
#if !defined(device_driver_h)
#define device_driver_h
-#include "event.h" // event_id_t
#include "ec_info.h" // ec_info_t
#include "ec_probe.h" // probe_id_t
#include "ec_ioctl.h"
#include "ec_info.h"
-#include "ec_module.h"
#include "ec_probe.h"
#include "picl.h"
#include "debug.h"
#include "ec.h"
-#include "event.h"
#include "legacy.h"
#include "storage.h"
#include "us_proc_inst.h"
#include "device_driver.h"
#include "probes_manager.h"
#include "probes.h"
-#include "stdfunc.h"
typedef unsigned long (*fp_kallsyms_lookup_name_t) (const char *name);
extern int fp_kallsyms_lookup_name;
#if !defined(__PROBES_MANAGER_H__)
#define __PROBES_MANAGER_H__
-#include "ec_module.h"
#include "ec_probe.h"
-#include "ec_module.h"
#include "probes.h"
typedef struct
#include "picl.h"
#include "ec_ioctl.h"
#include "ec_probe.h"
-#include "ec_module.h"
#include "probes_manager.h"
#include "probes.h"
#include "event_tmpl.h"
-include $(project_pwd)/common.mk
-
-program_name := $(kprobe_name)
-source_dirs := $(project_pwd)/$(src_path)/$(kprobe_path)
-include_dirs :=
-include_libs :=
-special_defines := CONFIG_KPROBES
-ifeq ($(specific_target), chelsea)
- special_defines += KERNEL_HAS_ISPAGEPRESENT
-endif
-special_compiling_flags :=
-special_linking_flags :=
-
-include $(project_pwd)/rules-m.mk
+obj-m := inperfa_kprobes.o
+inperfa_kprobes-y := kprobes_arch.o kprobes.o
-include $(project_pwd)/common.mk
+target_kernel_src="/home/kain/dev/inperfa/kernel/tegra/linux-2.6.29-tegra250-9.12.8"
+kprobes_module_dir=$(realpath $(top_srcdir)/src/modules/kprobe)
-help:
- @$(MAKE) ARCH=$(target_cpu) CROSS_COMPILE=$(target_compiler_prefix) -C $(target_kernel_src) \
- M=$(project_pwd)/$(src_path)/$(kprobe_path) \
- project_pwd=$(project_pwd) help
+all-local:
+ echo "kprobes_module_dir = $(kprobes_module_dir)"
+ $(MAKE) $(AM_MAKEFLAGS) -C $(target_kernel_src) M=$(kprobes_module_dir) modules
-build:
- @$(MAKE) ARCH=$(target_cpu) CROSS_COMPILE=$(target_compiler_prefix) -C $(target_kernel_src) \
- M=$(project_pwd)/$(src_path)/$(kprobe_path) \
- project_pwd=$(project_pwd) modules
-
-clean:
- @$(MAKE) ARCH=$(target_cpu) CROSS_COMPILE=$(target_compiler_prefix) -C $(target_kernel_src) \
- M=$(project_pwd)/$(src_path)/$(kprobe_path) \
- project_pwd=$(project_pwd) clean
+clean-local:
+ $(MAKE) $(AM_MAKEFLAGS) -C $(target_kernel_src) M=$(kprobes_module_dir) clean
--- /dev/null
+include Makefile