diff options
author | Albert ARIBAUD <albert.u.boot@aribaud.net> | 2014-02-20 13:16:05 +0100 |
---|---|---|
committer | Albert ARIBAUD <albert.u.boot@aribaud.net> | 2014-02-20 13:16:05 +0100 |
commit | 3e11350255d9c5d4bd03c2a65769da84c05d3294 (patch) | |
tree | 2ebc3d0fa0592479020d2d9dc7228b4d15ed2eaa /scripts/mkmakefile | |
parent | e7538fee991308c16f76f7eca2517089f2a30ff4 (diff) | |
parent | 0a8e823ad0c5a602c93c2e8a54caf622ade6d3fb (diff) | |
download | blackbird-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/mkmakefile | 59 |
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 |