[U-Boot] [PATCH 0/15] Follow-up for Kbuild series: more misc targets and short logs

Kbuild series must be applied before this series.
This series refactors a little, imports more Kbuild features and convert many rules to Kbuild style.
I think most of rules will be displayed in short log formats by applying this series. (But I know there are still some old style rules. I need more efforts...)
Masahiro Yamada (15): kbuild: consolidate version and timestamp headers generation kbuild: abolish "depend" target kbuild: move asm-offsets.h rules to ./Kbuild kbuild: rename OBJCFLAGS to OBJCOPYFLAGS kbuild: Add $(Q) when descending into subdirectories kbuild: use shorten logs objcopy rules kbuild: use shorten logs for mkimage rules kbuild: use shorten logs for cat rules kbuild: use shorten logs for combined rules of mkimage, padding and cat kbuild: use shorten log for linking u-boot kbuild: use shorten logs for misc targets kbuild: use shorten logs for IMX images kbuild: refactor more IMX image rules kbuild: support building signle targets kbuild: add misc targets, help, ubootrelease, ubootversion
Kbuild | 87 +++++ Makefile | 482 ++++++++++++++++---------- arch/arm/config.mk | 14 +- arch/arm/cpu/arm1136/config.mk | 10 - arch/arm/cpu/arm926ejs/config.mk | 10 - arch/arm/cpu/armv7/am33xx/config.mk | 4 +- arch/arm/cpu/armv7/config.mk | 10 - arch/arm/cpu/armv7/omap3/config.mk | 2 +- arch/arm/cpu/armv7/omap4/config.mk | 2 +- arch/arm/cpu/armv7/omap5/config.mk | 2 +- arch/arm/cpu/pxa/config.mk | 2 +- arch/arm/imx-common/Makefile | 85 +++-- arch/blackfin/cpu/Makefile | 6 +- arch/mips/config.mk | 2 +- arch/sandbox/config.mk | 4 + board/hymod/config.mk | 2 +- config.mk | 2 +- doc/DocBook/Makefile | 2 +- examples/api/Makefile | 46 +-- examples/standalone/Makefile | 35 +- nand_spl/board/amcc/acadia/Makefile | 4 +- nand_spl/board/amcc/bamboo/Makefile | 4 +- nand_spl/board/amcc/canyonlands/Makefile | 4 +- nand_spl/board/amcc/kilauea/Makefile | 4 +- nand_spl/board/amcc/sequoia/Makefile | 4 +- nand_spl/board/freescale/mpc8315erdb/Makefile | 4 +- nand_spl/board/freescale/mpc8536ds/Makefile | 4 +- nand_spl/board/freescale/mpc8569mds/Makefile | 4 +- nand_spl/board/freescale/mpc8572ds/Makefile | 4 +- nand_spl/board/freescale/p1023rds/Makefile | 4 +- nand_spl/board/freescale/p1_p2_rdb/Makefile | 4 +- nand_spl/board/sheldon/simpc8313/Makefile | 4 +- scripts/kernel-doc | 4 +- spl/Makefile | 41 ++- tools/scripts/make-asm-offsets | 27 -- 35 files changed, 562 insertions(+), 367 deletions(-) create mode 100644 Kbuild delete mode 100755 tools/scripts/make-asm-offsets

- Generate include/generated/{timestamp.h, version.h} more simply by using filechk rule.
- Add $(UBOOTRELEASE) variable and re-write u-boot.imx rule more simply.
- Rename U_BOOT_VERSION in Makefile to UBOOTVERSION
Before this commit, the same variable name, "U_BOOT_VERSION" was used for two different strings.
One of them was defined in Makefile. It takes the form like "2014.01-rc1" and used in makefiles and script files.
The other is defined in include/generated/version.h It takes the form like "U-Boot 2014.01-rc1-00010-gbe6d426-dirty" and used in C and Aseembler.
It is confusing when grepping the source tree. So, this commit renames the former to UBOOTVERSION.
Signed-off-by: Masahiro Yamada yamada.m@jp.panasonic.com ---
Makefile | 83 +++++++++++++++++++++++++++++----------------------- doc/DocBook/Makefile | 2 +- scripts/kernel-doc | 4 +-- 3 files changed, 49 insertions(+), 40 deletions(-)
diff --git a/Makefile b/Makefile index b425bfb..3d98b04 100644 --- a/Makefile +++ b/Makefile @@ -180,9 +180,6 @@ unexport CDPATH
#########################################################################
-TIMESTAMP_FILE = include/generated/timestamp_autogenerated.h -VERSION_FILE = include/generated/version_autogenerated.h - HOSTARCH := $(shell uname -m | \ sed -e s/i.86/x86/ \ -e s/sun4u/sparc64/ \ @@ -356,9 +353,11 @@ KBUILD_CFLAGS := -Wall -Wstrict-prototypes \ -fno-builtin -ffreestanding KBUILD_AFLAGS := -D__ASSEMBLY__
-U_BOOT_VERSION = $(VERSION)$(if $(PATCHLEVEL),.$(PATCHLEVEL)$(if $(SUBLEVEL),.$(SUBLEVEL)))$(EXTRAVERSION) +# Read UBOOTRELEASE from include/config/uboot.release (if it exists) +UBOOTRELEASE = $(shell cat include/config/uboot.release 2> /dev/null) +UBOOTVERSION = $(VERSION)$(if $(PATCHLEVEL),.$(PATCHLEVEL)$(if $(SUBLEVEL),.$(SUBLEVEL)))$(EXTRAVERSION)
-export VERSION PATCHLEVEL SUBLEVEL U_BOOT_VERSION +export VERSION PATCHLEVEL SUBLEVEL UBOOTRELEASE UBOOTVERSION export ARCH CPU BOARD VENDOR SOC export CONFIG_SHELL HOSTCC HOSTCFLAGS HOSTLDFLAGS CROSS_COMPILE AS LD CC export CPP AR NM LDR STRIP OBJCOPY OBJDUMP @@ -411,6 +410,9 @@ endif # Detect when mixed targets is specified, and make a second invocation # of make so .config is not included in this case either (for *config).
+version_h := include/generated/version_autogenerated.h +timestamp_h := include/generated/timestamp_autogenerated.h + no-dot-config-targets := clean clobber mrproper distclean \ cscope TAGS %tags help %docs check% coccicheck \ backup @@ -582,8 +584,6 @@ CHECKFLAGS += $(NOSTDINC_FLAGS) cpp_flags := $(KBUILD_CPPFLAGS) $(CPPFLAGS) $(UBOOTINCLUDE) $(NOSTDINC_FLAGS) c_flags := $(KBUILD_CFLAGS) $(cpp_flags)
-.PHONY : $(VERSION_FILE) $(TIMESTAMP_FILE) - ######################################################################### # U-Boot objects....order is important (i.e. start must be first)
@@ -787,8 +787,7 @@ u-boot.img: u-boot.bin tools/mkimage -A $(ARCH) -T firmware -C none \ -O u-boot -a $(CONFIG_SYS_TEXT_BASE) \ -e $(CONFIG_SYS_UBOOT_START) \ - -n $(shell sed -n -e 's/.*U_BOOT_VERSION//p' $(VERSION_FILE) | \ - sed -e 's/"[ ]*$$/ for $(BOARD) board"/') \ + -n "U-Boot $(UBOOTRELEASE) for $(BOARD) board" \ -d $< $@
u-boot.imx: u-boot.bin @@ -944,13 +943,22 @@ PHONY += $(u-boot-dirs) $(u-boot-dirs): depend prepare scripts $(Q)$(MAKE) $(build)=$@
-tools: $(TIMESTAMP_FILE) $(VERSION_FILE) +tools: prepare # The "tools" are needed early $(filter-out tools, $(u-boot-dirs)): tools # The "examples" conditionally depend on U-Boot (say, when USE_PRIVATE_LIBGCC # is "yes"), so compile examples after U-Boot is compiled. examples: $(filter-out examples, $(u-boot-dirs))
+define filechk_uboot.release + echo "$(UBOOTVERSION)$$($(CONFIG_SHELL) $(srctree)/scripts/setlocalversion $(srctree))" +endef + +# Store (new) UBOOTRELEASE string in include/config/uboot.release +include/config/uboot.release: Makefile FORCE + $(call filechk,uboot.release) + + # Things we need to do before we recursively start building the kernel # or the modules are listed in "prepare". # A multi level approach is used. prepareN is processed before prepareN-1. @@ -963,7 +971,7 @@ PHONY += prepare archprepare prepare0 prepare1 prepare2 prepare3 # prepare3 is used to check if we are building in a separate output directory, # and if so do: # 1) Check that make has not been executed in the kernel src $(srctree) -prepare3: +prepare3: include/config/uboot.release ifneq ($(KBUILD_SRC),) @$(kecho) ' Using $(srctree) as source for u-boot' $(Q)if [ -f $(srctree)/include/config.mk ]; then \ @@ -976,7 +984,7 @@ endif # prepare2 creates a makefile if using a separate output directory prepare2: prepare3 outputmakefile
-prepare1: prepare2 +prepare1: prepare2 $(version_h) $(timestamp_h) @:
archprepare: prepare1 scripts_basic @@ -987,6 +995,27 @@ prepare0: archprepare FORCE # All the preparing.. prepare: prepare0
+# Generate some files +# --------------------------------------------------------------------------- + +define filechk_version.h + (echo #define PLAIN_VERSION "$(UBOOTRELEASE)"; \ + echo #define U_BOOT_VERSION "U-Boot " PLAIN_VERSION; \ + echo #define CC_VERSION_STRING "$$($(CC) --version | head -n 1)"; \ + echo #define LD_VERSION_STRING "$$($(LD) --version | head -n 1)"; ) +endef + +define filechk_timestamp.h + (LC_ALL=C date +'#define U_BOOT_DATE "%b %d %C%y"'; \ + LC_ALL=C date +'#define U_BOOT_TIME "%T"') +endef + +$(version_h): $(srctree)/Makefile FORCE + $(call filechk,version.h) + +$(timestamp_h): $(srctree)/Makefile FORCE + $(call filechk,timestamp.h) + # # Auto-generate the autoconf.mk file (which is included by all makefiles) # @@ -1010,16 +1039,16 @@ quiet_cmd_autoconf = GEN $@ include/autoconf.mk: include/config.h $(call cmd,autoconf)
-u-boot.lds: $(LDSCRIPT) depend +u-boot.lds: $(LDSCRIPT) depend prepare $(CPP) $(cpp_flags) $(LDPPFLAGS) -ansi -D__ASSEMBLY__ -P - <$< >$@
-nand_spl: $(TIMESTAMP_FILE) $(VERSION_FILE) depend prepare +nand_spl: depend prepare $(MAKE) $(build)=nand_spl/board/$(BOARDDIR) all
u-boot-nand.bin: nand_spl u-boot.bin cat nand_spl/u-boot-spl-16k.bin u-boot.bin > u-boot-nand.bin
-spl/u-boot-spl.bin: tools depend prepare +spl/u-boot-spl.bin: tools depend prepare $(MAKE) obj=spl -f $(srctree)/spl/Makefile all
tpl/u-boot-tpl.bin: tools depend prepare @@ -1027,7 +1056,7 @@ tpl/u-boot-tpl.bin: tools depend prepare
# Explicitly make _depend in subdirs containing multiple targets to prevent # parallel sub-makes creating .depend files simultaneously. -depend dep: $(TIMESTAMP_FILE) $(VERSION_FILE) \ +depend dep: \ include/generated/generic-asm-offsets.h \ include/generated/asm-offsets.h
@@ -1128,27 +1157,7 @@ checkarmreloc: u-boot false; \ fi
-$(VERSION_FILE): - @mkdir -p $(dir $(VERSION_FILE)) - @( localvers='$(shell $(TOPDIR)/scripts/setlocalversion $(TOPDIR))' ; \ - printf '#define PLAIN_VERSION "%s%s"\n' \ - "$(U_BOOT_VERSION)" "$${localvers}" ; \ - printf '#define U_BOOT_VERSION "U-Boot %s%s"\n' \ - "$(U_BOOT_VERSION)" "$${localvers}" ; \ - ) > $@.tmp - @( printf '#define CC_VERSION_STRING "%s"\n' \ - '$(shell $(CC) --version | head -n 1)' )>> $@.tmp - @( printf '#define LD_VERSION_STRING "%s"\n' \ - '$(shell $(LD) -v | head -n 1)' )>> $@.tmp - @cmp -s $@ $@.tmp && rm -f $@.tmp || mv -f $@.tmp $@ - -$(TIMESTAMP_FILE): - @mkdir -p $(dir $(TIMESTAMP_FILE)) - @LC_ALL=C date +'#define U_BOOT_DATE "%b %d %C%y"' > $@.tmp - @LC_ALL=C date +'#define U_BOOT_TIME "%T"' >> $@.tmp - @cmp -s $@ $@.tmp && rm -f $@.tmp || mv -f $@.tmp $@ - -env: depend scripts_basic +env: scripts_basic $(Q)$(MAKE) $(build)=tools/$@
tools-all: HOST_TOOLS_ALL=y diff --git a/doc/DocBook/Makefile b/doc/DocBook/Makefile index 44afc47..9b4a9b6 100644 --- a/doc/DocBook/Makefile +++ b/doc/DocBook/Makefile @@ -131,7 +131,7 @@ index = index.html main_idx = doc/DocBook/$(index) build_main_index = rm -rf $(main_idx); \ echo '<h1>U-Boot Bootloader HTML Documentation</h1>' >> $(main_idx) && \ - echo '<h2>U-Boot Version: $(U_BOOT_VERSION)</h2>' >> $(main_idx) && \ + echo '<h2>U-Boot Version: $(UBOOTVERSION)</h2>' >> $(main_idx) && \ cat $(HTML) >> $(main_idx)
quiet_cmd_db2html = HTML $@ diff --git a/scripts/kernel-doc b/scripts/kernel-doc index ba2bafd..c881b8c 100755 --- a/scripts/kernel-doc +++ b/scripts/kernel-doc @@ -392,8 +392,8 @@ sub usage { sub get_kernel_version() { my $version = 'unknown kernel version';
- if (defined($ENV{'U_BOOT_VERSION'})) { - $version = $ENV{'U_BOOT_VERSION'}; + if (defined($ENV{'UBOOTVERSION'})) { + $version = $ENV{'UBOOTVERSION'}; } return $version; }

This commit moves include/generated/{generic-asm-offsets.h, asm-offsets.h} from "depend" targets to "prepare" targets and deletes "depend" targets.
Signed-off-by: Masahiro Yamada yamada.m@jp.panasonic.com ---
Makefile | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-)
diff --git a/Makefile b/Makefile index 3d98b04..fb6cf8e 100644 --- a/Makefile +++ b/Makefile @@ -940,7 +940,7 @@ $(sort $(u-boot-init) $(u-boot-main)): $(u-boot-dirs) ; # Error messages still appears in the original language
PHONY += $(u-boot-dirs) -$(u-boot-dirs): depend prepare scripts +$(u-boot-dirs): prepare scripts $(Q)$(MAKE) $(build)=$@
tools: prepare @@ -989,7 +989,8 @@ prepare1: prepare2 $(version_h) $(timestamp_h)
archprepare: prepare1 scripts_basic
-prepare0: archprepare FORCE +prepare0: archprepare FORCE include/generated/generic-asm-offsets.h \ + include/generated/asm-offsets.h @:
# All the preparing.. @@ -1039,27 +1040,29 @@ quiet_cmd_autoconf = GEN $@ include/autoconf.mk: include/config.h $(call cmd,autoconf)
-u-boot.lds: $(LDSCRIPT) depend prepare +# --------------------------------------------------------------------------- + +PHONY += depend dep +depend dep: + @echo '*** Warning: make $@ is unnecessary now.' + +# --------------------------------------------------------------------------- + +u-boot.lds: $(LDSCRIPT) prepare $(CPP) $(cpp_flags) $(LDPPFLAGS) -ansi -D__ASSEMBLY__ -P - <$< >$@
-nand_spl: depend prepare +nand_spl: prepare $(MAKE) $(build)=nand_spl/board/$(BOARDDIR) all
u-boot-nand.bin: nand_spl u-boot.bin cat nand_spl/u-boot-spl-16k.bin u-boot.bin > u-boot-nand.bin
-spl/u-boot-spl.bin: tools depend prepare +spl/u-boot-spl.bin: tools prepare $(MAKE) obj=spl -f $(srctree)/spl/Makefile all
-tpl/u-boot-tpl.bin: tools depend prepare +tpl/u-boot-tpl.bin: tools prepare $(MAKE) obj=tpl -f $(srctree)/spl/Makefile all CONFIG_TPL_BUILD=y
-# Explicitly make _depend in subdirs containing multiple targets to prevent -# parallel sub-makes creating .depend files simultaneously. -depend dep: \ - include/generated/generic-asm-offsets.h \ - include/generated/asm-offsets.h - TAG_SUBDIRS := $(u-boot-dirs) include
FIND := find

Generate include/generated/generic-asm-offsets.h and include/generated/asm-offsets.h in ./Kbuild.
This commit also changes the include guard.
Before this commit, __ASM_OFFSETS_H__ was used for both of them. So we could not include generic-asm-offsets.h and asm-offsets.h at the same time.
This commit renames the include guard of the former to __GENERIC_ASM_OFFSETS_H__.
Signed-off-by: Masahiro Yamada yamada.m@jp.panasonic.com ---
Kbuild | 87 ++++++++++++++++++++++++++++++++++++++++++ Makefile | 36 +---------------- tools/scripts/make-asm-offsets | 27 ------------- 3 files changed, 89 insertions(+), 61 deletions(-) create mode 100644 Kbuild delete mode 100755 tools/scripts/make-asm-offsets
diff --git a/Kbuild b/Kbuild new file mode 100644 index 0000000..1d89761 --- /dev/null +++ b/Kbuild @@ -0,0 +1,87 @@ +# +# Kbuild for top-level directory of U-Boot +# This file takes care of the following: +# 1) Generate generic-asm-offsets.h +# 2) Generate asm-offsets.h + +##### +# 1) Generate generic-asm-offsets.h + +generic-offsets-file := include/generated/generic-asm-offsets.h + +always := $(generic-offsets-file) +targets := $(generic-offsets-file) lib/asm-offsets.s + +quiet_cmd_generic-offsets = GEN $@ +define cmd_generic-offsets + (set -e; \ + echo "#ifndef __GENERIC_ASM_OFFSETS_H__"; \ + echo "#define __GENERIC_ASM_OFFSETS_H__"; \ + echo "/*"; \ + echo " * DO NOT MODIFY."; \ + echo " *"; \ + echo " * This file was generated by Kbuild"; \ + echo " *"; \ + echo " */"; \ + echo ""; \ + sed -ne $(sed-y) $<; \ + echo ""; \ + echo "#endif" ) > $@ +endef + +# We use internal kbuild rules to avoid the "is up to date" message from make +lib/asm-offsets.s: lib/asm-offsets.c FORCE + $(Q)mkdir -p $(dir $@) + $(call if_changed_dep,cc_s_c) + +$(obj)/$(generic-offsets-file): lib/asm-offsets.s Kbuild + $(Q)mkdir -p $(dir $@) + $(call cmd,generic-offsets) + +##### +# 2) Generate asm-offsets.h +# + +ifneq ($(wildcard $(srctree)/$(CPUDIR)/$(SOC)/asm-offsets.c),) +offsets-file := include/generated/asm-offsets.h +endif + +always += $(offsets-file) +targets += $(offsets-file) +targets += $(CPUDIR)/$(SOC)/asm-offsets.s + + +# Default sed regexp - multiline due to syntax constraints +define sed-y + "/^->/{s:->#(.*):/* \1 */:; \ + s:^->([^ ]*) [$$#]*([-0-9]*) (.*):#define \1 \2 /* \3 */:; \ + s:^->([^ ]*) [$$#]*([^ ]*) (.*):#define \1 \2 /* \3 */:; \ + s:->::; p;}" +endef + +CFLAGS_asm-offsets.o := -DDO_DEPS_ONLY + +quiet_cmd_offsets = GEN $@ +define cmd_offsets + (set -e; \ + echo "#ifndef __ASM_OFFSETS_H__"; \ + echo "#define __ASM_OFFSETS_H__"; \ + echo "/*"; \ + echo " * DO NOT MODIFY."; \ + echo " *"; \ + echo " * This file was generated by Kbuild"; \ + echo " *"; \ + echo " */"; \ + echo ""; \ + sed -ne $(sed-y) $<; \ + echo ""; \ + echo "#endif" ) > $@ +endef + +# We use internal kbuild rules to avoid the "is up to date" message from make +$(CPUDIR)/$(SOC)/asm-offsets.s: $(CPUDIR)/$(SOC)/asm-offsets.c FORCE + $(Q)mkdir -p $(dir $@) + $(call if_changed_dep,cc_s_c) + +$(obj)/$(offsets-file): $(CPUDIR)/$(SOC)/asm-offsets.s + $(call cmd,offsets) diff --git a/Makefile b/Makefile index fb6cf8e..866343e 100644 --- a/Makefile +++ b/Makefile @@ -989,9 +989,8 @@ prepare1: prepare2 $(version_h) $(timestamp_h)
archprepare: prepare1 scripts_basic
-prepare0: archprepare FORCE include/generated/generic-asm-offsets.h \ - include/generated/asm-offsets.h - @: +prepare0: archprepare FORCE + $(Q)$(MAKE) $(build)=.
# All the preparing.. prepare: prepare0 @@ -1116,37 +1115,6 @@ checkdtc: false; \ fi
-quiet_cmd_offsets = GEN $@ - cmd_offsets = $(srctree)/tools/scripts/make-asm-offsets $< $@ - -include/generated/generic-asm-offsets.h: lib/asm-offsets.s - $(call cmd,offsets) - -quiet_cmd_asm-offsets.s = CC $@ - cmd_asm-offsets.s = mkdir -p lib; \ - $(CC) -DDO_DEPS_ONLY \ - $(c_flags) $(CFLAGS_$(BCURDIR)/$(@F)) $(CFLAGS_$(BCURDIR)) \ - -o $@ $< -c -S - -lib/asm-offsets.s: $(srctree)/lib/asm-offsets.c include/config.h - $(call cmd,asm-offsets.s) - -include/generated/asm-offsets.h: $(CPUDIR)/$(SOC)/asm-offsets.s - $(call cmd,offsets) - -quiet_cmd_soc_asm-offsets.s = CC $@ - cmd_soc_asm-offsets.s = mkdir -p $(CPUDIR)/$(SOC); \ - if [ -f $(srctree)/$(CPUDIR)/$(SOC)/asm-offsets.c ];then \ - $(CC) -DDO_DEPS_ONLY \ - $(c_flags) $(CFLAGS_$(BCURDIR)/$(@F)) $(CFLAGS_$(BCURDIR)) \ - -o $@ $(srctree)/$(CPUDIR)/$(SOC)/asm-offsets.c -c -S; \ - else \ - touch $@; \ - fi - -$(CPUDIR)/$(SOC)/asm-offsets.s: include/config.h - $(call cmd,soc_asm-offsets.s) - #########################################################################
# ARM relocations should all be R_ARM_RELATIVE (32-bit) or diff --git a/tools/scripts/make-asm-offsets b/tools/scripts/make-asm-offsets deleted file mode 100755 index 4c33756..0000000 --- a/tools/scripts/make-asm-offsets +++ /dev/null @@ -1,27 +0,0 @@ -#!/bin/sh - -# Adapted from Linux kernel's "Kbuild": -# commit 1cdf25d704f7951d02a04064c97db547d6021872 -# Author: Christoph Lameter clameter@sgi.com - -mkdir -p $(dirname $2) - -# Default sed regexp - multiline due to syntax constraints -SED_CMD="/^->/{s:->#(.*):/* \1 */:; \ - s:^->([^ ]*) [$#]*([-0-9]*) (.*):#define \1 (\2) /* \3 */:; \ - s:^->([^ ]*) [$#]*([^ ]*) (.*):#define \1 \2 /* \3 */:; \ - s:->::; p;}" - -(set -e - echo "#ifndef __ASM_OFFSETS_H__" - echo "#define __ASM_OFFSETS_H__" - echo "/*" - echo " * DO NOT MODIFY." - echo " *" - echo " * This file was generated by $(basename $0)" - echo " *" - echo " */" - echo "" - sed -ne "${SED_CMD}" $1 - echo "" - echo "#endif" ) > $2

Rename OBJCFLAGS to OBJCOPYFLAGS beforehand to use "cmd_objcopy" in scripts/Makefile.lib in an upcoming commit.
Signed-off-by: Masahiro Yamada yamada.m@jp.panasonic.com ---
Makefile | 16 ++++++++-------- arch/arm/config.mk | 4 ++-- arch/arm/cpu/pxa/config.mk | 2 +- arch/arm/imx-common/Makefile | 4 ++-- arch/mips/config.mk | 2 +- board/hymod/config.mk | 2 +- config.mk | 2 +- nand_spl/board/amcc/acadia/Makefile | 4 ++-- nand_spl/board/amcc/bamboo/Makefile | 4 ++-- nand_spl/board/amcc/canyonlands/Makefile | 4 ++-- nand_spl/board/amcc/kilauea/Makefile | 4 ++-- nand_spl/board/amcc/sequoia/Makefile | 4 ++-- nand_spl/board/freescale/mpc8315erdb/Makefile | 4 ++-- nand_spl/board/freescale/mpc8536ds/Makefile | 4 ++-- nand_spl/board/freescale/mpc8569mds/Makefile | 4 ++-- nand_spl/board/freescale/mpc8572ds/Makefile | 4 ++-- nand_spl/board/freescale/p1023rds/Makefile | 4 ++-- nand_spl/board/freescale/p1_p2_rdb/Makefile | 4 ++-- nand_spl/board/sheldon/simpc8313/Makefile | 4 ++-- spl/Makefile | 2 +- 20 files changed, 41 insertions(+), 41 deletions(-)
diff --git a/Makefile b/Makefile index 866343e..beca991 100644 --- a/Makefile +++ b/Makefile @@ -754,13 +754,13 @@ u-boot-dtb.bin: u-boot.bin dts/dt.dtb cat $^ >$@
u-boot.hex: u-boot - $(OBJCOPY) ${OBJCFLAGS} -O ihex $< $@ + $(OBJCOPY) $(OBJCOPYFLAGS) -O ihex $< $@
u-boot.srec: u-boot - $(OBJCOPY) ${OBJCFLAGS} -O srec $< $@ + $(OBJCOPY) $(OBJCOPYFLAGS) -O srec $< $@
u-boot.bin: u-boot - $(OBJCOPY) ${OBJCFLAGS} -O binary $< $@ + $(OBJCOPY) $(OBJCOPYFLAGS) -O binary $< $@ $(call DO_STATIC_RELA,$<,$@,$(CONFIG_SYS_TEXT_BASE)) $(BOARD_SIZE_CHECK)
@@ -770,10 +770,10 @@ u-boot.ldr: u-boot $(BOARD_SIZE_CHECK)
u-boot.ldr.hex: u-boot.ldr - $(OBJCOPY) ${OBJCFLAGS} -O ihex $< $@ -I binary + $(OBJCOPY) $(OBJCOPYFLAGS) -O ihex $< $@ -I binary
u-boot.ldr.srec: u-boot.ldr - $(OBJCOPY) ${OBJCFLAGS} -O srec $< $@ -I binary + $(OBJCOPY) $(OBJCOPYFLAGS) -O srec $< $@ -I binary
# # U-Boot entry point, needed for booting of full-blown U-Boot @@ -811,7 +811,7 @@ u-boot.dis: u-boot # $@ is output, $(1) and $(2) are inputs, $(3) is padded intermediate, # $(4) is pad-to SPL_PAD_APPEND = \ - $(OBJCOPY) ${OBJCFLAGS} --pad-to=$(4) -I binary -O binary \ + $(OBJCOPY) $(OBJCOPYFLAGS) --pad-to=$(4) -I binary -O binary \ $(1) $(3); \ cat $(3) $(2) > $@; \ rm $(3) @@ -846,7 +846,7 @@ u-boot.ais: spl/u-boot-spl.bin u-boot.img -e $(CONFIG_SPL_TEXT_BASE) \ -d spl/u-boot-spl.bin \ spl/u-boot-spl.ais - $(OBJCOPY) ${OBJCFLAGS} -I binary \ + $(OBJCOPY) $(OBJCOPYFLAGS) -I binary \ --pad-to=$(CONFIG_SPL_MAX_SIZE) -O binary \ spl/u-boot-spl.ais spl/u-boot-spl-pad.ais cat spl/u-boot-spl-pad.ais u-boot.img > u-boot.ais @@ -871,7 +871,7 @@ u-boot.spr: u-boot.img spl/u-boot-spl.bin
ifneq ($(CONFIG_TEGRA),) u-boot-nodtb-tegra.bin: spl/u-boot-spl.bin u-boot.bin - $(OBJCOPY) ${OBJCFLAGS} --pad-to=$(CONFIG_SYS_TEXT_BASE) -O binary spl/u-boot-spl spl/u-boot-spl-pad.bin + $(OBJCOPY) $(OBJCOPYFLAGS) --pad-to=$(CONFIG_SYS_TEXT_BASE) -O binary spl/u-boot-spl spl/u-boot-spl-pad.bin cat spl/u-boot-spl-pad.bin u-boot.bin > $@ rm spl/u-boot-spl-pad.bin
diff --git a/arch/arm/config.mk b/arch/arm/config.mk index 98c1253..8a65c34 100644 --- a/arch/arm/config.mk +++ b/arch/arm/config.mk @@ -108,7 +108,7 @@ endif
# limit ourselves to the sections we want in the .bin. ifdef CONFIG_ARM64 -OBJCFLAGS += -j .text -j .rodata -j .data -j .u_boot_list -j .rela.dyn +OBJCOPYFLAGS += -j .text -j .rodata -j .data -j .u_boot_list -j .rela.dyn else -OBJCFLAGS += -j .text -j .rodata -j .hash -j .data -j .got.plt -j .u_boot_list -j .rel.dyn +OBJCOPYFLAGS += -j .text -j .rodata -j .hash -j .data -j .got.plt -j .u_boot_list -j .rel.dyn endif diff --git a/arch/arm/cpu/pxa/config.mk b/arch/arm/cpu/pxa/config.mk index 986b11b..525f5d3 100644 --- a/arch/arm/cpu/pxa/config.mk +++ b/arch/arm/cpu/pxa/config.mk @@ -18,5 +18,5 @@ PLATFORM_CPPFLAGS += -mcpu=xscale #
#ifdef CONFIG_SPL_BUILD -OBJCFLAGS += -j .text.0 -j .text.1 +OBJCOPYFLAGS += -j .text.0 -j .text.1 #endif diff --git a/arch/arm/imx-common/Makefile b/arch/arm/imx-common/Makefile index 9dda59d..88d6c0b 100644 --- a/arch/arm/imx-common/Makefile +++ b/arch/arm/imx-common/Makefile @@ -36,7 +36,7 @@ $(OBJTREE)/SPL: $(OBJTREE)/spl/u-boot-spl.bin $(OBJTREE)/$(patsubst "%",%,$(CONF -e $(CONFIG_SPL_TEXT_BASE) -d $< $@
$(OBJTREE)/u-boot-with-spl.imx: $(OBJTREE)/SPL $(OBJTREE)/u-boot.bin - $(OBJCOPY) ${OBJCFLAGS} --pad-to=$(CONFIG_SPL_PAD_TO) \ + $(OBJCOPY) $(OBJCOPYFLAGS) --pad-to=$(CONFIG_SPL_PAD_TO) \ -I binary -O binary $< $(OBJTREE)/spl/u-boot-spl-pad.imx $(OBJTREE)/tools/mkimage -A arm -O U-Boot -a $(CONFIG_SYS_TEXT_BASE) \ -e $(CONFIG_SYS_TEXT_BASE) -C none -d $(OBJTREE)/u-boot.bin \ @@ -48,7 +48,7 @@ $(OBJTREE)/u-boot-with-nand-spl.imx: $(OBJTREE)/SPL $(OBJTREE)/u-boot.bin (echo -ne '\x00\x00\x00\x00\x46\x43\x42\x20\x01' && \ dd bs=1015 count=1 if=/dev/zero 2>/dev/null) | \ cat - $< > $(OBJTREE)/spl/u-boot-nand-spl.imx - $(OBJCOPY) ${OBJCFLAGS} --pad-to=$(CONFIG_SPL_PAD_TO) \ + $(OBJCOPY) $(OBJCOPYFLAGS) --pad-to=$(CONFIG_SPL_PAD_TO) \ -I binary -O binary $(OBJTREE)/spl/u-boot-nand-spl.imx \ $(OBJTREE)/spl/u-boot-nand-spl-pad.imx rm $(OBJTREE)/spl/u-boot-nand-spl.imx diff --git a/arch/mips/config.mk b/arch/mips/config.mk index c3f81b5..2abdebb 100644 --- a/arch/mips/config.mk +++ b/arch/mips/config.mk @@ -50,4 +50,4 @@ PLATFORM_CPPFLAGS += -msoft-float PLATFORM_LDFLAGS += -G 0 -static -n -nostdlib $(ENDIANNESS) PLATFORM_RELFLAGS += -ffunction-sections -fdata-sections LDFLAGS_FINAL += --gc-sections -pie -OBJCFLAGS += --remove-section=.dynsym +OBJCOPYFLAGS += --remove-section=.dynsym diff --git a/board/hymod/config.mk b/board/hymod/config.mk index abcd2d5..ee15890 100644 --- a/board/hymod/config.mk +++ b/board/hymod/config.mk @@ -11,4 +11,4 @@
PLATFORM_CPPFLAGS += -I$(TOPDIR)
-OBJCFLAGS = --remove-section=.ppcenv +OBJCOPYFLAGS = --remove-section=.ppcenv diff --git a/config.mk b/config.mk index 5b886aa..9897f20 100644 --- a/config.mk +++ b/config.mk @@ -41,7 +41,7 @@ endif
RELFLAGS= $(PLATFORM_RELFLAGS)
-OBJCFLAGS += --gap-fill=0xff +OBJCOPYFLAGS += --gap-fill=0xff
CPPFLAGS = $(RELFLAGS) CPPFLAGS += -pipe $(PLATFORM_CPPFLAGS) diff --git a/nand_spl/board/amcc/acadia/Makefile b/nand_spl/board/amcc/acadia/Makefile index d256abf..4d084b3 100644 --- a/nand_spl/board/amcc/acadia/Makefile +++ b/nand_spl/board/amcc/acadia/Makefile @@ -28,10 +28,10 @@ all: $(nandobj)u-boot-spl.bin $(nandobj)u-boot-spl-16k.bin \ $(nandobj)System.map
$(nandobj)u-boot-spl-16k.bin: $(nandobj)u-boot-spl - $(OBJCOPY) ${OBJCFLAGS} --pad-to=$(PAD_TO) -O binary $< $@ + $(OBJCOPY) $(OBJCOPYFLAGS) --pad-to=$(PAD_TO) -O binary $< $@
$(nandobj)u-boot-spl.bin: $(nandobj)u-boot-spl - $(OBJCOPY) ${OBJCFLAGS} -O binary $< $@ + $(OBJCOPY) $(OBJCOPYFLAGS) -O binary $< $@
$(nandobj)u-boot-spl: $(OBJS) $(nandobj)u-boot.lds cd $(LNDIR) && $(LD) $(LDFLAGS) $(__OBJS) $(PLATFORM_LIBS) \ diff --git a/nand_spl/board/amcc/bamboo/Makefile b/nand_spl/board/amcc/bamboo/Makefile index 4f36d6c..f975b72 100644 --- a/nand_spl/board/amcc/bamboo/Makefile +++ b/nand_spl/board/amcc/bamboo/Makefile @@ -27,10 +27,10 @@ targets += $(__OBJS) all: $(nandobj)u-boot-spl.bin $(nandobj)u-boot-spl-16k.bin
$(nandobj)u-boot-spl-16k.bin: $(nandobj)u-boot-spl - $(OBJCOPY) ${OBJCFLAGS} --pad-to=$(PAD_TO) -O binary $< $@ + $(OBJCOPY) $(OBJCOPYFLAGS) --pad-to=$(PAD_TO) -O binary $< $@
$(nandobj)u-boot-spl.bin: $(nandobj)u-boot-spl - $(OBJCOPY) ${OBJCFLAGS} -O binary $< $@ + $(OBJCOPY) $(OBJCOPYFLAGS) -O binary $< $@
$(nandobj)u-boot-spl: $(OBJS) $(nandobj)u-boot.lds cd $(LNDIR) && $(LD) $(LDFLAGS) $(__OBJS) $(PLATFORM_LIBS) \ diff --git a/nand_spl/board/amcc/canyonlands/Makefile b/nand_spl/board/amcc/canyonlands/Makefile index 5c9c8e8..250f083 100644 --- a/nand_spl/board/amcc/canyonlands/Makefile +++ b/nand_spl/board/amcc/canyonlands/Makefile @@ -32,10 +32,10 @@ targets += $(__OBJS) all: $(nandobj)u-boot-spl.bin $(nandobj)u-boot-spl-16k.bin
$(nandobj)u-boot-spl-16k.bin: $(nandobj)u-boot-spl - $(OBJCOPY) ${OBJCFLAGS} --pad-to=$(PAD_TO) -O binary $< $@ + $(OBJCOPY) $(OBJCOPYFLAGS) --pad-to=$(PAD_TO) -O binary $< $@
$(nandobj)u-boot-spl.bin: $(nandobj)u-boot-spl - $(OBJCOPY) ${OBJCFLAGS} -O binary $< $@ + $(OBJCOPY) $(OBJCOPYFLAGS) -O binary $< $@
$(nandobj)u-boot-spl: $(OBJS) $(nandobj)u-boot.lds cd $(LNDIR) && $(LD) $(LDFLAGS) $(__OBJS) $(PLATFORM_LIBS) \ diff --git a/nand_spl/board/amcc/kilauea/Makefile b/nand_spl/board/amcc/kilauea/Makefile index cfe3082..a8d4689 100644 --- a/nand_spl/board/amcc/kilauea/Makefile +++ b/nand_spl/board/amcc/kilauea/Makefile @@ -27,10 +27,10 @@ targets += $(__OBJS) all: $(nandobj)u-boot-spl.bin $(nandobj)u-boot-spl-16k.bin
$(nandobj)u-boot-spl-16k.bin: $(nandobj)u-boot-spl - $(OBJCOPY) ${OBJCFLAGS} --pad-to=$(PAD_TO) -O binary $< $@ + $(OBJCOPY) $(OBJCOPYFLAGS) --pad-to=$(PAD_TO) -O binary $< $@
$(nandobj)u-boot-spl.bin: $(nandobj)u-boot-spl - $(OBJCOPY) ${OBJCFLAGS} -O binary $< $@ + $(OBJCOPY) $(OBJCOPYFLAGS) -O binary $< $@
$(nandobj)u-boot-spl: $(OBJS) $(nandobj)u-boot.lds cd $(LNDIR) && $(LD) $(LDFLAGS) $(__OBJS) $(PLATFORM_LIBS) \ diff --git a/nand_spl/board/amcc/sequoia/Makefile b/nand_spl/board/amcc/sequoia/Makefile index de02886..b0385ae 100644 --- a/nand_spl/board/amcc/sequoia/Makefile +++ b/nand_spl/board/amcc/sequoia/Makefile @@ -27,10 +27,10 @@ targets += $(__OBJS) all: $(nandobj)u-boot-spl.bin $(nandobj)u-boot-spl-16k.bin
$(nandobj)u-boot-spl-16k.bin: $(nandobj)u-boot-spl - $(OBJCOPY) ${OBJCFLAGS} --pad-to=$(PAD_TO) -O binary $< $@ + $(OBJCOPY) $(OBJCOPYFLAGS) --pad-to=$(PAD_TO) -O binary $< $@
$(nandobj)u-boot-spl.bin: $(nandobj)u-boot-spl - $(OBJCOPY) ${OBJCFLAGS} -O binary $< $@ + $(OBJCOPY) $(OBJCOPYFLAGS) -O binary $< $@
$(nandobj)u-boot-spl: $(OBJS) $(nandobj)u-boot.lds cd $(LNDIR) && $(LD) $(LDFLAGS) $(__OBJS) $(PLATFORM_LIBS) \ diff --git a/nand_spl/board/freescale/mpc8315erdb/Makefile b/nand_spl/board/freescale/mpc8315erdb/Makefile index a685674..f41a13a 100644 --- a/nand_spl/board/freescale/mpc8315erdb/Makefile +++ b/nand_spl/board/freescale/mpc8315erdb/Makefile @@ -29,10 +29,10 @@ targets += $(__OBJS) all: $(nandobj)u-boot-spl.bin $(nandobj)u-boot-spl-16k.bin
$(nandobj)u-boot-spl-16k.bin: $(nandobj)u-boot-spl - $(OBJCOPY) ${OBJCFLAGS} --pad-to=$(PAD_TO) -O binary $< $@ + $(OBJCOPY) $(OBJCOPYFLAGS) --pad-to=$(PAD_TO) -O binary $< $@
$(nandobj)u-boot-spl.bin: $(nandobj)u-boot-spl - $(OBJCOPY) ${OBJCFLAGS} -O binary $< $@ + $(OBJCOPY) $(OBJCOPYFLAGS) -O binary $< $@
$(nandobj)u-boot-spl: $(OBJS) $(nandobj)u-boot.lds cd $(LNDIR) && $(LD) $(LDFLAGS) $(__OBJS) $(PLATFORM_LIBS) \ diff --git a/nand_spl/board/freescale/mpc8536ds/Makefile b/nand_spl/board/freescale/mpc8536ds/Makefile index f0beaed..f571862 100644 --- a/nand_spl/board/freescale/mpc8536ds/Makefile +++ b/nand_spl/board/freescale/mpc8536ds/Makefile @@ -31,10 +31,10 @@ targets += $(__OBJS) all: $(nandobj)u-boot-spl.bin $(nandobj)u-boot-spl-16k.bin
$(nandobj)u-boot-spl-16k.bin: $(nandobj)u-boot-spl - $(OBJCOPY) ${OBJCFLAGS} --pad-to=$(PAD_TO) -O binary $< $@ + $(OBJCOPY) $(OBJCOPYFLAGS) --pad-to=$(PAD_TO) -O binary $< $@
$(nandobj)u-boot-spl.bin: $(nandobj)u-boot-spl - $(OBJCOPY) ${OBJCFLAGS} -O binary $< $@ + $(OBJCOPY) $(OBJCOPYFLAGS) -O binary $< $@
$(nandobj)u-boot-spl: $(OBJS) $(nandobj)u-boot-nand_spl.lds cd $(LNDIR) && $(LD) $(LDFLAGS) $(__OBJS) $(PLATFORM_LIBS) \ diff --git a/nand_spl/board/freescale/mpc8569mds/Makefile b/nand_spl/board/freescale/mpc8569mds/Makefile index f0beaed..f571862 100644 --- a/nand_spl/board/freescale/mpc8569mds/Makefile +++ b/nand_spl/board/freescale/mpc8569mds/Makefile @@ -31,10 +31,10 @@ targets += $(__OBJS) all: $(nandobj)u-boot-spl.bin $(nandobj)u-boot-spl-16k.bin
$(nandobj)u-boot-spl-16k.bin: $(nandobj)u-boot-spl - $(OBJCOPY) ${OBJCFLAGS} --pad-to=$(PAD_TO) -O binary $< $@ + $(OBJCOPY) $(OBJCOPYFLAGS) --pad-to=$(PAD_TO) -O binary $< $@
$(nandobj)u-boot-spl.bin: $(nandobj)u-boot-spl - $(OBJCOPY) ${OBJCFLAGS} -O binary $< $@ + $(OBJCOPY) $(OBJCOPYFLAGS) -O binary $< $@
$(nandobj)u-boot-spl: $(OBJS) $(nandobj)u-boot-nand_spl.lds cd $(LNDIR) && $(LD) $(LDFLAGS) $(__OBJS) $(PLATFORM_LIBS) \ diff --git a/nand_spl/board/freescale/mpc8572ds/Makefile b/nand_spl/board/freescale/mpc8572ds/Makefile index f0beaed..f571862 100644 --- a/nand_spl/board/freescale/mpc8572ds/Makefile +++ b/nand_spl/board/freescale/mpc8572ds/Makefile @@ -31,10 +31,10 @@ targets += $(__OBJS) all: $(nandobj)u-boot-spl.bin $(nandobj)u-boot-spl-16k.bin
$(nandobj)u-boot-spl-16k.bin: $(nandobj)u-boot-spl - $(OBJCOPY) ${OBJCFLAGS} --pad-to=$(PAD_TO) -O binary $< $@ + $(OBJCOPY) $(OBJCOPYFLAGS) --pad-to=$(PAD_TO) -O binary $< $@
$(nandobj)u-boot-spl.bin: $(nandobj)u-boot-spl - $(OBJCOPY) ${OBJCFLAGS} -O binary $< $@ + $(OBJCOPY) $(OBJCOPYFLAGS) -O binary $< $@
$(nandobj)u-boot-spl: $(OBJS) $(nandobj)u-boot-nand_spl.lds cd $(LNDIR) && $(LD) $(LDFLAGS) $(__OBJS) $(PLATFORM_LIBS) \ diff --git a/nand_spl/board/freescale/p1023rds/Makefile b/nand_spl/board/freescale/p1023rds/Makefile index 3918ac5..b7eedcd 100644 --- a/nand_spl/board/freescale/p1023rds/Makefile +++ b/nand_spl/board/freescale/p1023rds/Makefile @@ -27,10 +27,10 @@ targets += $(__OBJS) all: $(nandobj)u-boot-spl.bin $(nandobj)u-boot-spl-16k.bin
$(nandobj)u-boot-spl-16k.bin: $(nandobj)u-boot-spl - $(OBJCOPY) ${OBJCFLAGS} --pad-to=$(PAD_TO) -O binary $< $@ + $(OBJCOPY) $(OBJCOPYFLAGS) --pad-to=$(PAD_TO) -O binary $< $@
$(nandobj)u-boot-spl.bin: $(nandobj)u-boot-spl - $(OBJCOPY) ${OBJCFLAGS} -O binary $< $@ + $(OBJCOPY) $(OBJCOPYFLAGS) -O binary $< $@
$(nandobj)u-boot-spl: $(OBJS) $(nandobj)u-boot-nand_spl.lds cd $(LNDIR) && $(LD) $(LDFLAGS) $(__OBJS) $(PLATFORM_LIBS) \ diff --git a/nand_spl/board/freescale/p1_p2_rdb/Makefile b/nand_spl/board/freescale/p1_p2_rdb/Makefile index f0beaed..f571862 100644 --- a/nand_spl/board/freescale/p1_p2_rdb/Makefile +++ b/nand_spl/board/freescale/p1_p2_rdb/Makefile @@ -31,10 +31,10 @@ targets += $(__OBJS) all: $(nandobj)u-boot-spl.bin $(nandobj)u-boot-spl-16k.bin
$(nandobj)u-boot-spl-16k.bin: $(nandobj)u-boot-spl - $(OBJCOPY) ${OBJCFLAGS} --pad-to=$(PAD_TO) -O binary $< $@ + $(OBJCOPY) $(OBJCOPYFLAGS) --pad-to=$(PAD_TO) -O binary $< $@
$(nandobj)u-boot-spl.bin: $(nandobj)u-boot-spl - $(OBJCOPY) ${OBJCFLAGS} -O binary $< $@ + $(OBJCOPY) $(OBJCOPYFLAGS) -O binary $< $@
$(nandobj)u-boot-spl: $(OBJS) $(nandobj)u-boot-nand_spl.lds cd $(LNDIR) && $(LD) $(LDFLAGS) $(__OBJS) $(PLATFORM_LIBS) \ diff --git a/nand_spl/board/sheldon/simpc8313/Makefile b/nand_spl/board/sheldon/simpc8313/Makefile index 35b1f97..32afc27 100644 --- a/nand_spl/board/sheldon/simpc8313/Makefile +++ b/nand_spl/board/sheldon/simpc8313/Makefile @@ -28,10 +28,10 @@ targets += $(__OBJS) all: $(nandobj)u-boot-spl.bin $(nandobj)u-boot-spl-16k.bin
$(nandobj)u-boot-spl-16k.bin: $(nandobj)u-boot-spl - $(OBJCOPY) ${OBJCFLAGS} --pad-to=$(PAD_TO) -O binary $< $@ + $(OBJCOPY) $(OBJCOPYFLAGS) --pad-to=$(PAD_TO) -O binary $< $@
$(nandobj)u-boot-spl.bin: $(nandobj)u-boot-spl - $(OBJCOPY) ${OBJCFLAGS} -O binary $< $@ + $(OBJCOPY) $(OBJCOPYFLAGS) -O binary $< $@
$(nandobj)u-boot-spl: $(OBJS) $(nandobj)u-boot.lds cd $(LNDIR) && $(LD) $(LDFLAGS) $(__OBJS) $(PLATFORM_LIBS) \ diff --git a/spl/Makefile b/spl/Makefile index 2c69eee..3e63881 100644 --- a/spl/Makefile +++ b/spl/Makefile @@ -199,7 +199,7 @@ $(obj)/$(BOARD)-spl.bin: $(obj)/u-boot-spl.bin endif
$(obj)/$(SPL_BIN).bin: $(obj)/$(SPL_BIN) - $(OBJCOPY) $(OBJCFLAGS) $(SPL_OBJCFLAGS) -O binary $< $@ + $(OBJCOPY) $(OBJCOPYFLAGS) $(SPL_OBJCFLAGS) -O binary $< $@
LDFLAGS_$(SPL_BIN) += -T u-boot-spl.lds $(LDFLAGS_FINAL) ifneq ($(CONFIG_SPL_TEXT_BASE),)

Signed-off-by: Masahiro Yamada yamada.m@jp.panasonic.com ---
Makefile | 21 ++++++++------------- spl/Makefile | 4 ++-- 2 files changed, 10 insertions(+), 15 deletions(-)
diff --git a/Makefile b/Makefile index beca991..edb6868 100644 --- a/Makefile +++ b/Makefile @@ -791,7 +791,7 @@ u-boot.img: u-boot.bin -d $< $@
u-boot.imx: u-boot.bin - $(MAKE) $(build)=arch/arm/imx-common $(objtree)/u-boot.imx + $(Q)$(MAKE) $(build)=arch/arm/imx-common $(objtree)/$@
u-boot.kwb: u-boot.bin tools/mkimage -n $(CONFIG_SYS_KWD_CONFIG) -T kwbimage \ @@ -828,13 +828,8 @@ u-boot-with-spl.bin: spl/u-boot-spl.bin $(SPL_PAYLOAD) tpl/u-boot-with-tpl.bin: tpl/u-boot-tpl.bin u-boot.bin $(call SPL_PAD_APPEND,$<,u-boot.bin,tpl/u-boot-tpl-pad.bin,$(CONFIG_TPL_PAD_TO))
-u-boot-with-spl.imx: spl/u-boot-spl.bin u-boot.bin - $(MAKE) $(build)=arch/arm/imx-common \ - $(OBJTREE)/u-boot-with-spl.imx - -u-boot-with-nand-spl.imx: spl/u-boot-spl.bin u-boot.bin - $(MAKE) $(build)=arch/arm/imx-common \ - $(OBJTREE)/u-boot-with-nand-spl.imx +u-boot-with-spl.imx u-boot-with-nand-spl.imx: spl/u-boot-spl.bin u-boot.bin + $(Q)$(MAKE) $(build)=arch/arm/imx-common $(objtree)/$@
u-boot.ubl: u-boot-with-spl.bin tools/mkimage -n $(UBL_CONFIG) -T ublimage \ @@ -852,8 +847,8 @@ u-boot.ais: spl/u-boot-spl.bin u-boot.img cat spl/u-boot-spl-pad.ais u-boot.img > u-boot.ais
-u-boot.sb: u-boot.bin spl/u-boot-spl.bin - $(MAKE) $(build)=$(CPUDIR)/$(SOC)/ $(OBJTREE)/u-boot.sb +u-boot.sb: u-boot.bin spl/u-boot-spl.bin + $(Q)$(MAKE) $(build)=arch/arm/cpu/arm926ejs/mxs $(objtree)/u-boot.sb
# On x600 (SPEAr600) U-Boot is appended to U-Boot SPL. # Both images are created using mkimage (crc etc), so that the ROM @@ -1051,16 +1046,16 @@ u-boot.lds: $(LDSCRIPT) prepare $(CPP) $(cpp_flags) $(LDPPFLAGS) -ansi -D__ASSEMBLY__ -P - <$< >$@
nand_spl: prepare - $(MAKE) $(build)=nand_spl/board/$(BOARDDIR) all + $(Q)$(MAKE) $(build)=nand_spl/board/$(BOARDDIR) all
u-boot-nand.bin: nand_spl u-boot.bin cat nand_spl/u-boot-spl-16k.bin u-boot.bin > u-boot-nand.bin
spl/u-boot-spl.bin: tools prepare - $(MAKE) obj=spl -f $(srctree)/spl/Makefile all + $(Q)$(MAKE) obj=spl -f $(srctree)/spl/Makefile all
tpl/u-boot-tpl.bin: tools prepare - $(MAKE) obj=tpl -f $(srctree)/spl/Makefile all CONFIG_TPL_BUILD=y + $(Q)$(MAKE) obj=tpl -f $(srctree)/spl/Makefile all CONFIG_TPL_BUILD=y
TAG_SUBDIRS := $(u-boot-dirs) include
diff --git a/spl/Makefile b/spl/Makefile index 3e63881..10b77a5 100644 --- a/spl/Makefile +++ b/spl/Makefile @@ -175,8 +175,8 @@ $(OBJTREE)/MLO.byteswap: $(obj)/u-boot-spl.bin $(OBJTREE)/tools/mkimage -T omapimage -n byteswap \ -a $(CONFIG_SPL_TEXT_BASE) -d $< $@
-$(objtree)/SPL : $(obj)/u-boot-spl.bin - $(MAKE) $(build)=spl/arch/arm/imx-common $@ +$(objtree)/SPL: $(obj)/u-boot-spl.bin + $(Q)$(MAKE) $(build)=spl/arch/arm/imx-common $@
ALL-y += $(obj)/$(SPL_BIN).bin

On 7 February 2014 06:29, Masahiro Yamada yamada.m@jp.panasonic.com wrote:
Signed-off-by: Masahiro Yamada yamada.m@jp.panasonic.com
Acked-by: Simon Glass sjg@chromium.org

Signed-off-by: Masahiro Yamada yamada.m@jp.panasonic.com ---
Makefile | 41 +++++++++++++++++++++++++++++------------ examples/api/Makefile | 6 ++++-- examples/standalone/Makefile | 10 ++++++---- spl/Makefile | 19 +++++++++++++++++-- 4 files changed, 56 insertions(+), 20 deletions(-)
diff --git a/Makefile b/Makefile index edb6868..864cd70 100644 --- a/Makefile +++ b/Makefile @@ -744,6 +744,9 @@ ifneq ($(CONFIG_SYS_TEXT_BASE),) LDFLAGS_u-boot += -Ttext $(CONFIG_SYS_TEXT_BASE) endif
+quiet_cmd_objcopy = OBJCOPY $@ +cmd_objcopy = $(OBJCOPY) $(OBJCOPYFLAGS) $(OBJCOPYFLAGS_$(@F)) $< $@ + all: $(ALL-y)
PHONY += dtbs @@ -753,27 +756,31 @@ dtbs dts/dt.dtb: checkdtc u-boot u-boot-dtb.bin: u-boot.bin dts/dt.dtb cat $^ >$@
-u-boot.hex: u-boot - $(OBJCOPY) $(OBJCOPYFLAGS) -O ihex $< $@ +OBJCOPYFLAGS_u-boot.hex := -O ihex
-u-boot.srec: u-boot - $(OBJCOPY) $(OBJCOPYFLAGS) -O srec $< $@ +OBJCOPYFLAGS_u-boot.srec := -O srec
-u-boot.bin: u-boot - $(OBJCOPY) $(OBJCOPYFLAGS) -O binary $< $@ - $(call DO_STATIC_RELA,$<,$@,$(CONFIG_SYS_TEXT_BASE)) - $(BOARD_SIZE_CHECK) +u-boot.hex u-boot.srec: u-boot FORCE + $(call if_changed,objcopy) + +OBJCOPYFLAGS_u-boot.bin := -O binary + +u-boot.bin: u-boot FORCE + $(call if_changed,objcopy) + $(call DO_STATIC_RELA,$<,$@,$(CONFIG_SYS_TEXT_BASE)) + $(BOARD_SIZE_CHECK)
u-boot.ldr: u-boot $(CREATE_LDR_ENV) $(LDR) -T $(CONFIG_BFIN_CPU) -c $@ $< $(LDR_FLAGS) $(BOARD_SIZE_CHECK)
-u-boot.ldr.hex: u-boot.ldr - $(OBJCOPY) $(OBJCOPYFLAGS) -O ihex $< $@ -I binary +OBJCOPYFLAGS_u-boot.ldr.hex := -I binary -O ihex + +OBJCOPYFLAGS_u-boot.ldr.srec := -I binary -O srec
-u-boot.ldr.srec: u-boot.ldr - $(OBJCOPY) $(OBJCOPYFLAGS) -O srec $< $@ -I binary +u-boot.ldr.hex u-boot.ldr.srec: u-boot.ldr FORCE + $(call if_changed,objcopy)
# # U-Boot entry point, needed for booting of full-blown U-Boot @@ -1254,6 +1261,16 @@ quiet_cmd_rmdirs = $(if $(wildcard $(rm-dirs)),CLEAN $(wildcard $(rm-dirs))) quiet_cmd_rmfiles = $(if $(wildcard $(rm-files)),CLEAN $(wildcard $(rm-files))) cmd_rmfiles = rm -f $(rm-files)
+# read all saved command lines + +targets := $(wildcard $(sort $(targets))) +cmd_files := $(wildcard .*.cmd $(foreach f,$(targets),$(dir $(f)).$(notdir $(f)).cmd)) + +ifneq ($(cmd_files),) + $(cmd_files): ; # Do not try to update included dependency files + include $(cmd_files) +endif + # Shorthand for $(Q)$(MAKE) -f scripts/Makefile.clean obj=dir # Usage: # $(Q)$(MAKE) $(clean)=dir diff --git a/examples/api/Makefile b/examples/api/Makefile index 09475f8..6c19830 100644 --- a/examples/api/Makefile +++ b/examples/api/Makefile @@ -40,8 +40,10 @@ OBJS += $(addprefix $(obj)/,$(notdir $(EXT_SOBJ_FILES-y))) $(obj)/demo: $(OBJS) $(LD) --gc-sections -Ttext $(LOAD_ADDR) -o $@ $^ $(PLATFORM_LIBS)
-$(obj)/demo.bin: $(obj)/demo - $(OBJCOPY) -O binary $< $@ 2>/dev/null +# demo.bin is never genrated. Is this necessary? +OBJCOPYFLAGS_demo.bin := -O binary +$(obj)/demo.bin: $(obj)/demo FORCE + $(call if_changed,objcopy)
# Rule to build generic library C files $(addprefix $(obj)/,$(notdir $(EXT_COBJ_FILES-y))): $(obj)/%.o: $(SRCTREE)/lib/%.c FORCE diff --git a/examples/standalone/Makefile b/examples/standalone/Makefile index 47c9d54..5f61043 100644 --- a/examples/standalone/Makefile +++ b/examples/standalone/Makefile @@ -72,8 +72,10 @@ $(obj)/%: $(obj)/%.o $(LIB) -o $@ -e $(SYM_PREFIX)$(notdir $(<:.o=)) $< $(LIB) \ -L$(gcclibdir) -lgcc
-$(obj)/%.srec: $(obj)/% - $(OBJCOPY) -O srec $< $@ 2>/dev/null +$(obj)/%.srec: OBJCOPYFLAGS := -O srec +$(obj)/%.srec: $(obj)/% FORCE + $(call if_changed,objcopy)
-$(obj)/%.bin: $(obj)/% - $(OBJCOPY) -O binary $< $@ 2>/dev/null +$(obj)/%.bin: OBJCOPYFLAGS := -O binary +$(obj)/%.bin: $(obj)/% FORCE + $(call if_changed,objcopy) diff --git a/spl/Makefile b/spl/Makefile index 10b77a5..9c5bb53 100644 --- a/spl/Makefile +++ b/spl/Makefile @@ -198,8 +198,13 @@ $(obj)/$(BOARD)-spl.bin: $(obj)/u-boot-spl.bin $(OBJTREE)/tools/mkexynosspl) $(VAR_SIZE_PARAM) $< $@ endif
-$(obj)/$(SPL_BIN).bin: $(obj)/$(SPL_BIN) - $(OBJCOPY) $(OBJCOPYFLAGS) $(SPL_OBJCFLAGS) -O binary $< $@ +quiet_cmd_objcopy = OBJCOPY $@ +cmd_objcopy = $(OBJCOPY) $(OBJCOPYFLAGS) $(OBJCOPYFLAGS_$(@F)) $< $@ + +OBJCOPYFLAGS_$(SPL_BIN).bin = $(SPL_OBJCFLAGS) -O binary + +$(obj)/$(SPL_BIN).bin: $(obj)/$(SPL_BIN) FORCE + $(call if_changed,objcopy)
LDFLAGS_$(SPL_BIN) += -T u-boot-spl.lds $(LDFLAGS_FINAL) ifneq ($(CONFIG_SPL_TEXT_BASE),) @@ -227,6 +232,16 @@ cpp_flags := $(KBUILD_CPPFLAGS) $(CPPFLAGS) $(UBOOTINCLUDE) $(NOSTDINC_FLAGS) $(obj)/u-boot-spl.lds: $(LDSCRIPT) FORCE $(CPP) $(cpp_flags) $(LDPPFLAGS) -I$(obj). -ansi -D__ASSEMBLY__ -P - < $< > $@
+# read all saved command lines + +targets := $(wildcard $(sort $(targets))) +cmd_files := $(wildcard $(obj)/.*.cmd $(foreach f,$(targets),$(dir $(f)).$(notdir $(f)).cmd)) + +ifneq ($(cmd_files),) + $(cmd_files): ; # Do not try to update included dependency files + include $(cmd_files) +endif + PHONY += FORCE FORCE:

Signed-off-by: Masahiro Yamada yamada.m@jp.panasonic.com ---
Makefile | 38 +++++++++++++++++++------------------ arch/arm/cpu/armv7/am33xx/config.mk | 4 ++-- arch/arm/cpu/armv7/omap3/config.mk | 2 +- arch/arm/cpu/armv7/omap4/config.mk | 2 +- arch/arm/cpu/armv7/omap5/config.mk | 2 +- spl/Makefile | 15 +++++++++------ 6 files changed, 34 insertions(+), 29 deletions(-)
diff --git a/Makefile b/Makefile index 864cd70..d43d09b 100644 --- a/Makefile +++ b/Makefile @@ -747,6 +747,10 @@ endif quiet_cmd_objcopy = OBJCOPY $@ cmd_objcopy = $(OBJCOPY) $(OBJCOPYFLAGS) $(OBJCOPYFLAGS_$(@F)) $< $@
+quiet_cmd_mkimage = UIMAGE $@ +cmd_mkimage = $(objtree)/tools/mkimage $(MKIMAGEFLAGS_$(@F)) -d $< $@ \ + $(if $(KBUILD_VERBOSE:1=), >/dev/null) + all: $(ALL-y)
PHONY += dtbs @@ -790,24 +794,21 @@ ifndef CONFIG_SYS_UBOOT_START CONFIG_SYS_UBOOT_START := 0 endif
-u-boot.img: u-boot.bin - tools/mkimage -A $(ARCH) -T firmware -C none \ - -O u-boot -a $(CONFIG_SYS_TEXT_BASE) \ - -e $(CONFIG_SYS_UBOOT_START) \ - -n "U-Boot $(UBOOTRELEASE) for $(BOARD) board" \ - -d $< $@ +MKIMAGEFLAGS_u-boot.img = -A $(ARCH) -T firmware -C none -O u-boot \ + -a $(CONFIG_SYS_TEXT_BASE) -e $(CONFIG_SYS_UBOOT_START) \ + -n "U-Boot $(UBOOTRELEASE) for $(BOARD) board"
-u-boot.imx: u-boot.bin - $(Q)$(MAKE) $(build)=arch/arm/imx-common $(objtree)/$@ +MKIMAGEFLAGS_u-boot.kwb = -n $(CONFIG_SYS_KWD_CONFIG) -T kwbimage \ + -a $(CONFIG_SYS_TEXT_BASE) -e $(CONFIG_SYS_TEXT_BASE)
-u-boot.kwb: u-boot.bin - tools/mkimage -n $(CONFIG_SYS_KWD_CONFIG) -T kwbimage \ - -a $(CONFIG_SYS_TEXT_BASE) -e $(CONFIG_SYS_TEXT_BASE) -d $< $@ +MKIMAGEFLAGS_u-boot.pbl = -n $(CONFIG_SYS_FSL_PBL_RCW) \ + -R $(CONFIG_SYS_FSL_PBL_PBI) -T pblimage
-u-boot.pbl: u-boot.bin - tools/mkimage -n $(CONFIG_SYS_FSL_PBL_RCW) \ - -R $(CONFIG_SYS_FSL_PBL_PBI) -T pblimage \ - -d $< $@ +u-boot.img u-boot.kwb u-boot.pbl: u-boot.bin FORCE + $(call if_changed,mkimage) + +u-boot.imx: u-boot.bin + $(Q)$(MAKE) $(build)=arch/arm/imx-common $(objtree)/$@
u-boot.sha1: u-boot.bin tools/ubsha1 u-boot.bin @@ -838,9 +839,10 @@ tpl/u-boot-with-tpl.bin: tpl/u-boot-tpl.bin u-boot.bin u-boot-with-spl.imx u-boot-with-nand-spl.imx: spl/u-boot-spl.bin u-boot.bin $(Q)$(MAKE) $(build)=arch/arm/imx-common $(objtree)/$@
-u-boot.ubl: u-boot-with-spl.bin - tools/mkimage -n $(UBL_CONFIG) -T ublimage \ - -e $(CONFIG_SYS_TEXT_BASE) -d $< u-boot.ubl +MKIMAGEFLAGS_u-boot.ubl = -n $(UBL_CONFIG) -T ublimage -e $(CONFIG_SYS_TEXT_BASE) + +u-boot.ubl: u-boot-with-spl.bin FORCE + $(call if_changed,mkimage)
u-boot.ais: spl/u-boot-spl.bin u-boot.img tools/mkimage -s -n $(if $(CONFIG_AIS_CONFIG_FILE),$(srctree)/$(CONFIG_AIS_CONFIG_FILE:"%"=%),"/dev/null") \ diff --git a/arch/arm/cpu/armv7/am33xx/config.mk b/arch/arm/cpu/armv7/am33xx/config.mk index 1c06fb4..5294d16 100644 --- a/arch/arm/cpu/armv7/am33xx/config.mk +++ b/arch/arm/cpu/armv7/am33xx/config.mk @@ -4,8 +4,8 @@ # SPDX-License-Identifier: GPL-2.0+ # ifdef CONFIG_SPL_BUILD -ALL-y += $(OBJTREE)/MLO -ALL-$(CONFIG_SPL_SPI_SUPPORT) += $(OBJTREE)/MLO.byteswap +ALL-y += MLO +ALL-$(CONFIG_SPL_SPI_SUPPORT) += MLO.byteswap else ALL-y += u-boot.img endif diff --git a/arch/arm/cpu/armv7/omap3/config.mk b/arch/arm/cpu/armv7/omap3/config.mk index 2a3d1c5..ad44d63 100644 --- a/arch/arm/cpu/armv7/omap3/config.mk +++ b/arch/arm/cpu/armv7/omap3/config.mk @@ -9,7 +9,7 @@ # SPDX-License-Identifier: GPL-2.0+ # ifdef CONFIG_SPL_BUILD -ALL-y += $(OBJTREE)/MLO +ALL-y += MLO else ALL-y += u-boot.img endif diff --git a/arch/arm/cpu/armv7/omap4/config.mk b/arch/arm/cpu/armv7/omap4/config.mk index 2a3d1c5..ad44d63 100644 --- a/arch/arm/cpu/armv7/omap4/config.mk +++ b/arch/arm/cpu/armv7/omap4/config.mk @@ -9,7 +9,7 @@ # SPDX-License-Identifier: GPL-2.0+ # ifdef CONFIG_SPL_BUILD -ALL-y += $(OBJTREE)/MLO +ALL-y += MLO else ALL-y += u-boot.img endif diff --git a/arch/arm/cpu/armv7/omap5/config.mk b/arch/arm/cpu/armv7/omap5/config.mk index 261b272..ef2725a 100644 --- a/arch/arm/cpu/armv7/omap5/config.mk +++ b/arch/arm/cpu/armv7/omap5/config.mk @@ -7,7 +7,7 @@ #
ifdef CONFIG_SPL_BUILD -ALL-y += $(OBJTREE)/MLO +ALL-y += MLO else ALL-y += u-boot.img endif diff --git a/spl/Makefile b/spl/Makefile index 9c5bb53..43d053a 100644 --- a/spl/Makefile +++ b/spl/Makefile @@ -167,13 +167,16 @@ LDPPFLAGS += \ $(shell $(LD) --version | \ sed -ne 's/GNU ld version ([0-9][0-9]*).([0-9][0-9]*).*/-DLD_MAJOR=\1 -DLD_MINOR=\2/p')
-$(OBJTREE)/MLO: $(obj)/u-boot-spl.bin - $(OBJTREE)/tools/mkimage -T omapimage \ - -a $(CONFIG_SPL_TEXT_BASE) -d $< $@ +quiet_cmd_mkimage = UIMAGE $@ +cmd_mkimage = $(objtree)/tools/mkimage $(MKIMAGEFLAGS_$(@F)) -d $< $@ \ + $(if $(KBUILD_VERBOSE:1=), >/dev/null)
-$(OBJTREE)/MLO.byteswap: $(obj)/u-boot-spl.bin - $(OBJTREE)/tools/mkimage -T omapimage -n byteswap \ - -a $(CONFIG_SPL_TEXT_BASE) -d $< $@ +MKIMAGEFLAGS_MLO = -T omapimage -a $(CONFIG_SPL_TEXT_BASE) + +MKIMAGEFLAGS_MLO.byteswap = -T omapimage -n byteswap -a $(CONFIG_SPL_TEXT_BASE) + +MLO MLO.byteswap: $(obj)/u-boot-spl.bin + $(call if_changed,mkimage)
$(objtree)/SPL: $(obj)/u-boot-spl.bin $(Q)$(MAKE) $(build)=spl/arch/arm/imx-common $@

Signed-off-by: Masahiro Yamada yamada.m@jp.panasonic.com ---
Makefile | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-)
diff --git a/Makefile b/Makefile index d43d09b..80c0b1b 100644 --- a/Makefile +++ b/Makefile @@ -751,14 +751,17 @@ quiet_cmd_mkimage = UIMAGE $@ cmd_mkimage = $(objtree)/tools/mkimage $(MKIMAGEFLAGS_$(@F)) -d $< $@ \ $(if $(KBUILD_VERBOSE:1=), >/dev/null)
+quiet_cmd_cat = CAT $@ +cmd_cat = cat $(filter-out $(PHONY), $^) > $@ + all: $(ALL-y)
PHONY += dtbs dtbs dts/dt.dtb: checkdtc u-boot $(Q)$(MAKE) $(build)=dts dtbs
-u-boot-dtb.bin: u-boot.bin dts/dt.dtb - cat $^ >$@ +u-boot-dtb.bin: u-boot.bin dts/dt.dtb FORCE + $(call if_changed,cat)
OBJCOPYFLAGS_u-boot.hex := -O ihex
@@ -880,13 +883,13 @@ u-boot-nodtb-tegra.bin: spl/u-boot-spl.bin u-boot.bin rm spl/u-boot-spl-pad.bin
ifeq ($(CONFIG_OF_SEPARATE),y) -u-boot-dtb-tegra.bin: u-boot-nodtb-tegra.bin dts/dt.dtb - cat $^ > $@ +u-boot-dtb-tegra.bin: u-boot-nodtb-tegra.bin dts/dt.dtb FORCE + $(call if_changed,cat) endif endif
-u-boot-img.bin: spl/u-boot-spl.bin u-boot.img - cat spl/u-boot-spl.bin u-boot.img > $@ +u-boot-img.bin: spl/u-boot-spl.bin u-boot.img FORCE + $(call if_changed,cat)
# PPC4xx needs the SPL at the end of the image, since the reset vector # is located at 0xfffffffc. So we can't use the "u-boot-img.bin" target @@ -1054,11 +1057,15 @@ depend dep: u-boot.lds: $(LDSCRIPT) prepare $(CPP) $(cpp_flags) $(LDPPFLAGS) -ansi -D__ASSEMBLY__ -P - <$< >$@
+PHONY += nand_spl nand_spl: prepare $(Q)$(MAKE) $(build)=nand_spl/board/$(BOARDDIR) all
-u-boot-nand.bin: nand_spl u-boot.bin - cat nand_spl/u-boot-spl-16k.bin u-boot.bin > u-boot-nand.bin +nand_spl/u-boot-spl-16k.bin: nand_spl + @: + +u-boot-nand.bin: nand_spl/u-boot-spl-16k.bin u-boot.bin FORCE + $(call if_changed,cat)
spl/u-boot-spl.bin: tools prepare $(Q)$(MAKE) obj=spl -f $(srctree)/spl/Makefile all

