-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
46 lines (34 loc) · 848 Bytes
/
Copy pathMakefile
File metadata and controls
46 lines (34 loc) · 848 Bytes
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
DEBUG:=y
INCLUDE:=/home/wambui/openWRT/monitor/
ifeq ($(DEBUG),y)
DEBFLAGS = -O -g -DDEBUGPRINT
else
DEBFLAGS = -O2
endif
ifneq ($(KERNELRELEASE),)
obj-m := monitor.o
ccflags-y := -I$(INCLUDE)
ccflags-y += $(DEBFLAGS)
CONFIG_MONITOR_DEBUG := -DDEBUG
monitor-objs := code.o
else
KDIR := /lib/modules/$(shell uname -r)/build
MDIR := /lib/modules/$(shell uname -r)
PWD := $(shell pwd)
KREL := $(shell cd ${KDIR} && make -s kernelrelease)
export CONFIG_MONITOR := m
all:
$(MAKE) -C $(KDIR) M=$(PWD) modules
clean:
$(MAKE) -C $(KDIR) M=$(PWD) clean
help:
$(MAKE) -C $(KDIR) M=$(PWD) help
install: monitor.ko
rm -f ${MDIR}/kernel/monitor/monitor.ko
install -m644 -b -D monitor.ko ${MDIR}/kernel/monitor/monitor.ko
depmod -aq
uninstall:
rm -rf ${MDIR}/kernel/monitor
depmod -aq
.PHONY all clean
endif