more robust makefile

This commit is contained in:
Vincent Batts 2017-11-05 09:33:39 -05:00
parent 966c1416f4
commit e560ac6386
1 changed files with 9 additions and 3 deletions

View File

@ -1,7 +1,13 @@
obj-m += mod_hello.o
all:
make -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules
all: module helloctl/helloctl
helloctl/helloctl: ./helloctl/helloctl.c
$(CC) -o $@ $<
module:
$(MAKE) -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules
clean:
make -C /lib/modules/$(shell uname -r)/build M=$(PWD) clean
$(MAKE) -C /lib/modules/$(shell uname -r)/build M=$(PWD) clean
rm -f helloctl/helloctl *~