[1/6] build: update Makefile for simpler out of tree builds
diff mbox

Message ID 1446118742-22809-2-git-send-email-aschultz@tpip.net
State Accepted
Delegated to: Pablo Neira
Headers show

Commit Message

Andreas Schultz Oct. 29, 2015, 11:38 a.m. UTC
Signed-off-by: Andreas Schultz <aschultz@tpip.net>
---
 Makefile | 17 ++++++++++++-----
 1 file changed, 12 insertions(+), 5 deletions(-)

Patch
diff mbox

diff --git a/Makefile b/Makefile
index 9081679..2b3b4f5 100644
--- a/Makefile
+++ b/Makefile
@@ -1,9 +1,16 @@ 
-CC=gcc
-KDIR := /lib/modules/$(shell uname -r)/build
+KERNEL_SRC := /lib/modules/$(shell uname -r)/build
 
 obj-m += gtp.o
 
-default:
-	$(MAKE) -C $(KDIR) SUBDIRS=$(PWD) modules
+SRC := $(shell pwd)
+
+all:
+	$(MAKE) -C $(KERNEL_SRC) M=$(SRC)
+
+modules_install:
+	$(MAKE) -C $(KERNEL_SRC) M=$(SRC) modules_install
+
 clean:
-	rm -rf *.o *.mod.* modules.order Module.symvers *.ko .tmp_versions .*.cmd
+	rm -f *.o *~ core .depend .*.cmd *.ko *.mod.c
+	rm -f Module.markers Module.symvers modules.order
+	rm -rf .tmp_versions Modules.symvers