aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/Makefile.lib
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/Makefile.lib')
-rw-r--r--scripts/Makefile.lib21
1 files changed, 18 insertions, 3 deletions
diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib
index ffdafb26f539..f9bdf264473d 100644
--- a/scripts/Makefile.lib
+++ b/scripts/Makefile.lib
@@ -127,6 +127,11 @@ _c_flags += $(if $(patsubst n%,, \
127 $(CFLAGS_GCOV)) 127 $(CFLAGS_GCOV))
128endif 128endif
129 129
130ifdef CONFIG_SYMBOL_PREFIX
131_cpp_flags += -DSYMBOL_PREFIX=$(patsubst "%",%,$(CONFIG_SYMBOL_PREFIX))
132endif
133
134
130# If building the kernel in a separate objtree expand all occurrences 135# If building the kernel in a separate objtree expand all occurrences
131# of -Idir to -I$(srctree)/dir except for absolute paths (starting with '/'). 136# of -Idir to -I$(srctree)/dir except for absolute paths (starting with '/').
132 137
@@ -208,14 +213,19 @@ cmd_gzip = (cat $(filter-out FORCE,$^) | gzip -f -9 > $@) || \
208 213
209# Bzip2 and LZMA do not include size in file... so we have to fake that; 214# Bzip2 and LZMA do not include size in file... so we have to fake that;
210# append the size as a 32-bit littleendian number as gzip does. 215# append the size as a 32-bit littleendian number as gzip does.
211size_append = /bin/echo -ne $(shell \ 216size_append = printf $(shell \
212dec_size=0; \ 217dec_size=0; \
213for F in $1; do \ 218for F in $1; do \
214 fsize=$$(stat -c "%s" $$F); \ 219 fsize=$$(stat -c "%s" $$F); \
215 dec_size=$$(expr $$dec_size + $$fsize); \ 220 dec_size=$$(expr $$dec_size + $$fsize); \
216done; \ 221done; \
217printf "%08x" $$dec_size | \ 222printf "%08x\n" $$dec_size | \
218 sed 's/\(..\)\(..\)\(..\)\(..\)/\\\\x\4\\\\x\3\\\\x\2\\\\x\1/g' \ 223 sed 's/\(..\)/\1 /g' | { \
224 read ch0 ch1 ch2 ch3; \
225 for ch in $$ch3 $$ch2 $$ch1 $$ch0; do \
226 printf '%s%03o' '\\' $$((0x$$ch)); \
227 done; \
228 } \
219) 229)
220 230
221quiet_cmd_bzip2 = BZIP2 $@ 231quiet_cmd_bzip2 = BZIP2 $@
@@ -230,3 +240,8 @@ quiet_cmd_lzma = LZMA $@
230cmd_lzma = (cat $(filter-out FORCE,$^) | \ 240cmd_lzma = (cat $(filter-out FORCE,$^) | \
231 lzma -9 && $(call size_append, $(filter-out FORCE,$^))) > $@ || \ 241 lzma -9 && $(call size_append, $(filter-out FORCE,$^))) > $@ || \
232 (rm -f $@ ; false) 242 (rm -f $@ ; false)
243
244quiet_cmd_lzo = LZO $@
245cmd_lzo = (cat $(filter-out FORCE,$^) | \
246 lzop -9 && $(call size_append, $(filter-out FORCE,$^))) > $@ || \
247 (rm -f $@ ; false)