Signed-off-by: Masahiro Yamada yamada.m@jp.panasonic.com ---
Makefile | 79 +++++++++++++++++++++++++++++++++------------------------------- 1 file changed, 41 insertions(+), 38 deletions(-)
diff --git a/Makefile b/Makefile index 80c0b1b..364b9be 100644 --- a/Makefile +++ b/Makefile @@ -754,6 +754,11 @@ cmd_mkimage = $(objtree)/tools/mkimage $(MKIMAGEFLAGS_$(@F)) -d $< $@ \ quiet_cmd_cat = CAT $@ cmd_cat = cat $(filter-out $(PHONY), $^) > $@
+append = cat $(filter-out $< $(PHONY), $^) >> $@ + +quiet_cmd_pad_cat = CAT $@ +cmd_pad_cat = $(cmd_objcopy) && $(append) || rm -f $@ + all: $(ALL-y)
PHONY += dtbs @@ -819,25 +824,21 @@ u-boot.sha1: u-boot.bin u-boot.dis: u-boot $(OBJDUMP) -d $< > $@
-# $@ is output, $(1) and $(2) are inputs, $(3) is padded intermediate, -# $(4) is pad-to -SPL_PAD_APPEND = \ - $(OBJCOPY) $(OBJCOPYFLAGS) --pad-to=$(4) -I binary -O binary \ - $(1) $(3); \ - cat $(3) $(2) > $@; \ - rm $(3) - ifdef CONFIG_TPL SPL_PAYLOAD := tpl/u-boot-with-tpl.bin else SPL_PAYLOAD := u-boot.bin endif
-u-boot-with-spl.bin: spl/u-boot-spl.bin $(SPL_PAYLOAD) - $(call SPL_PAD_APPEND,$<,$(SPL_PAYLOAD),spl/u-boot-spl-pad.bin,$(CONFIG_SPL_PAD_TO)) +OBJCOPYFLAGS_u-boot-with-spl.bin = -I binary -O binary \ + --pad-to=$(CONFIG_SPL_PAD_TO) +u-boot-with-spl.bin: spl/u-boot-spl.bin $(SPL_PAYLOAD) FORCE + $(call if_changed,pad_cat)
-tpl/u-boot-with-tpl.bin: tpl/u-boot-tpl.bin u-boot.bin - $(call SPL_PAD_APPEND,$<,u-boot.bin,tpl/u-boot-tpl-pad.bin,$(CONFIG_TPL_PAD_TO)) +OBJCOPYFLAGS_u-boot-with-tpl.bin = -I binary -O binary \ + --pad-to=$(CONFIG_TPL_PAD_TO) +tpl/u-boot-with-tpl.bin: tpl/u-boot-tpl.bin u-boot.bin FORCE + $(call if_changed,pad_cat)
u-boot-with-spl.imx u-boot-with-nand-spl.imx: spl/u-boot-spl.bin u-boot.bin $(Q)$(MAKE) $(build)=arch/arm/imx-common $(objtree)/$@ @@ -847,17 +848,15 @@ MKIMAGEFLAGS_u-boot.ubl = -n $(UBL_CONFIG) -T ublimage -e $(CONFIG_SYS_TEXT_BASE u-boot.ubl: u-boot-with-spl.bin FORCE $(call if_changed,mkimage)
-u-boot.ais: spl/u-boot-spl.bin u-boot.img - tools/mkimage -s -n $(if $(CONFIG_AIS_CONFIG_FILE),$(srctree)/$(CONFIG_AIS_CONFIG_FILE:"%"=%),"/dev/null") \ - -T aisimage \ - -e $(CONFIG_SPL_TEXT_BASE) \ - -d spl/u-boot-spl.bin \ - spl/u-boot-spl.ais - $(OBJCOPY) $(OBJCOPYFLAGS) -I binary \ - --pad-to=$(CONFIG_SPL_MAX_SIZE) -O binary \ - spl/u-boot-spl.ais spl/u-boot-spl-pad.ais - cat spl/u-boot-spl-pad.ais u-boot.img > u-boot.ais +MKIMAGEFLAGS_u-boot-spl.ais = -s -n $(if $(CONFIG_AIS_CONFIG_FILE), \ + $(srctree)/$(CONFIG_AIS_CONFIG_FILE:"%"=%),"/dev/null") \ + -T aisimage -e $(CONFIG_SPL_TEXT_BASE) +spl/u-boot-spl.ais: spl/u-boot-spl.bin FORCE + $(call if_changed,mkimage)
+OBJCOPYFLAGS_u-boot.ais = -I binary -O binary --pad-to=$(CONFIG_SPL_MAX_SIZE) +u-boot.ais: spl/u-boot-spl.ais u-boot.img FORCE + $(call if_changed,pad_cat)
u-boot.sb: u-boot.bin spl/u-boot-spl.bin $(Q)$(MAKE) $(build)=arch/arm/cpu/arm926ejs/mxs $(objtree)/u-boot.sb @@ -868,19 +867,20 @@ u-boot.sb: u-boot.bin spl/u-boot-spl.bin # SPL image (with mkimage header) and not the binary. Otherwise the resulting image # which is loaded/copied by the ROM bootloader to SRAM doesn't fit. # The resulting image containing both U-Boot images is called u-boot.spr -u-boot.spr: u-boot.img spl/u-boot-spl.bin - tools/mkimage -A $(ARCH) -T firmware -C none \ - -a $(CONFIG_SPL_TEXT_BASE) -e $(CONFIG_SPL_TEXT_BASE) -n XLOADER \ - -d spl/u-boot-spl.bin $@ - $(OBJCOPY) -I binary -O binary \ - --pad-to=$(CONFIG_SPL_PAD_TO) --gap-fill=0xff $@ - cat u-boot.img >> $@ +MKIMAGEFLAGS_u-boot-spl.img = -A $(ARCH) -T firmware -C none \ + -a $(CONFIG_SPL_TEXT_BASE) -e $(CONFIG_SPL_TEXT_BASE) -n XLOADER +spl/u-boot-spl.img: spl/u-boot-spl.bin FORCE + $(call if_changed,mkimage) + +OBJCOPYFLAGS_u-boot.spr = -I binary -O binary --pad-to=$(CONFIG_SPL_PAD_TO) \ + --gap-fill=0xff +u-boot.spr: spl/u-boot-spl.img u-boot.img FORCE + $(call if_changed,pad_cat)
ifneq ($(CONFIG_TEGRA),) -u-boot-nodtb-tegra.bin: spl/u-boot-spl.bin u-boot.bin - $(OBJCOPY) $(OBJCOPYFLAGS) --pad-to=$(CONFIG_SYS_TEXT_BASE) -O binary spl/u-boot-spl spl/u-boot-spl-pad.bin - cat spl/u-boot-spl-pad.bin u-boot.bin > $@ - rm spl/u-boot-spl-pad.bin +OBJCOPYFLAGS_u-boot-nodtb-tegra.bin = -O binary --pad-to=$(CONFIG_SYS_TEXT_BASE) +u-boot-nodtb-tegra.bin: spl/u-boot-spl u-boot.bin FORCE + $(call if_changed,pad_cat)
ifeq ($(CONFIG_OF_SEPARATE),y) u-boot-dtb-tegra.bin: u-boot-nodtb-tegra.bin dts/dt.dtb FORCE @@ -896,10 +896,11 @@ u-boot-img.bin: spl/u-boot-spl.bin u-boot.img FORCE # and need to introduce a new build target with the full blown U-Boot # at the start padded up to the start of the SPL image. And then concat # the SPL image to the end. -u-boot-img-spl-at-end.bin: spl/u-boot-spl.bin u-boot.img - $(OBJCOPY) -I binary -O binary --pad-to=$(CONFIG_UBOOT_PAD_TO) \ - --gap-fill=0xff u-boot.img $@ - cat spl/u-boot-spl.bin >> $@ + +OBJCOPYFLAGS_u-boot-img-spl-at-end.bin := -I binary -O binary \ + --pad-to=$(CONFIG_UBOOT_PAD_TO) --gap-fill=0xff +u-boot-img-spl-at-end.bin: u-boot.img spl/u-boot-spl.bin FORCE + $(call if_changed,pad_cat)
# Create a new ELF from a raw binary file. This is useful for arm64 # where static relocation needs to be performed on the raw binary, @@ -1067,7 +1068,9 @@ nand_spl/u-boot-spl-16k.bin: nand_spl u-boot-nand.bin: nand_spl/u-boot-spl-16k.bin u-boot.bin FORCE $(call if_changed,cat)
-spl/u-boot-spl.bin: tools prepare +spl/u-boot-spl.bin: spl/u-boot-spl + @: +spl/u-boot-spl: tools prepare $(Q)$(MAKE) obj=spl -f $(srctree)/spl/Makefile all
tpl/u-boot-tpl.bin: tools prepare

Move sandbox-specific link rule to arch/sandbox/config.mk.
Signed-off-by: Masahiro Yamada yamada.m@jp.panasonic.com ---
Makefile | 33 ++++++++++++++------------------- arch/sandbox/config.mk | 4 ++++ 2 files changed, 18 insertions(+), 19 deletions(-)
diff --git a/Makefile b/Makefile index 364b9be..c4706d6 100644 --- a/Makefile +++ b/Makefile @@ -739,7 +739,7 @@ endif endif endif
-LDFLAGS_u-boot += -T u-boot.lds $(LDFLAGS_FINAL) +LDFLAGS_u-boot += $(LDFLAGS_FINAL) ifneq ($(CONFIG_SYS_TEXT_BASE),) LDFLAGS_u-boot += -Ttext $(CONFIG_SYS_TEXT_BASE) endif @@ -914,27 +914,22 @@ u-boot.elf: u-boot.bin --defsym=_start=$(CONFIG_SYS_TEXT_BASE) \ -Ttext=$(CONFIG_SYS_TEXT_BASE)
-ifeq ($(CONFIG_SANDBOX),y) -GEN_UBOOT = \ - $(CC) $(SYMS) -T u-boot.lds \ - -Wl,--start-group $(u-boot-main) -Wl,--end-group \ - $(PLATFORM_LIBS) -Wl,-Map -Wl,u-boot.map -o u-boot -else -GEN_UBOOT = \ - $(LD) $(LDFLAGS) $(LDFLAGS_$(@F)) \ - $(u-boot-init) \ - --start-group $(u-boot-main) --end-group $(PLATFORM_LIBS) \ - -Map u-boot.map -o u-boot -endif +# Rule to link u-boot +# May be overridden by arch/$(ARCH)/config.mk +quiet_cmd_u-boot__ ?= LD $@ + cmd_u-boot__ ?= $(LD) $(LDFLAGS) $(LDFLAGS_u-boot) -o $@ \ + -T u-boot.lds $(u-boot-init) \ + --start-group $(u-boot-main) --end-group \ + $(PLATFORM_LIBS) -Map u-boot.map
u-boot: $(u-boot-init) $(u-boot-main) u-boot.lds - $(GEN_UBOOT) + $(call if_changed,u-boot__) ifeq ($(CONFIG_KALLSYMS),y) - smap=`$(call SYSTEM_MAP,u-boot) | \ - awk '$$2 ~ /[tTwW]/ {printf $$1 $$3 "\\000"}'` ; \ - $(CC) $(c_flags) -DSYSTEM_MAP=""$${smap}"" \ - -c $(srctree)/common/system_map.c -o common/system_map.o - $(GEN_UBOOT) common/system_map.o + smap=`$(call SYSTEM_MAP,u-boot) | \ + awk '$$2 ~ /[tTwW]/ {printf $$1 $$3 "\\000"}'` ; \ + $(CC) $(c_flags) -DSYSTEM_MAP=""$${smap}"" \ + -c $(srctree)/common/system_map.c -o common/system_map.o + $(call cmd,u-boot__) common/system_map.o endif
# The actual objects are generated when descending, diff --git a/arch/sandbox/config.mk b/arch/sandbox/config.mk index 6142dd4..23b057e 100644 --- a/arch/sandbox/config.mk +++ b/arch/sandbox/config.mk @@ -7,3 +7,7 @@ PLATFORM_LIBS += -lrt
# Support generic board on sandbox __HAVE_ARCH_GENERIC_BOARD := y + +cmd_u-boot__ = $(CC) -o $@ -T u-boot.lds \ + -Wl,--start-group $(u-boot-main) -Wl,--end-group \ + $(PLATFORM_LIBS) -Wl,-Map -Wl,u-boot.map

Signed-off-by: Masahiro Yamada yamada.m@jp.panasonic.com ---
Makefile | 7 +++++-- arch/blackfin/cpu/Makefile | 6 +++++- examples/api/Makefile | 40 +++++++++++++++++++++------------------- examples/standalone/Makefile | 25 +++++++++++-------------- spl/Makefile | 6 +++++- 5 files changed, 47 insertions(+), 37 deletions(-)
diff --git a/Makefile b/Makefile index c4706d6..907b013 100644 --- a/Makefile +++ b/Makefile @@ -1049,9 +1049,12 @@ depend dep: @echo '*** Warning: make $@ is unnecessary now.'
# --------------------------------------------------------------------------- +quiet_cmd_cpp_lds = LDS $@ +cmd_cpp_lds = $(CPP) $(cpp_flags) $(LDPPFLAGS) -ansi -D__ASSEMBLY__ \ + -x assembler-with-cpp -P -o $@ $<
-u-boot.lds: $(LDSCRIPT) prepare - $(CPP) $(cpp_flags) $(LDPPFLAGS) -ansi -D__ASSEMBLY__ -P - <$< >$@ +u-boot.lds: $(LDSCRIPT) prepare FORCE + $(call if_changed,cpp_lds)
PHONY += nand_spl nand_spl: prepare diff --git a/arch/blackfin/cpu/Makefile b/arch/blackfin/cpu/Makefile index 426292f..cfbcd31 100644 --- a/arch/blackfin/cpu/Makefile +++ b/arch/blackfin/cpu/Makefile @@ -37,5 +37,9 @@ ifneq ($(CONFIG_BFIN_BOOT_MODE),BFIN_BOOT_BYPASS) endif
CPPFLAGS_init.lds := -ansi + +quiet_cmd_link_init = LD $@ + cmd_link_init = $(LD) $(LDFLAGS) -T $^ -o $@ $(obj)/init.elf: $(obj)/init.lds $(obj)/init.o $(obj)/initcode.o - $(LD) $(LDFLAGS) -T $^ -o $@ + $(call if_changed,link_init) +targets += init.lds init.o diff --git a/examples/api/Makefile b/examples/api/Makefile index 6c19830..6cf23d1 100644 --- a/examples/api/Makefile +++ b/examples/api/Makefile @@ -15,30 +15,32 @@ endif extra-y = demo
# Source files located in the examples/api directory -SOBJ_FILES-y += crt0.o -COBJ_FILES-y += demo.o -COBJ_FILES-y += glue.o -COBJ_FILES-y += libgenwrap.o +OBJ-y += crt0.o +OBJ-y += demo.o +OBJ-y += glue.o +OBJ-y += libgenwrap.o
# Source files which exist outside the examples/api directory -EXT_COBJ_FILES-y += lib/crc32.o -EXT_COBJ_FILES-y += lib/ctype.o -EXT_COBJ_FILES-y += lib/div64.o -EXT_COBJ_FILES-y += lib/string.o -EXT_COBJ_FILES-y += lib/time.o -EXT_COBJ_FILES-y += lib/vsprintf.o -EXT_SOBJ_FILES-$(CONFIG_PPC) += arch/powerpc/lib/ppcstring.o +EXT_COBJ-y += lib/crc32.o +EXT_COBJ-y += lib/ctype.o +EXT_COBJ-y += lib/div64.o +EXT_COBJ-y += lib/string.o +EXT_COBJ-y += lib/time.o +EXT_COBJ-y += lib/vsprintf.o +EXT_SOBJ-$(CONFIG_PPC) += arch/powerpc/lib/ppcstring.o
# Create a list of object files to be compiled -OBJS += $(addprefix $(obj)/,$(SOBJ_FILES-y)) -OBJS += $(addprefix $(obj)/,$(COBJ_FILES-y)) -OBJS += $(addprefix $(obj)/,$(notdir $(EXT_COBJ_FILES-y))) -OBJS += $(addprefix $(obj)/,$(notdir $(EXT_SOBJ_FILES-y))) +OBJS := $(OBJ-y) $(notdir $(EXT_COBJ-y) $(EXT_SOBJ-y)) +targets += $(OBJS) +OBJS := $(addprefix $(obj)/,$(OBJS))
#########################################################################
-$(obj)/demo: $(OBJS) - $(LD) --gc-sections -Ttext $(LOAD_ADDR) -o $@ $^ $(PLATFORM_LIBS) +quiet_cmd_link_demo = LD $@ +cmd_link_demo = $(LD) --gc-sections -Ttext $(LOAD_ADDR) -o $@ $(filter-out $(PHONY), $^) $(PLATFORM_LIBS) + +$(obj)/demo: $(OBJS) FORCE + $(call if_changed,link_demo)
# demo.bin is never genrated. Is this necessary? OBJCOPYFLAGS_demo.bin := -O binary @@ -46,10 +48,10 @@ $(obj)/demo.bin: $(obj)/demo FORCE $(call if_changed,objcopy)
# Rule to build generic library C files -$(addprefix $(obj)/,$(notdir $(EXT_COBJ_FILES-y))): $(obj)/%.o: $(SRCTREE)/lib/%.c FORCE +$(addprefix $(obj)/,$(notdir $(EXT_COBJ-y))): $(obj)/%.o: lib/%.c FORCE $(call cmd,force_checksrc) $(call if_changed_rule,cc_o_c)
# Rule to build architecture-specific library assembly files -$(addprefix $(obj)/,$(notdir $(EXT_SOBJ_FILES-y))): $(obj)/%.o: $(SRCTREE)/arch/$(ARCH)/lib/%.S +$(addprefix $(obj)/,$(notdir $(EXT_SOBJ-y))): $(obj)/%.o: arch/powerpc/lib/%.S FORCE $(call if_changed_dep,as_o_S) diff --git a/examples/standalone/Makefile b/examples/standalone/Makefile index 5f61043..5b227cd 100644 --- a/examples/standalone/Makefile +++ b/examples/standalone/Makefile @@ -24,22 +24,18 @@ ELF := $(strip $(extra-y)) extra-y += $(addsuffix .srec,$(extra-y)) $(addsuffix .bin,$(extra-y)) clean-files := $(extra-) $(addsuffix .srec,$(extra-)) $(addsuffix .bin,$(extra-))
- COBJS := $(ELF:=.o)
LIB = $(obj)/libstubs.o
-LIBAOBJS-$(CONFIG_PPC) += ppc_longjmp.o ppc_setjmp.o -LIBAOBJS-$(CONFIG_8xx) += test_burst_lib.o -LIBAOBJS := $(LIBAOBJS-y) - -LIBCOBJS = stubs.o +LIBOBJS-$(CONFIG_PPC) += ppc_longjmp.o ppc_setjmp.o +LIBOBJS-$(CONFIG_8xx) += test_burst_lib.o +LIBOBJS-y += stubs.o
.SECONDARY: $(call objectify,$(COBJS)) -targets += $(patsubst $(obj)/%,%,$(LIB)) $(COBJS) $(LIBAOBJS) $(LIBCOBJS) - -LIBOBJS = $(addprefix $(obj)/,$(LIBAOBJS) $(LIBCOBJS)) +targets += $(patsubst $(obj)/%,%,$(LIB)) $(COBJS) $(LIBOBJS-y)
+LIBOBJS := $(addprefix $(obj)/,$(LIBOBJS-y)) ELF := $(addprefix $(obj)/,$(ELF))
gcclibdir := $(shell dirname `$(CC) -print-libgcc-file-name`) @@ -66,11 +62,12 @@ quiet_cmd_link_lib = LD $@ $(LIB): $(LIBOBJS) FORCE $(call if_changed,link_lib)
-$(ELF): -$(obj)/%: $(obj)/%.o $(LIB) - $(LD) $(LDFLAGS) -g -Ttext $(CONFIG_STANDALONE_LOAD_ADDR) \ - -o $@ -e $(SYM_PREFIX)$(notdir $(<:.o=)) $< $(LIB) \ - -L$(gcclibdir) -lgcc +quiet_cmd_link_elf = LD $@ + cmd_link_elf = $(LD) $(LDFLAGS) -g -Ttext $(CONFIG_STANDALONE_LOAD_ADDR) \ + -o $@ -e $(SYM_PREFIX)$(@F) $< $(LIB) -L$(gcclibdir) -lgcc + +$(ELF): $(obj)/%: $(obj)/%.o $(LIB) FORCE + $(call if_changed,link_elf)
$(obj)/%.srec: OBJCOPYFLAGS := -O srec $(obj)/%.srec: $(obj)/% FORCE diff --git a/spl/Makefile b/spl/Makefile index 43d053a..22d6323 100644 --- a/spl/Makefile +++ b/spl/Makefile @@ -232,8 +232,12 @@ $(u-boot-spl-dirs): # FIX ME cpp_flags := $(KBUILD_CPPFLAGS) $(CPPFLAGS) $(UBOOTINCLUDE) $(NOSTDINC_FLAGS)
+quiet_cmd_cpp_lds = LDS $@ +cmd_cpp_lds = $(CPP) $(cpp_flags) $(LDPPFLAGS) -ansi -D__ASSEMBLY__ \ + -x assembler-with-cpp -P -o $@ $< + $(obj)/u-boot-spl.lds: $(LDSCRIPT) FORCE - $(CPP) $(cpp_flags) $(LDPPFLAGS) -I$(obj). -ansi -D__ASSEMBLY__ -P - < $< > $@ + $(call if_changed,cpp_lds)
# read all saved command lines

Signed-off-by: Masahiro Yamada yamada.m@jp.panasonic.com ---
Makefile | 4 +- arch/arm/cpu/arm1136/config.mk | 2 +- arch/arm/cpu/arm926ejs/config.mk | 2 +- arch/arm/cpu/armv7/config.mk | 2 +- arch/arm/imx-common/Makefile | 85 ++++++++++++++++++++++++---------------- spl/Makefile | 4 +- 6 files changed, 58 insertions(+), 41 deletions(-)
diff --git a/Makefile b/Makefile index 907b013..5acf538 100644 --- a/Makefile +++ b/Makefile @@ -816,7 +816,7 @@ u-boot.img u-boot.kwb u-boot.pbl: u-boot.bin FORCE $(call if_changed,mkimage)
u-boot.imx: u-boot.bin - $(Q)$(MAKE) $(build)=arch/arm/imx-common $(objtree)/$@ + $(Q)$(MAKE) $(build)=arch/arm/imx-common $@
u-boot.sha1: u-boot.bin tools/ubsha1 u-boot.bin @@ -841,7 +841,7 @@ tpl/u-boot-with-tpl.bin: tpl/u-boot-tpl.bin u-boot.bin FORCE $(call if_changed,pad_cat)
u-boot-with-spl.imx u-boot-with-nand-spl.imx: spl/u-boot-spl.bin u-boot.bin - $(Q)$(MAKE) $(build)=arch/arm/imx-common $(objtree)/$@ + $(Q)$(MAKE) $(build)=arch/arm/imx-common $@
MKIMAGEFLAGS_u-boot.ubl = -n $(UBL_CONFIG) -T ublimage -e $(CONFIG_SYS_TEXT_BASE)
diff --git a/arch/arm/cpu/arm1136/config.mk b/arch/arm/cpu/arm1136/config.mk index ab1fc4a..91b0ef3 100644 --- a/arch/arm/cpu/arm1136/config.mk +++ b/arch/arm/cpu/arm1136/config.mk @@ -11,7 +11,7 @@ PLATFORM_CPPFLAGS += -march=armv5 ifneq ($(CONFIG_IMX_CONFIG),) ifdef CONFIG_SPL ifdef CONFIG_SPL_BUILD -ALL-y += $(OBJTREE)/SPL +ALL-y += SPL endif else ALL-y += u-boot.imx diff --git a/arch/arm/cpu/arm926ejs/config.mk b/arch/arm/cpu/arm926ejs/config.mk index f27ca15..918cdec 100644 --- a/arch/arm/cpu/arm926ejs/config.mk +++ b/arch/arm/cpu/arm926ejs/config.mk @@ -10,7 +10,7 @@ PLATFORM_CPPFLAGS += -march=armv5te ifneq ($(CONFIG_IMX_CONFIG),) ifdef CONFIG_SPL ifdef CONFIG_SPL_BUILD -ALL-y += $(OBJTREE)/SPL +ALL-y += SPL endif else ALL-y += u-boot.imx diff --git a/arch/arm/cpu/armv7/config.mk b/arch/arm/cpu/armv7/config.mk index d01f3d9..852f83c 100644 --- a/arch/arm/cpu/armv7/config.mk +++ b/arch/arm/cpu/armv7/config.mk @@ -17,7 +17,7 @@ PLATFORM_NO_UNALIGNED := $(PF_NO_UNALIGNED) ifneq ($(CONFIG_IMX_CONFIG),) ifdef CONFIG_SPL ifdef CONFIG_SPL_BUILD -ALL-y += $(OBJTREE)/SPL +ALL-y += SPL endif else ALL-y += u-boot.imx diff --git a/arch/arm/imx-common/Makefile b/arch/arm/imx-common/Makefile index 88d6c0b..16809fe 100644 --- a/arch/arm/imx-common/Makefile +++ b/arch/arm/imx-common/Makefile @@ -23,37 +23,54 @@ endif obj-$(CONFIG_CMD_BMODE) += cmd_bmode.o obj-$(CONFIG_CMD_HDMIDETECT) += cmd_hdmidet.o
-$(OBJTREE)/$(patsubst "%",%,$(CONFIG_IMX_CONFIG)).cfgtmp: $(OBJTREE)/%.cfgtmp : $(SRCTREE)/% - mkdir -p $(dir $@) - $(CPP) $(cpp_flags) -x c -o $@ $< - -$(OBJTREE)/u-boot.imx: $(OBJTREE)/u-boot.bin $(OBJTREE)/$(patsubst "%",%,$(CONFIG_IMX_CONFIG)).cfgtmp - $(OBJTREE)/tools/mkimage -n $(filter-out %.bin,$^) -T imximage \ - -e $(CONFIG_SYS_TEXT_BASE) -d $< $@ - -$(OBJTREE)/SPL: $(OBJTREE)/spl/u-boot-spl.bin $(OBJTREE)/$(patsubst "%",%,$(CONFIG_IMX_CONFIG)).cfgtmp - $(OBJTREE)/tools/mkimage -n $(filter-out %.bin,$^) -T imximage \ - -e $(CONFIG_SPL_TEXT_BASE) -d $< $@ - -$(OBJTREE)/u-boot-with-spl.imx: $(OBJTREE)/SPL $(OBJTREE)/u-boot.bin - $(OBJCOPY) $(OBJCOPYFLAGS) --pad-to=$(CONFIG_SPL_PAD_TO) \ - -I binary -O binary $< $(OBJTREE)/spl/u-boot-spl-pad.imx - $(OBJTREE)/tools/mkimage -A arm -O U-Boot -a $(CONFIG_SYS_TEXT_BASE) \ - -e $(CONFIG_SYS_TEXT_BASE) -C none -d $(OBJTREE)/u-boot.bin \ - $(OBJTREE)/u-boot.uim - cat $(OBJTREE)/spl/u-boot-spl-pad.imx $(OBJTREE)/u-boot.uim > $@ - rm $(OBJTREE)/spl/u-boot-spl-pad.imx $(OBJTREE)/u-boot.uim - -$(OBJTREE)/u-boot-with-nand-spl.imx: $(OBJTREE)/SPL $(OBJTREE)/u-boot.bin - (echo -ne '\x00\x00\x00\x00\x46\x43\x42\x20\x01' && \ - dd bs=1015 count=1 if=/dev/zero 2>/dev/null) | \ - cat - $< > $(OBJTREE)/spl/u-boot-nand-spl.imx - $(OBJCOPY) $(OBJCOPYFLAGS) --pad-to=$(CONFIG_SPL_PAD_TO) \ - -I binary -O binary $(OBJTREE)/spl/u-boot-nand-spl.imx \ - $(OBJTREE)/spl/u-boot-nand-spl-pad.imx - rm $(OBJTREE)/spl/u-boot-nand-spl.imx - $(OBJTREE)/tools/mkimage -A arm -O U-Boot -a $(CONFIG_SYS_TEXT_BASE) \ - -e $(CONFIG_SYS_TEXT_BASE) -C none -d $(OBJTREE)/u-boot.bin \ - $(OBJTREE)/u-boot.uim - cat $(OBJTREE)/spl/u-boot-nand-spl-pad.imx $(OBJTREE)/u-boot.uim > $@ - rm $(OBJTREE)/spl/u-boot-nand-spl-pad.imx $(OBJTREE)/u-boot.uim +quiet_cmd_cpp_cfg = CFGS $@ + cmd_cpp_cfg = $(CPP) $(cpp_flags) -x c -o $@ $< + +IMX_CONFIG = $(CONFIG_IMX_CONFIG:"%"=%).cfgtmp + +$(IMX_CONFIG): %.cfgtmp: % FORCE + $(Q)mkdir -p $(dir $@) + $(call if_changed_dep,cpp_cfg) + +quiet_cmd_mkimage = UIMAGE $@ +cmd_mkimage = $(objtree)/tools/mkimage $(MKIMAGEFLAGS_$(@F)) -d $< $@ \ + $(if $(KBUILD_VERBOSE:1=), >/dev/null) + +MKIMAGEFLAGS_u-boot.imx = -n $(filter-out $< $(PHONY),$^) -T imximage \ + -e $(CONFIG_SYS_TEXT_BASE) + +u-boot.imx: u-boot.bin $(IMX_CONFIG) FORCE + $(call if_changed,mkimage) + +MKIMAGEFLAGS_SPL = -n $(filter-out $< $(PHONY),$^) -T imximage \ + -e $(CONFIG_SPL_TEXT_BASE) + +SPL: spl/u-boot-spl.bin $(IMX_CONFIG) FORCE + $(call if_changed,mkimage) + +MKIMAGEFLAGS_u-boot.uim = -A arm -O U-Boot -a $(CONFIG_SYS_TEXT_BASE) \ + -e $(CONFIG_SYS_TEXT_BASE) -C none + +u-boot.uim: u-boot.bin FORCE + $(call if_changed,mkimage) + +OBJCOPYFLAGS += -I binary -O binary --pad-to=$(CONFIG_SPL_PAD_TO) +append = cat $(filter-out $< $(PHONY), $^) >> $@ + +quiet_cmd_pad_cat = CAT $@ +cmd_pad_cat = $(cmd_objcopy) && $(append) || rm -f $@ + +u-boot-with-spl.imx: SPL u-boot.uim FORCE + $(call if_changed,pad_cat) + +u-boot-with-nand-spl.imx: spl/u-boot-nand-spl.imx u-boot.uim FORCE + $(call if_changed,pad_cat) + +quiet_cmd_u-boot-nand-spl_imx = GEN $@ +cmd_u-boot-nand-spl_imx = (echo -ne '\x00\x00\x00\x00\x46\x43\x42\x20\x01' && \ + dd bs=1015 count=1 if=/dev/zero 2>/dev/null) | cat - $< > $@ + +spl/u-boot-nand-spl.imx: SPL FORCE + $(call if_changed,u-boot-nand-spl_imx) + +targets += $(addprefix ../../../,$(IMX_CONFIG) SPL u-boot.uim spl/u-boot-nand-spl.imx) diff --git a/spl/Makefile b/spl/Makefile index 22d6323..e8c5938 100644 --- a/spl/Makefile +++ b/spl/Makefile @@ -178,8 +178,8 @@ MKIMAGEFLAGS_MLO.byteswap = -T omapimage -n byteswap -a $(CONFIG_SPL_TEXT_BASE) MLO MLO.byteswap: $(obj)/u-boot-spl.bin $(call if_changed,mkimage)
-$(objtree)/SPL: $(obj)/u-boot-spl.bin - $(Q)$(MAKE) $(build)=spl/arch/arm/imx-common $@ +SPL: $(obj)/u-boot-spl.bin + $(Q)$(MAKE) $(build)=arch/arm/imx-common $@
ALL-y += $(obj)/$(SPL_BIN).bin

Hi Masahiro,
On 7 February 2014 05:29, Masahiro Yamada yamada.m@jp.panasonic.com wrote:
Signed-off-by: Masahiro Yamada yamada.m@jp.panasonic.com
Makefile | 4 +- arch/arm/cpu/arm1136/config.mk | 2 +- arch/arm/cpu/arm926ejs/config.mk | 2 +- arch/arm/cpu/armv7/config.mk | 2 +- arch/arm/imx-common/Makefile | 85 ++++++++++++++++++++++++---------------- spl/Makefile | 4 +- 6 files changed, 58 insertions(+), 41 deletions(-)
...
diff --git a/spl/Makefile b/spl/Makefile index 22d6323..e8c5938 100644 --- a/spl/Makefile +++ b/spl/Makefile @@ -178,8 +178,8 @@ MKIMAGEFLAGS_MLO.byteswap = -T omapimage -n byteswap -a $(CONFIG_SPL_TEXT_BASE) MLO MLO.byteswap: $(obj)/u-boot-spl.bin $(call if_changed,mkimage)
-$(objtree)/SPL: $(obj)/u-boot-spl.bin
$(Q)$(MAKE) $(build)=spl/arch/arm/imx-common $@
+SPL: $(obj)/u-boot-spl.bin
$(Q)$(MAKE) $(build)=arch/arm/imx-common $@
This series looks good to me, but I would like to understand what is happening here. Are you changing it to pick up the source from the real arch/ directory instead of the spl copy?
ALL-y += $(obj)/$(SPL_BIN).bin
-- 1.8.3.2
Regards, Simon

Hello Simon,
Thanks for your close review. This is always appreciated.
diff --git a/spl/Makefile b/spl/Makefile index 22d6323..e8c5938 100644 --- a/spl/Makefile +++ b/spl/Makefile @@ -178,8 +178,8 @@ MKIMAGEFLAGS_MLO.byteswap = -T omapimage -n byteswap -a $(CONFIG_SPL_TEXT_BASE) MLO MLO.byteswap: $(obj)/u-boot-spl.bin $(call if_changed,mkimage)
-$(objtree)/SPL: $(obj)/u-boot-spl.bin
$(Q)$(MAKE) $(build)=spl/arch/arm/imx-common $@
+SPL: $(obj)/u-boot-spl.bin
$(Q)$(MAKE) $(build)=arch/arm/imx-common $@
This series looks good to me, but I would like to understand what is happening here. Are you changing it to pick up the source from the real arch/ directory instead of the spl copy?
Two things are happening here: [1] drop $(objtree)/ [2] modify $(build)=spl/arch/arm/imx-commot to $(build)=arch/arm/imx-common
Let me explain the reason of each one by one.
[1] $(objtree) ( and $(OBJTREE)) points to the absolute path of the working directory.
I want short log should be like: UIMAGE SPL rather than UIMAGE /home/yamada/workspace/SPL
That's why I dropped $(objtree)/ and $(OBJTREE)/ prefixes from all IMX related images.
[2] I guess it's difficult to understand what's happening here. I hope the following explanation will be clear for you..
At this commit, Both ./Makefile and spl/Makefile descend into arch/arm/imx-common.
From the ./Makefile, here
u-boot.imx: u-boot.bin $(Q)$(MAKE) $(build)=arch/arm/imx-common $@
u-boot-with-spl.imx u-boot-with-nand-spl.imx: spl/u-boot-spl.bin u-boot.bin $(Q)$(MAKE) $(build)=arch/arm/imx-common $@
And from spl/Makefile, here
SPL: $(obj)/u-boot-spl.bin $(Q)$(MAKE) $(build)=arch/arm/imx-common $@
I needed to specify "$(build)=arch/arm/imx-common" consistenty to include ".*.cmd" files correctly.
I added targets += $(addprefix ../../../,$(IMX_CONFIG) SPL u-boot.uim spl/u-boot-nand-spl.imx) at the end of arch/arm/imx-common/Makefile. (It may look weird. )
And it is prefixed (obj)/ at scripts/Makefile.lib line 76 targets := $(addprefix $(obj)/,$(targets))
If I had not changed "$(build)=spl/arm/arm/imx-common", $(targets) would have pointed to "spl/arch/arm/imx-common/../../../SPL), that is, "spl/SPL". But .SPL.cmd is not in spl/ directory.
Anyway, it is really complicated to descend into arch/arm/imx-common from two Makefiles, ./Makefile and spl/Makefile.
So I moved the SPL rule from spl/Makefile to ./Makefile.
Best Regards Masahiro Yamada

Hi Masahiro,
On 23 February 2014 18:58, Masahiro Yamada yamada.m@jp.panasonic.com wrote:
Hello Simon,
Thanks for your close review. This is always appreciated.
diff --git a/spl/Makefile b/spl/Makefile index 22d6323..e8c5938 100644 --- a/spl/Makefile +++ b/spl/Makefile @@ -178,8 +178,8 @@ MKIMAGEFLAGS_MLO.byteswap = -T omapimage -n byteswap -a $(CONFIG_SPL_TEXT_BASE) MLO MLO.byteswap: $(obj)/u-boot-spl.bin $(call if_changed,mkimage)
-$(objtree)/SPL: $(obj)/u-boot-spl.bin
$(Q)$(MAKE) $(build)=spl/arch/arm/imx-common $@
+SPL: $(obj)/u-boot-spl.bin
$(Q)$(MAKE) $(build)=arch/arm/imx-common $@
This series looks good to me, but I would like to understand what is happening here. Are you changing it to pick up the source from the real arch/ directory instead of the spl copy?
Two things are happening here: [1] drop $(objtree)/ [2] modify $(build)=spl/arch/arm/imx-commot to $(build)=arch/arm/imx-common
Let me explain the reason of each one by one.
[1] $(objtree) ( and $(OBJTREE)) points to the absolute path of the working directory.
I want short log should be like: UIMAGE SPL rather than UIMAGE /home/yamada/workspace/SPL
That's why I dropped $(objtree)/ and $(OBJTREE)/ prefixes from all IMX related images.
[2] I guess it's difficult to understand what's happening here. I hope the following explanation will be clear for you..
At this commit, Both ./Makefile and spl/Makefile descend into arch/arm/imx-common.
From the ./Makefile, here
u-boot.imx: u-boot.bin $(Q)$(MAKE) $(build)=arch/arm/imx-common $@
u-boot-with-spl.imx u-boot-with-nand-spl.imx: spl/u-boot-spl.bin u-boot.bin $(Q)$(MAKE) $(build)=arch/arm/imx-common $@
And from spl/Makefile, here
SPL: $(obj)/u-boot-spl.bin $(Q)$(MAKE) $(build)=arch/arm/imx-common $@
I needed to specify "$(build)=arch/arm/imx-common" consistenty to include ".*.cmd" files correctly.
I added targets += $(addprefix ../../../,$(IMX_CONFIG) SPL u-boot.uim spl/u-boot-nand-spl.imx) at the end of arch/arm/imx-common/Makefile. (It may look weird. )
And it is prefixed (obj)/ at scripts/Makefile.lib line 76 targets := $(addprefix $(obj)/,$(targets))
If I had not changed "$(build)=spl/arm/arm/imx-common", $(targets) would have pointed to "spl/arch/arm/imx-common/../../../SPL), that is, "spl/SPL". But .SPL.cmd is not in spl/ directory.
Anyway, it is really complicated to descend into arch/arm/imx-common from two Makefiles, ./Makefile and spl/Makefile.
So I moved the SPL rule from spl/Makefile to ./Makefile.
Sorry I didn't reply earlier when I first read this, it looks good. Thanks for the detailed explanation.
Regards, Simon

This commit avoids generating ./SPL twice. - Fist time descending to spl/ - Second time as a prerequisite of u-boot-with-spl.imx, u-boot-with-nand-spl.imx.
Signed-off-by: Masahiro Yamada yamada.m@jp.panasonic.com ---
Makefile | 5 ++++- arch/arm/config.mk | 10 ++++++++++ arch/arm/cpu/arm1136/config.mk | 10 ---------- arch/arm/cpu/arm926ejs/config.mk | 10 ---------- arch/arm/cpu/armv7/config.mk | 10 ---------- spl/Makefile | 3 --- 6 files changed, 14 insertions(+), 34 deletions(-)
diff --git a/Makefile b/Makefile index 5acf538..ad9c315 100644 --- a/Makefile +++ b/Makefile @@ -840,7 +840,10 @@ OBJCOPYFLAGS_u-boot-with-tpl.bin = -I binary -O binary \ tpl/u-boot-with-tpl.bin: tpl/u-boot-tpl.bin u-boot.bin FORCE $(call if_changed,pad_cat)
-u-boot-with-spl.imx u-boot-with-nand-spl.imx: spl/u-boot-spl.bin u-boot.bin +SPL: spl/u-boot-spl.bin FORCE + $(Q)$(MAKE) $(build)=arch/arm/imx-common $@ + +u-boot-with-spl.imx u-boot-with-nand-spl.imx: SPL u-boot.bin FORCE $(Q)$(MAKE) $(build)=arch/arm/imx-common $@
MKIMAGEFLAGS_u-boot.ubl = -n $(UBL_CONFIG) -T ublimage -e $(CONFIG_SYS_TEXT_BASE) diff --git a/arch/arm/config.mk b/arch/arm/config.mk index 8a65c34..17b7408 100644 --- a/arch/arm/config.mk +++ b/arch/arm/config.mk @@ -112,3 +112,13 @@ OBJCOPYFLAGS += -j .text -j .rodata -j .data -j .u_boot_list -j .rela.dyn else OBJCOPYFLAGS += -j .text -j .rodata -j .hash -j .data -j .got.plt -j .u_boot_list -j .rel.dyn endif + +ifneq ($(CONFIG_IMX_CONFIG),) +ifdef CONFIG_SPL +ifndef CONFIG_SPL_BUILD +ALL-y += SPL +endif +else +ALL-y += u-boot.imx +endif +endif diff --git a/arch/arm/cpu/arm1136/config.mk b/arch/arm/cpu/arm1136/config.mk index 91b0ef3..a82c6ce 100644 --- a/arch/arm/cpu/arm1136/config.mk +++ b/arch/arm/cpu/arm1136/config.mk @@ -7,13 +7,3 @@
# Make ARMv5 to allow more compilers to work, even though its v6. PLATFORM_CPPFLAGS += -march=armv5 - -ifneq ($(CONFIG_IMX_CONFIG),) -ifdef CONFIG_SPL -ifdef CONFIG_SPL_BUILD -ALL-y += SPL -endif -else -ALL-y += u-boot.imx -endif -endif diff --git a/arch/arm/cpu/arm926ejs/config.mk b/arch/arm/cpu/arm926ejs/config.mk index 918cdec..bdb3da1 100644 --- a/arch/arm/cpu/arm926ejs/config.mk +++ b/arch/arm/cpu/arm926ejs/config.mk @@ -6,13 +6,3 @@ #
PLATFORM_CPPFLAGS += -march=armv5te - -ifneq ($(CONFIG_IMX_CONFIG),) -ifdef CONFIG_SPL -ifdef CONFIG_SPL_BUILD -ALL-y += SPL -endif -else -ALL-y += u-boot.imx -endif -endif diff --git a/arch/arm/cpu/armv7/config.mk b/arch/arm/cpu/armv7/config.mk index 852f83c..247b7a5 100644 --- a/arch/arm/cpu/armv7/config.mk +++ b/arch/arm/cpu/armv7/config.mk @@ -13,13 +13,3 @@ PLATFORM_CPPFLAGS += $(PF_CPPFLAGS_ARMV7) # SEE README.arm-unaligned-accesses PF_NO_UNALIGNED := $(call cc-option, -mno-unaligned-access,) PLATFORM_NO_UNALIGNED := $(PF_NO_UNALIGNED) - -ifneq ($(CONFIG_IMX_CONFIG),) -ifdef CONFIG_SPL -ifdef CONFIG_SPL_BUILD -ALL-y += SPL -endif -else -ALL-y += u-boot.imx -endif -endif diff --git a/spl/Makefile b/spl/Makefile index e8c5938..6e9a740 100644 --- a/spl/Makefile +++ b/spl/Makefile @@ -178,9 +178,6 @@ MKIMAGEFLAGS_MLO.byteswap = -T omapimage -n byteswap -a $(CONFIG_SPL_TEXT_BASE) MLO MLO.byteswap: $(obj)/u-boot-spl.bin $(call if_changed,mkimage)
-SPL: $(obj)/u-boot-spl.bin - $(Q)$(MAKE) $(build)=arch/arm/imx-common $@ - ALL-y += $(obj)/$(SPL_BIN).bin
ifdef CONFIG_SAMSUNG

Import build rules of single targets from Linux 3.13.
Signed-off-by: Masahiro Yamada yamada.m@jp.panasonic.com ---
Makefile | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+)
diff --git a/Makefile b/Makefile index ad9c315..be61a15 100644 --- a/Makefile +++ b/Makefile @@ -1268,6 +1268,58 @@ scripts: ; endif #ifeq ($(config-targets),1) endif #ifeq ($(mixed-targets),1)
+# Single targets +# --------------------------------------------------------------------------- +# Single targets are compatible with: +# - build with mixed source and output +# - build with separate output dir 'make O=...' +# - external modules +# +# target-dir => where to store outputfile +# build-dir => directory in kernel source tree to use + +ifeq ($(KBUILD_EXTMOD),) + build-dir = $(patsubst %/,%,$(dir $@)) + target-dir = $(dir $@) +else + zap-slash=$(filter-out .,$(patsubst %/,%,$(dir $@))) + build-dir = $(KBUILD_EXTMOD)$(if $(zap-slash),/$(zap-slash)) + target-dir = $(if $(KBUILD_EXTMOD),$(dir $<),$(dir $@)) +endif + +%.s: %.c prepare scripts FORCE + $(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@) +%.i: %.c prepare scripts FORCE + $(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@) +%.o: %.c prepare scripts FORCE + $(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@) +%.lst: %.c prepare scripts FORCE + $(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@) +%.s: %.S prepare scripts FORCE + $(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@) +%.o: %.S prepare scripts FORCE + $(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@) +%.symtypes: %.c prepare scripts FORCE + $(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@) + +# Modules +/: prepare scripts FORCE + $(cmd_crmodverdir) + $(Q)$(MAKE) KBUILD_MODULES=$(if $(CONFIG_MODULES),1) \ + $(build)=$(build-dir) +%/: prepare scripts FORCE + $(cmd_crmodverdir) + $(Q)$(MAKE) KBUILD_MODULES=$(if $(CONFIG_MODULES),1) \ + $(build)=$(build-dir) +%.ko: prepare scripts FORCE + $(cmd_crmodverdir) + $(Q)$(MAKE) KBUILD_MODULES=$(if $(CONFIG_MODULES),1) \ + $(build)=$(build-dir) $(@:.ko=.o) + $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modpost + +# FIXME Should go into a make.lib or something +# =========================================================================== + quiet_cmd_rmdirs = $(if $(wildcard $(rm-dirs)),CLEAN $(wildcard $(rm-dirs))) cmd_rmdirs = rm -rf $(rm-dirs)

