From 3a7109e94184d6aa595b8d00d589a65bc40bb202 Mon Sep 17 00:00:00 2001 From: =?utf8?q?=E9=BB=84=E6=B6=9B?= Date: Wed, 29 Jun 2011 09:40:21 +0800 Subject: [PATCH] arm: Makefile: add bootimg/zbootimg target --- Makefile | 8 ++++++-- arch/arm/Makefile | 20 ++++++++++++++++++++ 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 7be29d6c48cd..a606202c6735 100644 --- a/Makefile +++ b/Makefile @@ -183,8 +183,12 @@ export KBUILD_BUILDHOST := $(SUBARCH) #ARCH ?= $(SUBARCH) #CROSS_COMPILE ?= ARCH ?= arm -#CROSS_COMPILE :=/opt/android0320/mydroid/prebuilt/linux-x86/toolchain/arm-eabi-4.2.1/bin/arm-eabi- -CROSS_COMPILE ?=../toolchain/arm-eabi-4.4.0/bin/arm-eabi- +ifneq ($(wildcard ../toolchain/arm-eabi-4.4.0),) +CROSS_COMPILE ?= ../toolchain/arm-eabi-4.4.0/bin/arm-eabi- +endif +ifneq ($(wildcard ../prebuilt/linux-x86/toolchain/arm-eabi-4.4.0),) +CROSS_COMPILE ?= ../prebuilt/linux-x86/toolchain/arm-eabi-4.4.0/bin/arm-eabi- +endif # Architecture as present in compile.h UTS_MACHINE := $(ARCH) diff --git a/arch/arm/Makefile b/arch/arm/Makefile index c101382c4afe..573a9b24fdff 100644 --- a/arch/arm/Makefile +++ b/arch/arm/Makefile @@ -280,9 +280,29 @@ zkernel.img: zImage FORCE $(Q)$(srctree)/mkkrnlimg $(obj)/arch/arm/boot/zImage $(obj)/kernel.img @echo ' Image: kernel.img is ready' +checkandroid: FORCE + $(Q)test -n "$(OUT)" || (echo "Run 'cd .. && . build/envsetup.sh && setpaths && cd -' first to build boot.img"; /bin/false) + $(Q)test -x $(srctree)/../out/host/linux-x86/bin/mkbootimg || (echo "No $(srctree)/../out/host/linux-x86/bin/mkbootimg"; /bin/false) + $(Q)test -e $(OUT)/ramdisk.img || (echo "No $(OUT)/ramdisk.img"; /bin/false) + +PHONY += bootimg boot.img zbootimg zboot.img +bootimg boot.img: Image checkandroid FORCE + $(Q)cp -a $(obj)/arch/arm/boot/Image $(OUT)/kernel + $(Q)mkbootimg --kernel $(OUT)/kernel --ramdisk $(OUT)/ramdisk.img --output $(OUT)/boot.img + @echo ' Image: $(OUT)/boot.img is ready' + +zbootimg zboot.img: zImage checkandroid FORCE + $(Q)cp -a $(obj)/arch/arm/boot/zImage $(OUT)/kernel + $(Q)mkbootimg --kernel $(OUT)/kernel --ramdisk $(OUT)/ramdisk.img --output $(OUT)/boot.img + @echo ' Image: $(OUT)/boot.img is ready' + define archhelp echo ' kernel.img - Rockchip kernel image' echo ' zkernel.img - Compressed Rockchip kernel image' + echo ' boot.img' + echo ' bootimg - Android boot image' + echo ' zboot.img' + echo ' zbootimg - Compressed Android boot image' echo '* zImage - Compressed kernel image (arch/$(ARCH)/boot/zImage)' echo ' Image - Uncompressed kernel image (arch/$(ARCH)/boot/Image)' echo '* xipImage - XIP kernel image, if configured (arch/$(ARCH)/boot/xipImage)' -- 2.34.1