Makefile.lib (ecbd10d90e9401563f1bcb768f42119c9cbfac91) Makefile.lib (afa974b771281fd89e8fdcb71152152f17fb8303)
1# SPDX-License-Identifier: GPL-2.0
2# Backward compatibility
3asflags-y += $(EXTRA_AFLAGS)
4ccflags-y += $(EXTRA_CFLAGS)
5cppflags-y += $(EXTRA_CPPFLAGS)
6ldflags-y += $(EXTRA_LDFLAGS)
7
8# flags that take effect in current and sub directories

--- 217 unchanged lines hidden (view full) ---

226#
227# and add target to extra-y so that we know we have to
228# read in the saved command line
229
230# Linking
231# ---------------------------------------------------------------------------
232
233quiet_cmd_ld = LD $@
1# SPDX-License-Identifier: GPL-2.0
2# Backward compatibility
3asflags-y += $(EXTRA_AFLAGS)
4ccflags-y += $(EXTRA_CFLAGS)
5cppflags-y += $(EXTRA_CPPFLAGS)
6ldflags-y += $(EXTRA_LDFLAGS)
7
8# flags that take effect in current and sub directories

--- 217 unchanged lines hidden (view full) ---

226#
227# and add target to extra-y so that we know we have to
228# read in the saved command line
229
230# Linking
231# ---------------------------------------------------------------------------
232
233quiet_cmd_ld = LD $@
234cmd_ld = $(LD) $(ld_flags) $(filter-out FORCE,$^) -o $@
234 cmd_ld = $(LD) $(ld_flags) $(real-prereqs) -o $@
235
236# Objcopy
237# ---------------------------------------------------------------------------
238
239quiet_cmd_objcopy = OBJCOPY $@
240cmd_objcopy = $(OBJCOPY) $(OBJCOPYFLAGS) $(OBJCOPYFLAGS_$(@F)) $< $@
241
242# Gzip
243# ---------------------------------------------------------------------------
244
245quiet_cmd_gzip = GZIP $@
235
236# Objcopy
237# ---------------------------------------------------------------------------
238
239quiet_cmd_objcopy = OBJCOPY $@
240cmd_objcopy = $(OBJCOPY) $(OBJCOPYFLAGS) $(OBJCOPYFLAGS_$(@F)) $< $@
241
242# Gzip
243# ---------------------------------------------------------------------------
244
245quiet_cmd_gzip = GZIP $@
246 cmd_gzip = cat $(filter-out FORCE,$^) | gzip -n -f -9 > $@
246 cmd_gzip = cat $(real-prereqs) | gzip -n -f -9 > $@
247
248# DTC
249# ---------------------------------------------------------------------------
250DTC ?= $(objtree)/scripts/dtc/dtc
251
252# Disable noisy checks by default
253ifeq ($(findstring 1,$(KBUILD_ENABLE_EXTRA_GCC_CHECKS)),)
254DTC_FLAGS += -Wno-unit_address_vs_reg \

--- 61 unchanged lines hidden (view full) ---