"help" target has been copied from Linux 3.13 and adjusted for U-Boot. Unlike Linux, cleaning is done on 4 levels: clean, clobber, mrproper, distclean.
Signed-off-by: Masahiro Yamada yamada.m@jp.panasonic.com ---
Makefile | 65 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 58 insertions(+), 7 deletions(-)
diff --git a/Makefile b/Makefile index be61a15..2618026 100644 --- a/Makefile +++ b/Makefile @@ -415,7 +415,7 @@ timestamp_h := include/generated/timestamp_autogenerated.h
no-dot-config-targets := clean clobber mrproper distclean \ cscope TAGS %tags help %docs check% coccicheck \ - backup + ubootversion backup
config-targets := 0 mixed-targets := 0 @@ -1082,12 +1082,6 @@ TAG_SUBDIRS := $(u-boot-dirs) include FIND := find FINDFLAGS := -L
-PHONY += checkstack - -checkstack: - $(OBJDUMP) -d u-boot $$(find . -name u-boot-spl) | \ - $(PERL) $(src)/scripts/checkstack.pl $(ARCH) - tags ctags: ctags -w -o ctags `$(FIND) $(FINDFLAGS) $(TAG_SUBDIRS) \ -name '*.[chS]' -print` @@ -1253,6 +1247,51 @@ backup: F=`basename $(TOPDIR)` ; cd .. ; \ gtar --force-local -zcvf `LC_ALL=C date "+$$F-%Y-%m-%d-%T.tar.gz"` $$F
+help: + @echo 'Cleaning targets:' + @echo ' clean - Remove most generated files but keep the config and' + @echo ' necessities for testing u-boot' + @echo ' clobber - Remove most generated files but keep the config' + @echo ' mrproper - Remove all generated files + config + various backup files' + @echo ' distclean - mrproper + remove editor backup and patch files' + @echo '' +# uncomment after adding Kconfig feature +# @echo 'Configuration targets:' +# @$(MAKE) -f $(srctree)/scripts/kconfig/Makefile help +# @echo '' + @echo 'Other generic targets:' + @echo ' all - Build all necessary images depending on configuration' + @echo ' u-boot - Build the bare u-boot' + @echo ' dir/ - Build all files in dir and below' + @echo ' dir/file.[oisS] - Build specified target only' + @echo ' dir/file.lst - Build specified mixed source/assembly target only' + @echo ' (requires a recent binutils and recent build (System.map))' + @echo ' tags/TAGS - Generate tags file for editors' + @echo ' cscope - Generate cscope index' + @echo ' ubootrelease - Output the release version string' + @echo ' ubootversion - Output the version stored in Makefile' + @echo '' + @echo 'Static analysers' + @echo ' checkstack - Generate a list of stack hogs' + @echo '' + @echo 'Documentation targets:' + @$(MAKE) -f $(srctree)/doc/DocBook/Makefile dochelp + @echo '' + @echo ' make V=0|1 [targets] 0 => quiet build (default), 1 => verbose build' + @echo ' make V=2 [targets] 2 => give reason for rebuild of target' + @echo ' make O=dir [targets] Locate all output files in "dir", including .config' + @echo ' make C=1 [targets] Check all c source with $$CHECK (sparse by default)' + @echo ' make C=2 [targets] Force check of all c source with $$CHECK' + @echo ' make RECORDMCOUNT_WARN=1 [targets] Warn about ignored mcount sections' + @echo ' make W=n [targets] Enable extra gcc checks, n=1,2,3 where' + @echo ' 1: warnings which may be relevant and do not occur too often' + @echo ' 2: warnings which occur quite often but may still be relevant' + @echo ' 3: more obscure warnings, can most likely be ignored' + @echo ' Multiple levels can be combined with W=12 or W=123' + @echo '' + @echo 'Execute "make" or "make all" to build all targets marked with [*] ' + @echo 'For further info see the ./README file' +
# Documentation targets # --------------------------------------------------------------------------- @@ -1268,6 +1307,18 @@ scripts: ; endif #ifeq ($(config-targets),1) endif #ifeq ($(mixed-targets),1)
+PHONY += checkstack ubootrelease ubootversion + +checkstack: + $(OBJDUMP) -d u-boot $$(find . -name u-boot-spl) | \ + $(PERL) $(src)/scripts/checkstack.pl $(ARCH) + +ubootrelease: + @echo "$(UBOOTVERSION)$$($(CONFIG_SHELL) $(srctree)/scripts/setlocalversion $(srctree))" + +ubootversion: + @echo $(UBOOTVERSION) + # Single targets # --------------------------------------------------------------------------- # Single targets are compatible with:

