summaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorKyle K <kylek389@gmail.com>2012-12-24 12:53:20 -0600
committerKyle Kaminski <kyle@kkaminsk.com>2012-12-24 12:53:20 -0600
commit0d9aff9bd305d18625c322a1a891aba278049862 (patch)
tree274aa52bf311107232488fb3f924cef316cfcb28 /Makefile
parentf0531d88e958b5fa77f8dc9bb34e697e872aeba9 (diff)
downloadkernelhello-0d9aff9bd305d18625c322a1a891aba278049862.tar.gz
kernelhello-0d9aff9bd305d18625c322a1a891aba278049862.tar.bz2
kernelhello-0d9aff9bd305d18625c322a1a891aba278049862.zip
spawn char device at /dev/, implement read
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