summaryrefslogtreecommitdiff
path: root/kernel/kernel.mak
diff options
context:
space:
mode:
authorLe Chi Thu <thu2004@yahoo.se>2012-04-03 01:23:00 +0200
committerLe Chi Thu <thu2004@yahoo.se>2012-04-03 01:23:00 +0200
commit01c165cd1b2ac601d5ae73d3cb5e82ccdd94ac94 (patch)
tree777ab4b2289c860cab0b438f08e4f30bd52d9af5 /kernel/kernel.mak
Initial commit
Diffstat (limited to 'kernel/kernel.mak')
-rw-r--r--kernel/kernel.mak49
1 files changed, 49 insertions, 0 deletions
diff --git a/kernel/kernel.mak b/kernel/kernel.mak
new file mode 100644
index 0000000..840da0b
--- /dev/null
+++ b/kernel/kernel.mak
@@ -0,0 +1,49 @@
+# Compile this package with small thumb code -
+# not all packages work with this, then you have to comment
+# this out or patch the package.
+ifdef USE_THUMB
+ CFLAGS := -mthumb -mthumb-interwork $(CFLAGS)
+endif
+
+BUILD_ROOT := testcases
+KERNELDIR ?= ../../kernel
+
+.PHONY: build
+build: build-modules build-userspace
+
+.PHONY: build-modules
+build-modules: kernel.mak
+ echo "$@"
+ $(MAKE) --directory=$(KERNEL_OUTPUT) M=$(shell pwd) -j$(JOBS) modules
+
+.PHONY: build-userspace
+build-userspace: kernel.mak
+ echo "$@"
+ $(MAKE) --directory=$(BUILD_ROOT) -j$(JOBS) all
+
+
+.PHONY: install
+install: install-modules install-userspace
+
+.PHONY: install-modules
+install-modules: build-modules
+ echo "$@"
+ifneq ($(CROSS_COMPILE),)
+ $(MAKE) --directory=$(KERNEL_OUTPUT) M=$(shell pwd) -j$(JOBS) modules_install
+else
+ $(MAKE) --directory=$(KERNEL_OUTPUT) M=$(shell pwd) INSTALL_MOD_PATH=$(DESTDIR) -j$(JOBS) modules_install
+endif
+ depmod
+
+.PHONY: install-userspace
+install-userspace: build-userspace
+ echo "$@"
+ cd $(BUILD_ROOT) && $(MAKE) install DESTDIR=$(DESTDIR)
+ $(shell install -d $(DESTDIR)/opt/ltp/runtest)
+ cp -f runtest/* $(DESTDIR)/opt/ltp/runtest
+
+.PHONY: clean
+clean:
+ $(MAKE) --directory=$(BUILD_ROOT) clean
+ $(MAKE) --directory=$(KERNELDIR) M=$(shell pwd) clean
+ find . -name 'modules.order' -delete