Hi Masahiro,
On 7 February 2014 06:29, Masahiro Yamada yamada.m@jp.panasonic.com wrote:
Kbuild series must be applied before this series.
This series refactors a little, imports more Kbuild features and convert many rules to Kbuild style.
I think most of rules will be displayed in short log formats by applying this series. (But I know there are still some old style rules. I need more efforts...)
You are doing amazing efforts!
I don't seem to be able to apply this series on top of the kbuild one:
git am ~/Downloads/bundle-5618-masap.mbox Applying: kbuild: consolidate version and timestamp headers generation error: patch failed: Makefile:1128 error: Makefile: patch does not apply error: patch failed: doc/DocBook/Makefile:131 error: doc/DocBook/Makefile: patch does not apply error: scripts/kernel-doc: does not exist in index Patch failed at 0001 kbuild: consolidate version and timestamp headers generation The copy of the patch that failed is found in: /home/sjg/u/.git/rebase-apply/patch When you have resolved this problem, run "git am --continue". If you prefer to skip this patch, run "git am --skip" instead. To restore the original branch and stop patching, run "git am --abort".
Could you please push it somewhere?
Regards, Simon
Masahiro Yamada (15): kbuild: consolidate version and timestamp headers generation kbuild: abolish "depend" target kbuild: move asm-offsets.h rules to ./Kbuild kbuild: rename OBJCFLAGS to OBJCOPYFLAGS kbuild: Add $(Q) when descending into subdirectories kbuild: use shorten logs objcopy rules kbuild: use shorten logs for mkimage rules kbuild: use shorten logs for cat rules kbuild: use shorten logs for combined rules of mkimage, padding and cat kbuild: use shorten log for linking u-boot kbuild: use shorten logs for misc targets kbuild: use shorten logs for IMX images kbuild: refactor more IMX image rules kbuild: support building signle targets kbuild: add misc targets, help, ubootrelease, ubootversion
Kbuild | 87 +++++ Makefile | 482 ++++++++++++++++---------- arch/arm/config.mk | 14 +- arch/arm/cpu/arm1136/config.mk | 10 - arch/arm/cpu/arm926ejs/config.mk | 10 - arch/arm/cpu/armv7/am33xx/config.mk | 4 +- arch/arm/cpu/armv7/config.mk | 10 - arch/arm/cpu/armv7/omap3/config.mk | 2 +- arch/arm/cpu/armv7/omap4/config.mk | 2 +- arch/arm/cpu/armv7/omap5/config.mk | 2 +- arch/arm/cpu/pxa/config.mk | 2 +- arch/arm/imx-common/Makefile | 85 +++-- arch/blackfin/cpu/Makefile | 6 +- arch/mips/config.mk | 2 +- arch/sandbox/config.mk | 4 + board/hymod/config.mk | 2 +- config.mk | 2 +- doc/DocBook/Makefile | 2 +- examples/api/Makefile | 46 +-- examples/standalone/Makefile | 35 +- nand_spl/board/amcc/acadia/Makefile | 4 +- nand_spl/board/amcc/bamboo/Makefile | 4 +- nand_spl/board/amcc/canyonlands/Makefile | 4 +- nand_spl/board/amcc/kilauea/Makefile | 4 +- nand_spl/board/amcc/sequoia/Makefile | 4 +- nand_spl/board/freescale/mpc8315erdb/Makefile | 4 +- nand_spl/board/freescale/mpc8536ds/Makefile | 4 +- nand_spl/board/freescale/mpc8569mds/Makefile | 4 +- nand_spl/board/freescale/mpc8572ds/Makefile | 4 +- nand_spl/board/freescale/p1023rds/Makefile | 4 +- nand_spl/board/freescale/p1_p2_rdb/Makefile | 4 +- nand_spl/board/sheldon/simpc8313/Makefile | 4 +- scripts/kernel-doc | 4 +- spl/Makefile | 41 ++- tools/scripts/make-asm-offsets | 27 -- 35 files changed, 562 insertions(+), 367 deletions(-) create mode 100644 Kbuild delete mode 100755 tools/scripts/make-asm-offsets
-- 1.8.3.2

