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

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/OpenBSC@lists.osmocom.org/.

Andreas Schultz aschultz at tpip.net
Thu Oct 29 11:38:57 UTC 2015


Signed-off-by: Andreas Schultz <aschultz at tpip.net>
---
 Makefile | 17 ++++++++++++-----
 1 file changed, 12 insertions(+), 5 deletions(-)

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
-- 
2.5.0




More information about the OpenBSC mailing list