[Cbe-oss-dev] kboot: Fix Makefile
Yuji Mano
Yuji.Mano at am.sony.com
Tue Aug 28 08:43:05 EST 2007
Fix up kboot makefiles for native and cross builds.
o Change cross builds to use Cell SDK toolchain by default.
o Check to see that compiler is found.
o Fix kernel make commands.
o Fix native build CFLAGS for static linking of libraries and disable zlib.
Signed-off-by: Yuji Mano <yuji.mano at am.sony.com>
---
kboot-11/Makefile | 22 +++++++++++++---------
1 file changed, 13 insertions(+), 9 deletions(-)
--- a/kboot-11/Makefile
+++ b/kboot-11/Makefile
@@ -21,8 +21,8 @@ config_uclibc=true
TARGET_ARCH=powerpc
KERNEL_ARCH=powerpc64
KEXEC_ARCH=ppc64
-CROSS_TOOLCHAIN_PATH_PREFIX=/opt/ppc64-redhat-linux
-CROSS_ARCH_PREFIX=ppc64-redhat-linux-
+CROSS_TOOLCHAIN_PATH_PREFIX=/opt/cell
+CROSS_ARCH_PREFIX=ppu-
LDFLAGS=-m elf32ppclinux
# internal define
@@ -70,7 +70,7 @@ else
endif
TARGET_KERNEL_CROSS = $(CROSS_ARCH_PREFIX)
KEXEC_CROSS = $(CROSS_ARCH_PREFIX)
-using_kexec_cross=PATH=$(CROSS_TOOLCHAIN_PATH_PREFIX)/bin:$$PATH
+using_kexec_cross=PATH=$(CROSS_TOOLCHAIN_PATH_PREFIX)/bin:$$PATH
KEXEC_CC = $(KEXEC_CROSS)gcc
KEXEC_LD = $(KEXEC_CROSS)ld
KEXEC_AR = $(KEXEC_CROSS)ar
@@ -216,10 +216,14 @@ FILES=VERSIONS CHANGES README TODO COPYI
.PHONY: try reset clean spotless dist upload
ifeq ($(config_uclibc),false)
-all: initrd.bin linux
+all: check_cc initrd.bin linux
UTILS_PREFIX=$(TARGET_CROSS)
else
-all: initrd.bin linux
+all: check_cc initrd.bin linux
+
+check_cc:
+ @echo Checking for $(KEXEC_CC)...
+ @$(KEXEC_CC) -v
using_uclibc_cross=PATH=$(PWD)/build/bin:$$PATH
using_uclibc=PATH=$(PWD)/build/bin:$(PWD)/build/$(OPTIMIZE_FOR_CPU)-linux-uclibc/bin:$$PATH
@@ -607,7 +611,7 @@ $(KERNEL_DIR)/.kboot-configured: \
+CONFIG_BLK_DEV_RAM_COUNT=1 \
+CONFIG_BLK_DEV_RAM_SIZE=4096
ifneq ($(HOST_ARCH),$(KERNEL_ARCH))
- MAKEFLAGS="ARCH=$(TARGET_ARCH) CFLAGS_KERNEL=-g
CROSS32_COMPILE=$(TARGET_KERNEL_CROSS)
CROSS_COMPILE=$(TARGET_KERNEL_CROSS)" make -C $(KERNEL_DIR) oldconfig
include/asm
+ make -C $(KERNEL_DIR) oldconfig include/asm ARCH=$(TARGET_ARCH)
CROSS_COMPILE=$(TARGET_KERNEL_CROSS)
else
make -C $(KERNEL_DIR) oldconfig include/asm
endif
@@ -617,7 +621,7 @@ $(KERNEL_DIR)/.kboot-built: \
$(KERNEL_DIR)/.kboot-configured
rm -f $@
ifneq ($(HOST_ARCH),$(KERNEL_ARCH))
- MAKEFLAGS="ARCH=$(TARGET_ARCH) CFLAGS_KERNEL=-g
CROSS32_COMPILE=$(TARGET_KERNEL_CROSS)
CROSS_COMPILE=$(TARGET_KERNEL_CROSS)" make -C $(KERNEL_DIR)
+ make -C $(KERNEL_DIR) ARCH=$(TARGET_ARCH)
CROSS_COMPILE=$(TARGET_KERNEL_CROSS)
else
make -C $(KERNEL_DIR)
endif
@@ -634,7 +638,7 @@ linux: \
rm -rf linux
cp initrd.bin $(KERNEL_DIR)/arch/$(TARGET_ARCH)/boot/ramdisk.image.gz
ifneq ($(HOST_ARCH),$(KERNEL_ARCH))
- MAKEFLAGS="ARCH=$(TARGET_ARCH) CFLAGS_KERNEL=-g
CROSS32_COMPILE=$(TARGET_KERNEL_CROSS)
CROSS_COMPILE=$(TARGET_KERNEL_CROSS)" make -C $(KERNEL_DIR) zImage.initrd
+ make -C $(KERNEL_DIR) ARCH=$(TARGET_ARCH)
CROSS_COMPILE=$(TARGET_KERNEL_CROSS) zImage.initrd
else
make -C $(KERNEL_DIR) zImage.initrd
endif
@@ -1642,7 +1646,7 @@ else
( cd $(KEXEC_TOOLS_DIR) && \
autoconf && \
./configure \
- --host=$(KERNEL_ARCH) \
+ --host=$(KERNEL_ARCH) CFLAGS='-Wall -O2 -static -fno-strict-aliasing
$(CPPFLAGS)' --without-zlib \
--includedir=$(PWD)/$(KERNEL_DIR)/include --prefix=$(PWD)/root; )
endif
touch $@
More information about the cbe-oss-dev
mailing list