You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
520 B
Makefile
24 lines
520 B
Makefile
4 years ago
|
obj-m += vmread.o
|
||
|
vmread-objs := kmem.o
|
||
|
MCFLAGS += -O3
|
||
|
ccflags-y += ${MCFLAGS}
|
||
|
CC += ${MCFLAGS}
|
||
|
KDIR := /lib/modules/$(shell uname -r)/build
|
||
|
KOUTPUT := $(PWD)/build/vmread_kmod
|
||
|
KOUTPUT_MAKEFILE := $(KOUTPUT)/Makefile
|
||
|
|
||
|
all: $(KOUTPUT_MAKEFILE)
|
||
|
make -C $(KDIR) M=$(KOUTPUT) src=$(PWD) modules
|
||
|
cp $(KOUTPUT)/vmread.ko $(KOUTPUT)/../vmread.ko
|
||
|
|
||
|
$(KOUTPUT):
|
||
|
mkdir -p "$@"
|
||
|
|
||
|
$(KOUTPUT_MAKEFILE): $(KOUTPUT)
|
||
|
touch "$@"
|
||
|
|
||
|
clean:
|
||
|
make -C $(KDIR) M=$(KOUTPUT) src=$(PWD) clean
|
||
|
$(shell rm $(KOUTPUT_MAKEFILE))
|
||
|
rmdir $(KOUTPUT)
|