Merge branch 'master'
[deliverable/linux.git] / arch / powerpc / Makefile
index d94878193cd945e36f85e650b11f255afd5521b1..5bc11bd36c1f8eba426466ba7e4b136ca51bb2aa 100644 (file)
@@ -12,9 +12,6 @@
 # Rewritten by Cort Dougan and Paul Mackerras
 #
 
-# This must match PAGE_OFFSET in include/asm-powerpc/page.h.
-KERNELLOAD     := $(CONFIG_KERNEL_START)
-
 HAS_BIARCH     := $(call cc-option-yn, -m32)
 
 ifeq ($(CONFIG_PPC64),y)
@@ -51,13 +48,15 @@ OLDARCH     := ppc
 SZ     := 32
 endif
 
+UTS_MACHINE := $(OLDARCH)
+
 ifeq ($(HAS_BIARCH),y)
 override AS    += -a$(SZ)
 override LD    += -m elf$(SZ)ppc
 override CC    += -m$(SZ)
 endif
 
-LDFLAGS_vmlinux        := -Ttext $(KERNELLOAD) -Bstatic -e $(KERNELLOAD)
+LDFLAGS_vmlinux        := -Bstatic
 
 # The -Iarch/$(ARCH)/include is temporary while we are merging
 CPPFLAGS       += -Iarch/$(ARCH) -Iarch/$(ARCH)/include
@@ -91,6 +90,9 @@ else
 endif
 endif
 
+# No AltiVec instruction when building kernel
+CFLAGS += $(call cc-option,-mno-altivec)
+
 # Enable unit-at-a-time mode when possible. It shrinks the
 # kernel considerably.
 CFLAGS += $(call cc-option,-funit-at-a-time)
@@ -112,18 +114,15 @@ CFLAGS += $(cpu-as-y)
 # Default to the common case.
 KBUILD_DEFCONFIG := common_defconfig
 
-head-y                         := arch/powerpc/kernel/head.o
+head-y                         := arch/powerpc/kernel/head_32.o
 head-$(CONFIG_PPC64)           := arch/powerpc/kernel/head_64.o
 head-$(CONFIG_8xx)             := arch/powerpc/kernel/head_8xx.o
 head-$(CONFIG_4xx)             := arch/powerpc/kernel/head_4xx.o
 head-$(CONFIG_44x)             := arch/powerpc/kernel/head_44x.o
 head-$(CONFIG_FSL_BOOKE)       := arch/powerpc/kernel/head_fsl_booke.o
 
-ifeq ($(CONFIG_PPC32),y)
-head-$(CONFIG_6xx)             += arch/powerpc/kernel/idle_6xx.o
-head-$(CONFIG_POWER4)          += arch/powerpc/kernel/idle_power4.o
+head-$(CONFIG_PPC64)           += arch/powerpc/kernel/entry_64.o
 head-$(CONFIG_PPC_FPU)         += arch/powerpc/kernel/fpu.o
-endif
 
 core-y                         += arch/powerpc/kernel/ \
                                   arch/$(OLDARCH)/kernel/ \
@@ -131,7 +130,6 @@ core-y                              += arch/powerpc/kernel/ \
                                   arch/powerpc/lib/ \
                                   arch/powerpc/sysdev/ \
                                   arch/powerpc/platforms/
-core-$(CONFIG_PPC32)           += arch/ppc/syslib/
 core-$(CONFIG_MATH_EMULATION)  += arch/ppc/math-emu/
 core-$(CONFIG_XMON)            += arch/powerpc/xmon/
 core-$(CONFIG_APUS)            += arch/ppc/amiga/
@@ -141,24 +139,34 @@ drivers-$(CONFIG_CPM2)            += arch/ppc/8260_io/
 
 drivers-$(CONFIG_OPROFILE)     += arch/powerpc/oprofile/
 
-BOOT_TARGETS = zImage zImage.initrd znetboot znetboot.initrd vmlinux.sm
-
-.PHONY: $(BOOT_TARGETS)
-
-all: uImage zImage
+defaultimage-$(CONFIG_PPC32)   := uImage zImage
+defaultimage-$(CONFIG_PPC_ISERIES) := vmlinux
+defaultimage-$(CONFIG_PPC_PSERIES) := zImage
+KBUILD_IMAGE := $(defaultimage-y)
+all: $(KBUILD_IMAGE)
 
 CPPFLAGS_vmlinux.lds   := -Upowerpc
 
 # All the instructions talk about "make bzImage".
 bzImage: zImage
 
-boot := arch/$(ARCH)/boot
+BOOT_TARGETS = zImage zImage.initrd znetboot znetboot.initrd vmlinux.sm
+
+.PHONY: $(BOOT_TARGETS)
+
+boot := arch/$(OLDARCH)/boot
 
+# urk
+ifeq ($(CONFIG_PPC64),y)
+$(BOOT_TARGETS): vmlinux
+       $(Q)$(MAKE) ARCH=ppc64 $(build)=$(boot) $(patsubst %,$(boot)/%,$@)
+else
 $(BOOT_TARGETS): vmlinux
-       $(Q)$(MAKE) $(build)=$(boot) $@
+       $(Q)$(MAKE) ARCH=ppc $(build)=$(boot) $@
+endif
 
 uImage: vmlinux
-       $(Q)$(MAKE) $(build)=$(boot)/images $(boot)/images/$@
+       $(Q)$(MAKE) ARCH=$(OLDARCH) $(build)=$(boot)/images $(boot)/images/$@
 
 define archhelp
   @echo '* zImage          - Compressed kernel image (arch/$(ARCH)/boot/images/zImage.*)'
@@ -171,7 +179,7 @@ define archhelp
 endef
 
 archclean:
-       $(Q)$(MAKE) $(clean)=arch/ppc/boot
+       $(Q)$(MAKE) $(clean)=$(boot)
        # Temporary hack until we have migrated to asm-powerpc
        $(Q)rm -rf arch/$(ARCH)/include
 
This page took 0.039522 seconds and 5 git commands to generate.