Commit ecbd10d9 authored by Masahiro Yamada's avatar Masahiro Yamada

kbuild: simplify rules of data compression with size appending

All the callers of size_append pass $(filter-out FORCE,$^).
Move $(filter-out FORCE,$^) to the definition of size_append.

This makes the callers cleaner because $(call ...) is unneeded
for a macro with no argument.
Signed-off-by: default avatarMasahiro Yamada <yamada.masahiro@socionext.com>
parent d151e971
...@@ -321,7 +321,7 @@ dtc-tmp = $(subst $(comma),_,$(dot-target).dts.tmp) ...@@ -321,7 +321,7 @@ dtc-tmp = $(subst $(comma),_,$(dot-target).dts.tmp)
# append the size as a 32-bit littleendian number as gzip does. # append the size as a 32-bit littleendian number as gzip does.
size_append = printf $(shell \ size_append = printf $(shell \
dec_size=0; \ dec_size=0; \
for F in $1; do \ for F in $(filter-out FORCE,$^); do \
fsize=$$($(CONFIG_SHELL) $(srctree)/scripts/file-size.sh $$F); \ fsize=$$($(CONFIG_SHELL) $(srctree)/scripts/file-size.sh $$F); \
dec_size=$$(expr $$dec_size + $$fsize); \ dec_size=$$(expr $$dec_size + $$fsize); \
done; \ done; \
...@@ -335,23 +335,20 @@ printf "%08x\n" $$dec_size | \ ...@@ -335,23 +335,20 @@ printf "%08x\n" $$dec_size | \
) )
quiet_cmd_bzip2 = BZIP2 $@ quiet_cmd_bzip2 = BZIP2 $@
cmd_bzip2 = (cat $(filter-out FORCE,$^) | \ cmd_bzip2 = (cat $(filter-out FORCE,$^) | bzip2 -9 && $(size_append)) > $@
bzip2 -9 && $(call size_append, $(filter-out FORCE,$^))) > $@
# Lzma # Lzma
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------
quiet_cmd_lzma = LZMA $@ quiet_cmd_lzma = LZMA $@
cmd_lzma = (cat $(filter-out FORCE,$^) | \ cmd_lzma = (cat $(filter-out FORCE,$^) | lzma -9 && $(size_append)) > $@
lzma -9 && $(call size_append, $(filter-out FORCE,$^))) > $@
quiet_cmd_lzo = LZO $@ quiet_cmd_lzo = LZO $@
cmd_lzo = (cat $(filter-out FORCE,$^) | \ cmd_lzo = (cat $(filter-out FORCE,$^) | lzop -9 && $(size_append)) > $@
lzop -9 && $(call size_append, $(filter-out FORCE,$^))) > $@
quiet_cmd_lz4 = LZ4 $@ quiet_cmd_lz4 = LZ4 $@
cmd_lz4 = (cat $(filter-out FORCE,$^) | \ cmd_lz4 = (cat $(filter-out FORCE,$^) | lz4c -l -c1 stdin stdout && \
lz4c -l -c1 stdin stdout && $(call size_append, $(filter-out FORCE,$^))) > $@ $(size_append)) > $@
# U-Boot mkimage # U-Boot mkimage
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------
...@@ -394,8 +391,7 @@ quiet_cmd_uimage = UIMAGE $@ ...@@ -394,8 +391,7 @@ quiet_cmd_uimage = UIMAGE $@
# decompression mode. A BCJ filter isn't used either. # decompression mode. A BCJ filter isn't used either.
quiet_cmd_xzkern = XZKERN $@ quiet_cmd_xzkern = XZKERN $@
cmd_xzkern = (cat $(filter-out FORCE,$^) | \ cmd_xzkern = (cat $(filter-out FORCE,$^) | \
sh $(srctree)/scripts/xz_wrap.sh && \ sh $(srctree)/scripts/xz_wrap.sh && $(size_append)) > $@
$(call size_append, $(filter-out FORCE,$^))) > $@
quiet_cmd_xzmisc = XZMISC $@ quiet_cmd_xzmisc = XZMISC $@
cmd_xzmisc = (cat $(filter-out FORCE,$^) | \ cmd_xzmisc = (cat $(filter-out FORCE,$^) | \
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment