obj-m += mod_hello.o all: build info build: modules helloctl/helloctl helloctl/helloctl: ./helloctl/helloctl.c $(CC) -o $@ $< mod_hello.ko: mod_hello.c modules: mod_hello.ko $(MAKE) -C $(shell realpath /lib/modules/$(shell uname -r)/build) M=$(PWD) modules info: mod_hello.ko modinfo $< clean: $(MAKE) -C $(shell realpath /lib/modules/$(shell uname -r)/build) M=$(PWD) clean rm -f helloctl/helloctl *~