From f52574733195d738c5129ada968460e40f837d23 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benjamin=20K=C3=BCbler?= Date: Tue, 6 May 2014 19:43:03 +0200 Subject: [PATCH] infra: add standalone make --- kernel/Makefile | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 kernel/Makefile diff --git a/kernel/Makefile b/kernel/Makefile new file mode 100644 index 00000000..7976f05a --- /dev/null +++ b/kernel/Makefile @@ -0,0 +1,41 @@ +# +# Makefile for out-of-tree build of MARS module +# +# +# By Benjamin Kübler +# +# usage make [ KDIR =/path/to/kernel/source ] + +ifneq ($(KERNELRELEASE),) + +# in-tree-build process +include Kbuild + +else +# out-of-tree-build process + +MARSSRC := $(shell pwd) +DESTDIR ?= / +KDIR ?= /lib/modules/`uname -r`/build + +.PHONY: greeting install default clean config + +default: greeting + $(MAKE) -C $(KDIR) M=$(PWD) + +greeting: + @echo "Building MARS Module again: KDIR=$(KDIR)" ; + @if ! test -e $(KDIR)/Makefile ; then \ + echo -e "Sorry, kernel makefile not found. You need to tell me a correct KDIR!\n" ; \ + false; \ + fi + +clean: + $(MAKE) -C $(KDIR) M=$(PWD) clean + +config: + $(MAKE) -C $(KDIR) M=$(PWD) config + +install: + $(MAKE) -C $(KDIR) M=$(PWD) modules_install +endif