diff options
Diffstat (limited to 'scripts/Makefile.lib')
-rw-r--r-- | scripts/Makefile.lib | 21 |
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)) |
128 | endif | 128 | endif |
129 | 129 | ||
130 | ifdef CONFIG_SYMBOL_PREFIX | ||
131 | _cpp_flags += -DSYMBOL_PREFIX=$(patsubst "%",%,$(CONFIG_SYMBOL_PREFIX)) | ||
132 | endif | ||
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. |
211 | size_append = /bin/echo -ne $(shell \ | 216 | size_append = printf $(shell \ |
212 | dec_size=0; \ | 217 | dec_size=0; \ |
213 | for F in $1; do \ | 218 | for 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); \ |
216 | done; \ | 221 | done; \ |
217 | printf "%08x" $$dec_size | \ | 222 | printf "%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 | ||
221 | quiet_cmd_bzip2 = BZIP2 $@ | 231 | quiet_cmd_bzip2 = BZIP2 $@ |
@@ -230,3 +240,8 @@ quiet_cmd_lzma = LZMA $@ | |||
230 | cmd_lzma = (cat $(filter-out FORCE,$^) | \ | 240 | cmd_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 | |||
244 | quiet_cmd_lzo = LZO $@ | ||
245 | cmd_lzo = (cat $(filter-out FORCE,$^) | \ | ||
246 | lzop -9 && $(call size_append, $(filter-out FORCE,$^))) > $@ || \ | ||
247 | (rm -f $@ ; false) | ||