aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/Makefile.lib
diff options
context:
space:
mode:
authorStephen Warren <swarren@wwwdotorg.org>2012-03-16 17:03:55 -0400
committerMichal Marek <mmarek@suse.cz>2012-03-26 09:49:20 -0400
commite33936451484b06b61b259172fa3761a7d1cd4dc (patch)
treeacdbb021fc7f3ba4c13adbd70059f7a7c70c9803 /scripts/Makefile.lib
parentf75a8df3bd6466e29a4e40b86b2cfc96fe06d328 (diff)
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. Signed-off-by: Stephen Warren <swarren@wwwdotorg.org> Acked-by: Nicolas Pitre <nico@linaro.org> Tested-by: Mike Frysinger <vapier@gentoo.org> [Blackfin] Tested-by: Michal Simek <monstr@monstr.eu> [Microblaze] Tested-by: Guan Xuetao <gxt@mprc.pku.edu.cn> [unicore32] Signed-off-by: Michal Marek <mmarek@suse.cz>
Diffstat (limited to 'scripts/Makefile.lib')
-rw-r--r--scripts/Makefile.lib24
1 files changed, 24 insertions, 0 deletions
diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib
index 00c368c6e996..0be6f110cce7 100644
--- a/scripts/Makefile.lib
+++ b/scripts/Makefile.lib
@@ -304,6 +304,30 @@ cmd_lzo = (cat $(filter-out FORCE,$^) | \
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# XZ 331# 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.