Hello Simon,
git am ~/Downloads/bundle-5618-masap.mbox Applying: kbuild: consolidate version and timestamp headers generation error: patch failed: Makefile:1128 error: Makefile: patch does not apply error: patch failed: doc/DocBook/Makefile:131 error: doc/DocBook/Makefile: patch does not apply error: scripts/kernel-doc: does not exist in index Patch failed at 0001 kbuild: consolidate version and timestamp headers generation The copy of the patch that failed is found in: /home/sjg/u/.git/rebase-apply/patch When you have resolved this problem, run "git am --continue". If you prefer to skip this patch, run "git am --skip" instead. To restore the original branch and stop patching, run "git am --abort".
Could you please push it somewhere?
Done.
Please try this:
git clone git://github.com/masahir0y/u-boot-kbuild.git cd u-boot-kbuild git checkout kbuild_follow_v1
Best Regards Masahiro Yamada

On Fri, Feb 07, 2014 at 10:29:25PM +0900, Masahiro Yamada wrote:
Kbuild series must be applied before this series.
This series refactors a little, imports more Kbuild features and convert many rules to Kbuild style.
I think most of rules will be displayed in short log formats by applying this series. (But I know there are still some old style rules. I need more efforts...)
Since I guess this doesn't quite apply right now, can we get a v2 easily and I'll pick it up? Thanks.

Hello Tom,
On Fri, 21 Feb 2014 08:09:18 -0500 Tom Rini trini@ti.com wrote:
On Fri, Feb 07, 2014 at 10:29:25PM +0900, Masahiro Yamada wrote:
Kbuild series must be applied before this series.
This series refactors a little, imports more Kbuild features and convert many rules to Kbuild style.
I think most of rules will be displayed in short log formats by applying this series. (But I know there are still some old style rules. I need more efforts...)
Since I guess this doesn't quite apply right now, can we get a v2 easily and I'll pick it up? Thanks.
Sure.
I have posted v2. It has been rebased on the current u-boot/master (commit 1674df6). There is no other update.
Best Regards Masahiro Yamada
participants (3)
-
Masahiro Yamada
-
Simon Glass
-
Tom Rini