Follow-up for Kbuild series: more misc targets and short logs
Subsystems (4)
v2 cover 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 format by applying this series.
(But I know there are still some old style rules. I need more efforts...)
Changes in v2:
- Rebase on commit 1674df60
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
Signature · 1 line
1.8.3.2
PATCH v2 1/15 kbuild: consolidate version and timestamp headers generation
- 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.
---
Changes in v2: None
Makefile | 83 +++++++++++++++++++++++++++++----------------------- doc/DocBook/Makefile | 2 +- scripts/kernel-doc | 4 +-- 3 files changed, 49 insertions(+), 40 deletions(-)
Makefile +46 -37
@@ -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 \ 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)
@@ -786,8 +786,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
@@ -943,13 +942,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.
@@ -962,7 +970,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 \
@@ -975,7 +983,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
@@ -986,6 +994,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) #
@@ -1009,16 +1038,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
@@ -1026,7 +1055,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
@@ -1127,27 +1156,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}" ; \ - ) > [email protected] - @( printf '#define CC_VERSION_STRING "%s"\n' \ - '$(shell $(CC) --version | head -n 1)' )>> [email protected] - @( printf '#define LD_VERSION_STRING "%s"\n' \ - '$(shell $(LD) -v | head -n 1)' )>> [email protected] - @cmp -s $@ [email protected] && rm -f [email protected] || mv -f [email protected] $@ - -$(TIMESTAMP_FILE): - @mkdir -p $(dir $(TIMESTAMP_FILE)) - @LC_ALL=C date +'#define U_BOOT_DATE "%b %d %C%y"' > [email protected] - @LC_ALL=C date +'#define U_BOOT_TIME "%T"' >> [email protected] - @cmp -s $@ [email protected] && rm -f [email protected] || mv -f [email protected] $@ - -env: depend scripts_basic +env: scripts_basic $(Q)$(MAKE) $(build)=tools/$@ tools-all: HOST_TOOLS_ALL=y
doc/DocBook/Makefile +1 -1
@@ -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 $@
scripts/kernel-doc +2 -2
@@ -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; }
Signature · 1 line
1.8.3.2
PATCH v2 2/15 kbuild: abolish "depend" target
In reply to Masahiro YamadaThis commit moves include/generated/{generic-asm-offsets.h, asm-offsets.h} from "depend" targets to "prepare" targets and deletes "depend" targets.
---
Changes in v2: None
Makefile | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-)
Makefile +15 -12
@@ -939,7 +939,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
@@ -988,7 +988,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..
@@ -1038,27 +1039,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
Signature · 1 line
1.8.3.2
PATCH v2 3/15 kbuild: move asm-offsets.h rules to ./Kbuild
In reply to Masahiro YamadaGenerate 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__.
---
Changes in v2: None
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
Kbuild new file +87 -0
@@ -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)
Makefile +2 -34
@@ -988,9 +988,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
@@ -1115,37 +1114,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
tools/scripts/make-asm-offsets deleted +0 -27
@@ -1,27 +0,0 @@ -#!/bin/sh - -# Adapted from Linux kernel's "Kbuild": -# commit 1cdf25d704f7951d02a04064c97db547d6021872 -# Author: Christoph Lameter <[email protected]> - -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
Signature · 1 line
1.8.3.2
PATCH v2 3/15 kbuild: move asm-offsets.h rules to ./Kbuild
Dear Masahiro,
Quoted 6 lines · In message <[email protected]> you…
Kbuild new file +5
-0+define cmd_generic-offsets + (set -e; \ + echo "#ifndef __GENERIC_ASM_OFFSETS_H__"; \ + echo "#define __GENERIC_ASM_OFFSETS_H__"; \ + echo "/*"; \
Kbuild line 30
Quoted 10 lines
Kbuild new file +10
-0+ echo " * DO NOT MODIFY."; \ + echo " *"; \ + echo " * This file was generated by Kbuild"; \ + echo " *"; \ + echo " */"; \ + echo ""; \ + sed -ne $(sed-y) $<; \ + echo ""; \ + echo "#endif" ) > $@ +endef
Can we use here documents in cases like this, so the number of shell command executions could be greatly reduced?
Does something like this work?
define cmd_generic-offsets \ cat <<_END_ > $@ \
#ifndef __GENERIC_ASM_OFFSETS_H__ \
#define __GENERIC_ASM_OFFSETS_H__ \
/* \
* DO NOT MODIFY \
* \
* This file was generated by Kbuild \
*/ \
$$(sed -ne $(sed-y) $<) \
#endif \
_END_
?
[I'm not sure how to mark the continuation lines here...]
Best regards,
Wolfgang Denk
Signature · 6 lines
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: [email protected] If all the Chinese simultaneously jumped into the Pacific off a 10 foot platform erected 10 feet off their coast, it would cause a tidal wave that would destroy everything in this country west of Nebraska.
PATCH v2 3/15 kbuild: move asm-offsets.h rules to ./Kbuild
Hello Wolfgang,
Quoted 18 lines
Can we use here documents in cases like this, so the number of shell command executions could be greatly reduced?
Does something like this work?
define cmd_generic-offsets \ cat <<_END_ > $@ \#ifndef
__GENERIC_ASM_OFFSETS_H__\
#define__GENERIC_ASM_OFFSETS_H__\
/* \
* DO NOT MODIFY \
* \
* This file was generated byKbuild\
*/ \
$$(sed -ne $(sed-y) $<) \
#endif \
_END_
Quoted 1 line
?
No.
I tried your code but it did not work.
Kbuild created an empty file include/generated/generic-asm-offsets.h.
I tried to debug but finally I gave up.
Here document ( cat <<END ... END) syntax is really nightmare in Makefile.
I've never seen that syntax in Makefile. For example, if you see the top Makefile of Linux Kernel, it always uses "echo" command.
Best Regards
Masahiro Yamada
PATCH v2 3/15 kbuild: move asm-offsets.h rules to ./Kbuild
In reply to Wolfgang DenkQuoted 27 lines · Wolfgang Denk
Dear Masahiro,
Quoted 6 lines · In message <[email protected]> you…
(quoted diff) +5
-0+define cmd_generic-offsets + (set -e; \ + echo "#ifndef __GENERIC_ASM_OFFSETS_H__"; \ + echo "#define __GENERIC_ASM_OFFSETS_H__"; \ + echo "/*"; \Review
Quoted 10 lines
(quoted diff) +10
-0+ echo " * DO NOT MODIFY."; \ + echo " *"; \ + echo " * This file was generated by Kbuild"; \ + echo " *"; \ + echo " */"; \ + echo ""; \ + sed -ne $(sed-y) $<; \ + echo ""; \ + echo "#endif" ) > $@ +endefCan we use here documents in cases like this, so the number of shell command executions could be greatly reduced?
Does something like this work?
define cmd_generic-offsets \ cat <<_END_ > $@ \
Quoted 9 lines
#ifndef
__GENERIC_ASM_OFFSETS_H__\
#define__GENERIC_ASM_OFFSETS_H__\
/* \
* DO NOT MODIFY \
* \
* This file was generated byKbuild\
*/ \
$$(sed -ne $(sed-y) $<) \
#endif \
We can use printf(1) to split this up into 3 parts, but it honestly reads worse:
Kbuild +8 -9
@@ -15,15 +15,14 @@ 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 ""; \ + printf "#ifndef __GENERIC_ASM_OFFSETS_H__\n\ +#define __GENERIC_ASM_OFFSETS_H__\n\ +/*\n\ + * DO NOT MODIFY.\n\ + *\n\ + * This file was generated by Kbuild\n\ + *\n\ + */\n\n"; \ sed -ne $(sed-y) $<; \ echo ""; \ echo "#endif" ) > $@
(And it doesn't quite look right in the file, but that's just a matter of massaging things. It also didn't seem to matter to overall build time since it's a one-off generation, not a many-off generation. I'm OK with this as-is.
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 836 bytes Desc: Digital signature URL: <http://lists.denx.de/pipermail/u-boot/attachments/20140225/7e1407f1/attachment.pgp>
PATCH v2 4/15 kbuild: rename OBJCFLAGS to OBJCOPYFLAGS
In reply to Masahiro YamadaRename OBJCFLAGS to OBJCOPYFLAGS beforehand to use "cmd_objcopy" in scripts/Makefile.lib in an upcoming commit.
---
Changes in v2: None
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(-)
Makefile +8 -8
@@ -753,13 +753,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)
@@ -769,10 +769,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
@@ -810,7 +810,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)
@@ -845,7 +845,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
@@ -870,7 +870,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
arch/arm/config.mk +2 -2
@@ -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
arch/arm/cpu/pxa/config.mk +1 -1
@@ -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
arch/arm/imx-common/Makefile +2 -2
@@ -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
arch/mips/config.mk +1 -1
@@ -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
board/hymod/config.mk +1 -1
@@ -11,4 +11,4 @@ PLATFORM_CPPFLAGS += -I$(TOPDIR) -OBJCFLAGS = --remove-section=.ppcenv +OBJCOPYFLAGS = --remove-section=.ppcenv
config.mk +1 -1
@@ -41,7 +41,7 @@ endif RELFLAGS= $(PLATFORM_RELFLAGS) -OBJCFLAGS += --gap-fill=0xff +OBJCOPYFLAGS += --gap-fill=0xff CPPFLAGS = $(RELFLAGS) CPPFLAGS += -pipe $(PLATFORM_CPPFLAGS)
nand_spl/board/amcc/acadia/Makefile +2 -2
@@ -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) \
nand_spl/board/amcc/bamboo/Makefile +2 -2
@@ -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) \
nand_spl/board/amcc/canyonlands/Makefile +2 -2
@@ -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) \
nand_spl/board/amcc/kilauea/Makefile +2 -2
@@ -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) \
nand_spl/board/amcc/sequoia/Makefile +2 -2
@@ -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) \
nand_spl/board/freescale/mpc8315erdb/Makefile +2 -2
@@ -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) \
nand_spl/board/freescale/mpc8536ds/Makefile +2 -2
@@ -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) \
nand_spl/board/freescale/mpc8569mds/Makefile +2 -2
@@ -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) \
nand_spl/board/freescale/mpc8572ds/Makefile +2 -2
@@ -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) \
nand_spl/board/freescale/p1023rds/Makefile +2 -2
@@ -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) \
nand_spl/board/freescale/p1_p2_rdb/Makefile +2 -2
@@ -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) \
nand_spl/board/sheldon/simpc8313/Makefile +2 -2
@@ -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) \
spl/Makefile +1 -1
@@ -200,7 +200,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),)
Signature · 1 line
1.8.3.2
PATCH v2 5/15 kbuild: Add $(Q) when descending into subdirectories
In reply to Masahiro Yamada---
Changes in v2: None
Makefile | 21 ++++++++------------- spl/Makefile | 4 ++-- 2 files changed, 10 insertions(+), 15 deletions(-)
Makefile +8 -13
@@ -790,7 +790,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 \
@@ -827,13 +827,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 \
@@ -851,8 +846,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
@@ -1050,16 +1045,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
spl/Makefile +2 -2
@@ -176,8 +176,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
Signature · 1 line
1.8.3.2
PATCH v2 6/15 kbuild: use shorten logs objcopy rules
In reply to Masahiro Yamada---
Changes in v2: None
Makefile | 41 +++++++++++++++++++++++++++++------------ examples/api/Makefile | 6 ++++-- examples/standalone/Makefile | 10 ++++++---- spl/Makefile | 19 +++++++++++++++++-- 4 files changed, 56 insertions(+), 20 deletions(-)
Makefile +29 -12
@@ -743,6 +743,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
@@ -752,27 +755,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
@@ -1253,6 +1260,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
examples/api/Makefile +4 -2
@@ -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
examples/standalone/Makefile +6 -4
@@ -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)
spl/Makefile +17 -2
@@ -199,8 +199,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),)
@@ -228,6 +233,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:
Signature · 1 line
1.8.3.2
PATCH v2 7/15 kbuild: use shorten logs for mkimage rules
In reply to Masahiro Yamada---
Changes in v2: None
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(-)
Makefile +20 -18
@@ -746,6 +746,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
@@ -789,24 +793,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
@@ -837,9 +838,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") \
arch/arm/cpu/armv7/am33xx/config.mk +2 -2
@@ -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
arch/arm/cpu/armv7/omap3/config.mk +1 -1
@@ -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
arch/arm/cpu/armv7/omap4/config.mk +1 -1
@@ -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
arch/arm/cpu/armv7/omap5/config.mk +1 -1
@@ -7,7 +7,7 @@ # ifdef CONFIG_SPL_BUILD -ALL-y += $(OBJTREE)/MLO +ALL-y += MLO else ALL-y += u-boot.img endif
spl/Makefile +9 -6
@@ -168,13 +168,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 $@
Signature · 1 line
1.8.3.2
PATCH v2 8/15 kbuild: use shorten logs for cat rules
In reply to Masahiro Yamada---
Changes in v2: None
Makefile | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-)
Makefile +15 -8
@@ -750,14 +750,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
@@ -879,13 +882,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
@@ -1053,11 +1056,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
Signature · 1 line
1.8.3.2
PATCH v2 9/15 kbuild: use shorten logs for combined rules of mkimage, padding and cat
In reply to Masahiro Yamada---
Changes in v2: None
Makefile | 79 +++++++++++++++++++++++++++++++++------------------------------- 1 file changed, 41 insertions(+), 38 deletions(-)
Makefile +41 -38
@@ -753,6 +753,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
@@ -818,25 +823,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)/$@
@@ -846,17 +847,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
@@ -867,19 +866,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
@@ -895,10 +895,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,
@@ -1066,7 +1067,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
Signature · 1 line
1.8.3.2
PATCH v2 10/15 kbuild: use shorten log for linking u-boot
In reply to Masahiro YamadaMove sandbox-specific link rule to arch/sandbox/config.mk.
---
Changes in v2: None
Makefile | 33 ++++++++++++++------------------- arch/sandbox/config.mk | 4 ++++ 2 files changed, 18 insertions(+), 19 deletions(-)
Makefile +14 -19
@@ -738,7 +738,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
@@ -913,27 +913,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,
arch/sandbox/config.mk +4 -0
@@ -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
Signature · 1 line
1.8.3.2
PATCH v2 11/15 kbuild: use shorten logs for misc targets
In reply to Masahiro Yamada---
Changes in v2: None
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(-)
Makefile +5 -2
@@ -1048,9 +1048,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
arch/blackfin/cpu/Makefile +5 -1
@@ -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
examples/api/Makefile +21 -19
@@ -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)
examples/standalone/Makefile +11 -14
@@ -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
spl/Makefile +5 -1
@@ -233,8 +233,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
Signature · 1 line
1.8.3.2
PATCH v2 12/15 kbuild: use shorten logs for IMX images
In reply to Masahiro Yamada---
Changes in v2: None
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(-)
Makefile +2 -2
@@ -815,7 +815,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
@@ -840,7 +840,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)
arch/arm/cpu/arm1136/config.mk +1 -1
@@ -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
arch/arm/cpu/arm926ejs/config.mk +1 -1
@@ -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
arch/arm/cpu/armv7/config.mk +1 -1
@@ -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
arch/arm/imx-common/Makefile +51 -34
88 lines not on this page · raw message
spl/Makefile +2 -2
@@ -179,8 +179,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
Signature · 1 line
1.8.3.2
PATCH v2 13/15 kbuild: refactor more IMX image rules
In reply to Masahiro YamadaThis 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.
---
Changes in v2: None
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(-)
Makefile +4 -1
@@ -839,7 +839,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)
arch/arm/config.mk +10 -0
@@ -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
arch/arm/cpu/arm1136/config.mk +0 -10
@@ -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
arch/arm/cpu/arm926ejs/config.mk +0 -10
@@ -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
arch/arm/cpu/armv7/config.mk +0 -10
@@ -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
spl/Makefile +0 -3
@@ -179,9 +179,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
Signature · 1 line
1.8.3.2
PATCH v2 14/15 kbuild: support building signle targets
In reply to Masahiro YamadaImport build rules of single targets from Linux 3.13.
---
Changes in v2: None
Makefile | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+)
Makefile +52 -0
@@ -1267,6 +1267,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)
Signature · 1 line
1.8.3.2
PATCH v2 15/15 kbuild: add misc targets, help, ubootrelease, ubootversion
In reply to Masahiro Yamada"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.
---
Changes in v2:
- Rebase on commit 1674df60
Makefile | 65 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 58 insertions(+), 7 deletions(-)
Makefile +58 -7
@@ -415,7 +415,7 @@ timestamp_h := include/generated/timestamp_autogenerated.h no-dot-config-targets := clean clobber mrproper distclean \ help %docs check% coccicheck \ - backup + ubootversion backup config-targets := 0 mixed-targets := 0
@@ -1081,12 +1081,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`
@@ -1252,6 +1246,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 # ---------------------------------------------------------------------------
@@ -1267,6 +1306,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:
Signature · 1 line
1.8.3.2
v2 cover Follow-up for Kbuild series: more misc targets and short logs
In reply to Masahiro YamadaQuoted 62 lines · Masahiro Yamada
Kbuildseries must be applied before this series.This series refactors a little, imports more
Kbuildfeatures and convert many rules toKbuildstyle.I think most of rules will be displayed in short log format by applying this series.
(But I know there are still some old style rules. I need more efforts...)Changes in v2:
- Rebase on commit1674df60Masahiro Yamada (15):
kbuild: consolidate version and timestamp headers generation
kbuild: abolish "depend" target
kbuild: moveasm-offsets.hrules 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, ubootversionKbuild | 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 +-
Quoted 8 lines
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
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 836 bytes Desc: Digital signature URL: <http://lists.denx.de/pipermail/u-boot/attachments/20140225/a3436b90/attachment.pgp>