-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathMakefile
47 lines (36 loc) · 1003 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# LKMD (Linux Kernel Module Debugger)
obj-m:=lkmd.o
lkmd-objs:=lkmd_main.o \
lkmd_bp.o \
lkmd_id.o \
lkmd_io.o \
lkmd_support.o \
arch/lkmda_bp.o \
arch/lkmda_id.o \
arch/lkmda_io.o \
arch/lkmda_support.o \
arch/x86-dis.o
KDIR:=/lib/modules/$(shell uname -r)/build
PWD:=$(shell pwd)
ifneq (,$(findstring -fno-optimize-sibling-calls,$(KBUILD_CFLAGS)))
CFLAGS_lkmda_bt.o += -DNO_SIBLINGS
endif
REGPARM := $(subst -mregparm=,,$(filter -mregparm=%,$(KBUILD_CFLAGS)))
ifeq (,$(REGPARM))
ifeq ($(CONFIG_X86_32),y)
REGPARM := 3
else
REGPARM := 6
endif
endif
CFLAGS_lkmda_bt.o += -DREGPARM=$(REGPARM) -DCCVERSION="$(CCVERSION)"
all:
$(MAKE) -C $(KDIR) SUBDIRS=$(PWD) modules
# mv lkmd.ko lkmd-$(shell uname -r)-$(shell uname -m).ko
install:
insmod lkmd.ko
exit:
rmmod lkmd
clean:
rm -rf *.o *.ko *.mod.c .*.cmd .depend .*.o.d .tmp_versions Module.markers *.ko.unsigned Module.symvers Module.symvers modules.order
rm -rf arch/*.o arch/*.mod.c arch/.*.cmd arch/.depend arch/.*.o.d