diff options
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 11 |
1 files changed, 8 insertions, 3 deletions
@@ -1,4 +1,7 @@ -#ccflags-y += -g +# causes weird file size, smaller than stripped? +ifeq ($(DEBUG),) + ccflags-y += -g +endif # Makfile assignments: # := value at right is expanded and assigned at declaration time @@ -13,11 +16,13 @@ hello-y += main.o debug.o # .ko module to be created obj-m := hello.o +KERNELDIR ?= /lib/modules/$(shell uname -r)/build + # '-C' changes the dir # '-M' causes the the kernel's toplevel Makefile to move back into this dir # before trying to build 'modules' target all: - make -C /lib/modules/$(shell uname -r)/build KCPPFLAGS="-I$(CURDIR)" M=$(PWD) modules + make -C $(KERNELDIR) KCPPFLAGS="-I$(CURDIR)" M=$(PWD) modules clean: - make -C /lib/modules/$(shell uname -r)/build M=$(PWD) clean + make -C $(KERNELDIR) M=$(PWD) clean |