summaryrefslogtreecommitdiffstats
path: root/scripts/mkmakefile
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/mkmakefile')
-rw-r--r--scripts/mkmakefile31
1 files changed, 31 insertions, 0 deletions
diff --git a/scripts/mkmakefile b/scripts/mkmakefile
new file mode 100644
index 000000000000..c4d621b30d0d
--- /dev/null
+++ b/scripts/mkmakefile
@@ -0,0 +1,31 @@
+#!/bin/sh
+# Generates a small Makefile used in the root of the output
+# directory, to allow make to be started from there.
+# The Makefile also allow for more convinient build of external modules
+
+# Usage
+# $1 - Kernel src directory
+# $2 - Output directory
+# $3 - version
+# $4 - patchlevel
+
+
+cat << EOF
+# Automatically generated by $0: don't edit
+
+VERSION = $3
+PATCHLEVEL = $4
+
+KERNELSRC := $1
+KERNELOUTPUT := $2
+
+MAKEFLAGS += --no-print-directory
+
+all:
+ \$(MAKE) -C \$(KERNELSRC) O=\$(KERNELOUTPUT)
+
+%::
+ \$(MAKE) -C \$(KERNELSRC) O=\$(KERNELOUTPUT) \$@
+
+EOF
+
OpenPOWER on IntegriCloud