summaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile11
1 files changed, 8 insertions, 3 deletions
diff --git a/Makefile b/Makefile
index 4104b64..4b897db 100644
--- a/Makefile
+++ b/Makefile
@@ -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