History

Kbuild: centralize MKIMAGE and cmd_uimage definitions

All ARCHs have the same definition of MKIMAGE. Move it to Makefile.lib to avoid duplication. All ARCHs have similar definitions of cmd_uimage. Place a sufficiently parameterized version in Makefile.lib to avoid duplication.

Stephen Warren committed 14 years ago

Commit e3393641 parent f75a8df8 files · +54 −60Browse files

Showing the changes to scripts (1 of 8 files). Show all

Unified · Split

scripts/Makefile.lib+24−0
@@ -304,6 +304,30 @@ cmd_lzo = (cat $(filter-out FORCE,$^) | \ · 303 unmodified lines
304 lzop -9 && $(call size_append, $(filter-out FORCE,$^))) > $@ || \304 lzop -9 && $(call size_append, $(filter-out FORCE,$^))) > $@ || \
305 (rm -f $@ ; false)305 (rm -f $@ ; false)
306 306
307# U-Boot mkimage
308# ---------------------------------------------------------------------------
309
310MKIMAGE := $(srctree)/scripts/mkuboot.sh
311
312# SRCARCH just happens to match slightly more than ARCH (on sparc), so reduces
313# the number of overrides in arch makefiles
314UIMAGE_ARCH ?= $(SRCARCH)
315UIMAGE_COMPRESSION ?= $(if $(2),$(2),none)
316UIMAGE_OPTS-y ?=
317UIMAGE_TYPE ?= kernel
318UIMAGE_LOADADDR ?= arch_must_set_this
319UIMAGE_ENTRYADDR ?= $(UIMAGE_LOADADDR)
320UIMAGE_NAME ?= 'Linux-$(KERNELRELEASE)'
321UIMAGE_IN ?= $<
322UIMAGE_OUT ?= $@
323
324quiet_cmd_uimage = UIMAGE $(UIMAGE_OUT)
325 cmd_uimage = $(CONFIG_SHELL) $(MKIMAGE) -A $(UIMAGE_ARCH) -O linux \
326 -C $(UIMAGE_COMPRESSION) $(UIMAGE_OPTS-y) \
327 -T $(UIMAGE_TYPE) \
328 -a $(UIMAGE_LOADADDR) -e $(UIMAGE_ENTRYADDR) \
329 -n $(UIMAGE_NAME) -d $(UIMAGE_IN) $(UIMAGE_OUT)
330
307# XZ331# XZ
308# ---------------------------------------------------------------------------332# ---------------------------------------------------------------------------
309# Use xzkern to compress the kernel image and xzmisc to compress other things.333# Use xzkern to compress the kernel image and xzmisc to compress other things.