summaryrefslogtreecommitdiff
path: root/scripts/Makefile.lib
diff options
context:
space:
mode:
authorMasahiro Yamada <yamada.masahiro@socionext.com>2019-01-17 19:02:43 +0900
committerMasahiro Yamada <yamada.masahiro@socionext.com>2019-01-28 09:11:17 +0900
commitafa974b771281fd89e8fdcb71152152f17fb8303 (patch)
treeb6a3de04148c2207d3cd094b70820160e24d0420 /scripts/Makefile.lib
parent5d680056cb6de18f0221e321ee51d60ccd700781 (diff)
kbuild: add real-prereqs shorthand for $(filter-out FORCE,$^)
In Kbuild, if_changed and friends must have FORCE as a prerequisite. Hence, $(filter-out FORCE,$^) or $(filter-out $(PHONY),$^) is a common idiom to get the names of all the prerequisites except phony targets. Add real-prereqs as a shorthand. Note: We cannot replace $(filter %.o,$^) in cmd_link_multi-m because $^ may include auto-generated dependencies from the .*.cmd file when a single object module is changed into a multi object module. Refer to commit 69ea912fda74 ("kbuild: remove unneeded link_multi_deps"). I added some comment to avoid accidental breakage. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Acked-by: Rob Herring <robh@kernel.org>
Diffstat (limited to 'scripts/Makefile.lib')
-rw-r--r--scripts/Makefile.lib18
1 files changed, 9 insertions, 9 deletions
diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib
index ebaa348c9981..c6fc295e0c48 100644
--- a/scripts/Makefile.lib
+++ b/scripts/Makefile.lib
@@ -231,7 +231,7 @@ $(obj)/%: $(src)/%_shipped
# ---------------------------------------------------------------------------
quiet_cmd_ld = LD $@
-cmd_ld = $(LD) $(ld_flags) $(filter-out FORCE,$^) -o $@
+ cmd_ld = $(LD) $(ld_flags) $(real-prereqs) -o $@
# Objcopy
# ---------------------------------------------------------------------------
@@ -243,7 +243,7 @@ cmd_objcopy = $(OBJCOPY) $(OBJCOPYFLAGS) $(OBJCOPYFLAGS_$(@F)) $< $@
# ---------------------------------------------------------------------------
quiet_cmd_gzip = GZIP $@
- cmd_gzip = cat $(filter-out FORCE,$^) | gzip -n -f -9 > $@
+ cmd_gzip = cat $(real-prereqs) | gzip -n -f -9 > $@
# DTC
# ---------------------------------------------------------------------------
@@ -321,7 +321,7 @@ dtc-tmp = $(subst $(comma),_,$(dot-target).dts.tmp)
# append the size as a 32-bit littleendian number as gzip does.
size_append = printf $(shell \
dec_size=0; \
-for F in $(filter-out FORCE,$^); do \
+for F in $(real-prereqs); do \
fsize=$$($(CONFIG_SHELL) $(srctree)/scripts/file-size.sh $$F); \
dec_size=$$(expr $$dec_size + $$fsize); \
done; \
@@ -335,19 +335,19 @@ printf "%08x\n" $$dec_size | \
)
quiet_cmd_bzip2 = BZIP2 $@
- cmd_bzip2 = (cat $(filter-out FORCE,$^) | bzip2 -9 && $(size_append)) > $@
+ cmd_bzip2 = (cat $(real-prereqs) | bzip2 -9 && $(size_append)) > $@
# Lzma
# ---------------------------------------------------------------------------
quiet_cmd_lzma = LZMA $@
- cmd_lzma = (cat $(filter-out FORCE,$^) | lzma -9 && $(size_append)) > $@
+ cmd_lzma = (cat $(real-prereqs) | lzma -9 && $(size_append)) > $@
quiet_cmd_lzo = LZO $@
- cmd_lzo = (cat $(filter-out FORCE,$^) | lzop -9 && $(size_append)) > $@
+ cmd_lzo = (cat $(real-prereqs) | lzop -9 && $(size_append)) > $@
quiet_cmd_lz4 = LZ4 $@
- cmd_lz4 = (cat $(filter-out FORCE,$^) | lz4c -l -c1 stdin stdout && \
+ cmd_lz4 = (cat $(real-prereqs) | lz4c -l -c1 stdin stdout && \
$(size_append)) > $@
# U-Boot mkimage
@@ -390,11 +390,11 @@ quiet_cmd_uimage = UIMAGE $@
# big dictionary would increase the memory usage too much in the multi-call
# decompression mode. A BCJ filter isn't used either.
quiet_cmd_xzkern = XZKERN $@
-cmd_xzkern = (cat $(filter-out FORCE,$^) | \
+ cmd_xzkern = (cat $(real-prereqs) | \
sh $(srctree)/scripts/xz_wrap.sh && $(size_append)) > $@
quiet_cmd_xzmisc = XZMISC $@
-cmd_xzmisc = (cat $(filter-out FORCE,$^) | \
+ cmd_xzmisc = (cat $(real-prereqs) | \
xz --check=crc32 --lzma2=dict=1MiB) > $@
# ASM offsets