infra: add standalone make

This commit is contained in:
Benjamin Kübler 2014-05-06 19:43:03 +02:00 committed by Thomas Schoebel-Theuer
parent 5feb18d3ad
commit f525747331

41
kernel/Makefile Normal file
View File

@ -0,0 +1,41 @@
#
# Makefile for out-of-tree build of MARS module
#
#
# By Benjamin Kübler <benjamin.kuebler@1und1.de>
#
# 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