316
317# Bzip2
318# ---------------------------------------------------------------------------
319
320# Bzip2 and LZMA do not include size in file... so we have to fake that;
321# append the size as a 32-bit littleendian number as gzip does.
322size_append = printf $(shell \
323dec_size=0; \
247
248# DTC
249# ---------------------------------------------------------------------------
250DTC ?= $(objtree)/scripts/dtc/dtc
251
252# Disable noisy checks by default
253ifeq ($(findstring 1,$(KBUILD_ENABLE_EXTRA_GCC_CHECKS)),)
254DTC_FLAGS += -Wno-unit_address_vs_reg \

--- 61 unchanged lines hidden (view full) ---

316
317# Bzip2
318# ---------------------------------------------------------------------------
319
320# Bzip2 and LZMA do not include size in file... so we have to fake that;
321# append the size as a 32-bit littleendian number as gzip does.
322size_append = printf $(shell \
323dec_size=0; \
324for F in $(filter-out FORCE,$^); do \
324for F in $(real-prereqs); do \
325 fsize=$$($(CONFIG_SHELL) $(srctree)/scripts/file-size.sh $$F); \
326 dec_size=$$(expr $$dec_size + $$fsize); \
327done; \
328printf "%08x\n" $$dec_size | \
329 sed 's/\(..\)/\1 /g' | { \
330 read ch0 ch1 ch2 ch3; \
331 for ch in $$ch3 $$ch2 $$ch1 $$ch0; do \
332 printf '%s%03o' '\\' $$((0x$$ch)); \
333 done; \
334 } \
335)
336
337quiet_cmd_bzip2 = BZIP2 $@
325 fsize=$$($(CONFIG_SHELL) $(srctree)/scripts/file-size.sh $$F); \
326 dec_size=$$(expr $$dec_size + $$fsize); \
327done; \
328printf "%08x\n" $$dec_size | \
329 sed 's/\(..\)/\1 /g' | { \
330 read ch0 ch1 ch2 ch3; \
331 for ch in $$ch3 $$ch2 $$ch1 $$ch0; do \
332 printf '%s%03o' '\\' $$((0x$$ch)); \
333 done; \
334 } \
335)
336
337quiet_cmd_bzip2 = BZIP2 $@
338 cmd_bzip2 = (cat $(filter-out FORCE,$^) | bzip2 -9 && $(size_append)) > $@
338 cmd_bzip2 = (cat $(real-prereqs) | bzip2 -9 && $(size_append)) > $@
339
340# Lzma
341# ---------------------------------------------------------------------------
342
343quiet_cmd_lzma = LZMA $@
339
340# Lzma
341# ---------------------------------------------------------------------------
342
343quiet_cmd_lzma = LZMA $@
344 cmd_lzma = (cat $(filter-out FORCE,$^) | lzma -9 && $(size_append)) > $@
344 cmd_lzma = (cat $(real-prereqs) | lzma -9 && $(size_append)) > $@
345
346quiet_cmd_lzo = LZO $@
345
346quiet_cmd_lzo = LZO $@
347 cmd_lzo = (cat $(filter-out FORCE,$^) | lzop -9 && $(size_append)) > $@
347 cmd_lzo = (cat $(real-prereqs) | lzop -9 && $(size_append)) > $@
348
349quiet_cmd_lz4 = LZ4 $@
348
349quiet_cmd_lz4 = LZ4 $@
350 cmd_lz4 = (cat $(filter-out FORCE,$^) | lz4c -l -c1 stdin stdout && \
350 cmd_lz4 = (cat $(real-prereqs) | lz4c -l -c1 stdin stdout && \
351 $(size_append)) > $@
352
353# U-Boot mkimage
354# ---------------------------------------------------------------------------
355
356MKIMAGE := $(srctree)/scripts/mkuboot.sh
357
358# SRCARCH just happens to match slightly more than ARCH (on sparc), so reduces

--- 26 unchanged lines hidden (view full) ---

385# Note that the bytes added by size_append will make the xz tool think that
386# the file is corrupt. This is expected.
387#
388# xzmisc doesn't use size_append, so it can be used to create normal .xz
389# files. xzmisc uses smaller LZMA2 dictionary than xzkern, because a very
390# big dictionary would increase the memory usage too much in the multi-call
391# decompression mode. A BCJ filter isn't used either.
392quiet_cmd_xzkern = XZKERN $@
351 $(size_append)) > $@
352
353# U-Boot mkimage
354# ---------------------------------------------------------------------------
355
356MKIMAGE := $(srctree)/scripts/mkuboot.sh
357
358# SRCARCH just happens to match slightly more than ARCH (on sparc), so reduces

--- 26 unchanged lines hidden (view full) ---

385# Note that the bytes added by size_append will make the xz tool think that
386# the file is corrupt. This is expected.
387#
388# xzmisc doesn't use size_append, so it can be used to create normal .xz
389# files. xzmisc uses smaller LZMA2 dictionary than xzkern, because a very
390# big dictionary would increase the memory usage too much in the multi-call
391# decompression mode. A BCJ filter isn't used either.
392quiet_cmd_xzkern = XZKERN $@
393cmd_xzkern = (cat $(filter-out FORCE,$^) | \
393 cmd_xzkern = (cat $(real-prereqs) | \
394 sh $(srctree)/scripts/xz_wrap.sh && $(size_append)) > $@
395
396quiet_cmd_xzmisc = XZMISC $@
394 sh $(srctree)/scripts/xz_wrap.sh && $(size_append)) > $@
395
396quiet_cmd_xzmisc = XZMISC $@
397cmd_xzmisc = (cat $(filter-out FORCE,$^) | \
397 cmd_xzmisc = (cat $(real-prereqs) | \
398 xz --check=crc32 --lzma2=dict=1MiB) > $@
399
400# ASM offsets
401# ---------------------------------------------------------------------------
402
403# Default sed regexp - multiline due to syntax constraints
404#
405# Use [:space:] because LLVM's integrated assembler inserts <tab> around

--- 23 unchanged lines hidden ---
398 xz --check=crc32 --lzma2=dict=1MiB) > $@
399
400# ASM offsets
401# ---------------------------------------------------------------------------
402
403# Default sed regexp - multiline due to syntax constraints
404#
405# Use [:space:] because LLVM's integrated assembler inserts <tab> around

--- 23 unchanged lines hidden ---