1 # This file is included by the global makefile so that you can add your own
2 # architecture-specific flags and dependencies. Remember to do have actions
3 # for "archclean" and "archdep" for cleaning up and making dependencies for
6 # This file is subject to the terms and conditions of the GNU General Public
7 # License. See the file "COPYING" in the main directory of this archive
10 # Copyright (C) 1994 by Linus Torvalds
11 # Changes for PPC by Gary Thomas
12 # Rewritten by Cort Dougan and Paul Mackerras
13 # Adjusted for PPC64 by Tom Gall
16 KERNELLOAD := 0xc000000000000000
18 HAS_BIARCH := $(call cc-option-yn, -m64)
19 ifeq ($(HAS_BIARCH),y)
21 LD := $(LD) -m elf64ppc
25 new_nm := $(shell if $(NM) --help 2>&1 | grep -- '--synthetic' > /dev/null; then echo y; else echo n; fi)
28 NM := $(NM) --synthetic
31 CHECKFLAGS += -m64 -D__powerpc__
33 LDFLAGS := -m elf64ppc
34 LDFLAGS_vmlinux := -Bstatic -e $(KERNELLOAD) -Ttext $(KERNELLOAD)
35 CFLAGS += -msoft-float -pipe -mminimal-toc -mtraceback=none \
38 ifeq ($(CONFIG_POWER4_ONLY),y)
39 CFLAGS += $(call cc-option,-mcpu=power4)
41 CFLAGS += $(call cc-option,-mtune=power4)
44 # Enable unit-at-a-time mode when possible. It shrinks the
45 # kernel considerably.
46 CFLAGS += $(call cc-option,-fno-unit-at-a-time)
48 head-y := arch/ppc64/kernel/head.o
50 libs-y += arch/ppc64/lib/
51 core-y += arch/ppc64/kernel/
52 core-y += arch/ppc64/mm/
53 core-$(CONFIG_XMON) += arch/ppc64/xmon/
54 drivers-$(CONFIG_OPROFILE) += arch/ppc64/oprofile/
56 boot := arch/ppc64/boot
58 cp vmlinux arch/ppc64/boot/bzImage
60 boottarget-$(CONFIG_PPC_PSERIES) := zImage zImage.initrd zImage.stub
61 boottarget-$(CONFIG_PPC_MAPLE) := zImage zImage.initrd
62 boottarget-$(CONFIG_PPC_ISERIES) := vmlinux.sminitrd vmlinux.initrd vmlinux.sm
63 $(boottarget-y): vmlinux
64 $(Q)$(MAKE) $(build)=$(boot) $(boot)/$@
66 bootimage-$(CONFIG_PPC_PSERIES) := zImage
67 bootimage-$(CONFIG_PPC_MAPLE) := zImage
68 bootimage-$(CONFIG_PPC_ISERIES) := vmlinux
69 BOOTIMAGE := $(bootimage-y)
71 $(Q)$(MAKE) $(build)=$(boot) BOOTIMAGE=$(BOOTIMAGE) $@
76 $(Q)$(MAKE) $(clean)=$(boot)
78 prepare: include/asm-ppc64/offsets.h
80 arch/ppc64/kernel/asm-offsets.s: include/asm include/linux/version.h \
83 include/asm-ppc64/offsets.h: arch/ppc64/kernel/asm-offsets.s
84 $(call filechk,gen-asm-offsets)
87 echo '* zImage - Compressed kernel image (arch/$(ARCH)/boot/zImage)'
88 echo ' zImage.initrd- Compressed kernel image with initrd attached,'
89 echo ' sourced from arch/$(ARCH)/boot/ramdisk.image.gz'
90 echo ' (arch/$(ARCH)/boot/zImage.initrd)'
93 CLEAN_FILES += include/asm-ppc64/offsets.h