more robust makefile

This commit is contained in:
Vincent Batts 2017-11-05 09:33:39 -05:00
parent 966c1416f4
commit e560ac6386

View file

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