summaryrefslogtreecommitdiffstats
path: root/scripts/mkmakefile
diff options
context:
space:
mode:
authorAlbert ARIBAUD <albert.u.boot@aribaud.net>2014-02-20 13:16:05 +0100
committerAlbert ARIBAUD <albert.u.boot@aribaud.net>2014-02-20 13:16:05 +0100
commit3e11350255d9c5d4bd03c2a65769da84c05d3294 (patch)
tree2ebc3d0fa0592479020d2d9dc7228b4d15ed2eaa /scripts/mkmakefile
parente7538fee991308c16f76f7eca2517089f2a30ff4 (diff)
parent0a8e823ad0c5a602c93c2e8a54caf622ade6d3fb (diff)
downloadblackbird-obmc-uboot-3e11350255d9c5d4bd03c2a65769da84c05d3294.tar.gz
blackbird-obmc-uboot-3e11350255d9c5d4bd03c2a65769da84c05d3294.zip
Merge branch 'u-boot/master' into 'u-boot-arm/master'
Conflicts: Makefile drivers/net/npe/Makefile These two conflicts arise from commit 0b2d3f20 ("ARM: NET: Remove the IXP NPE ethernet driver") and are resolved by deleting the drivers/net/npe/Makefile file and removing the CONFIG_IXP4XX_NPE line from Makefile.
Diffstat (limited to 'scripts/mkmakefile')
-rw-r--r--scripts/mkmakefile59
1 files changed, 59 insertions, 0 deletions
diff --git a/scripts/mkmakefile b/scripts/mkmakefile
new file mode 100644
index 0000000000..0cc0442607
--- /dev/null
+++ b/scripts/mkmakefile
@@ -0,0 +1,59 @@
+#!/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
+
+
+test ! -r $2/Makefile -o -O $2/Makefile || exit 0
+# Only overwrite automatically generated Makefiles
+# (so we do not overwrite kernel Makefile)
+if test -e $2/Makefile && ! grep -q Automatically $2/Makefile
+then
+ exit 0
+fi
+if [ "${quiet}" != "silent_" ]; then
+ echo " GEN $2/Makefile"
+fi
+
+cat << EOF > $2/Makefile
+# Automatically generated by $0: don't edit
+
+VERSION = $3
+PATCHLEVEL = $4
+
+lastword = \$(word \$(words \$(1)),\$(1))
+makedir := \$(dir \$(call lastword,\$(MAKEFILE_LIST)))
+
+ifeq ("\$(origin V)", "command line")
+VERBOSE := \$(V)
+endif
+ifneq (\$(VERBOSE),1)
+Q := @
+endif
+
+MAKEARGS := -C $1
+MAKEARGS += O=\$(if \$(patsubst /%,,\$(makedir)),\$(CURDIR)/)\$(patsubst %/,%,\$(makedir))
+
+MAKEFLAGS += --no-print-directory
+
+.PHONY: all \$(MAKECMDGOALS)
+
+all := \$(filter-out all Makefile,\$(MAKECMDGOALS))
+
+all:
+ \$(Q)\$(MAKE) \$(MAKEARGS) \$(all)
+
+Makefile:;
+
+\$(all): all
+ @:
+
+%/: all
+ @:
+EOF
OpenPOWER on IntegriCloud