vserver 1.9.5.x5
[linux-2.6.git] / arch / ppc64 / Makefile
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
4 # this architecture
5 #
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
8 # for more details.
9 #
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
14 #
15
16 KERNELLOAD      := 0xc000000000000000
17
18 HAS_BIARCH      := $(call cc-option-yn, -m64)
19 ifeq ($(HAS_BIARCH),y)
20 AS              := $(AS) -a64
21 LD              := $(LD) -m elf64ppc
22 CC              := $(CC) -m64
23 endif
24
25 new_nm := $(shell if $(NM) --help 2>&1 | grep -- '--synthetic' > /dev/null; then echo y; else echo n; fi)
26
27 ifeq ($(new_nm),y)
28 NM              := $(NM) --synthetic
29 endif
30
31 CHECKFLAGS      += -m64 -D__powerpc__
32
33 LDFLAGS         := -m elf64ppc
34 LDFLAGS_vmlinux := -Bstatic -e $(KERNELLOAD) -Ttext $(KERNELLOAD)
35 CFLAGS          += -msoft-float -pipe -mminimal-toc -mtraceback=none \
36                    -mcall-aixdesc
37
38 ifeq ($(CONFIG_POWER4_ONLY),y)
39 ifeq ($(CONFIG_ALTIVEC),y)
40         CFLAGS += $(call cc-option,-mcpu=970)
41 else
42         CFLAGS += $(call cc-option,-mcpu=power4)
43 endif
44 else
45         CFLAGS += $(call cc-option,-mtune=power4)
46 endif
47
48 # Enable unit-at-a-time mode when possible. It shrinks the
49 # kernel considerably.
50 CFLAGS += $(call cc-option,-funit-at-a-time)
51
52 head-y := arch/ppc64/kernel/head.o
53
54 libs-y                          += arch/ppc64/lib/
55 core-y                          += arch/ppc64/kernel/
56 core-y                          += arch/ppc64/mm/
57 core-$(CONFIG_XMON)             += arch/ppc64/xmon/
58 drivers-$(CONFIG_OPROFILE)      += arch/ppc64/oprofile/
59
60 boot := arch/ppc64/boot
61
62 boottarget-$(CONFIG_PPC_PSERIES) := zImage zImage.initrd
63 boottarget-$(CONFIG_PPC_MAPLE) := zImage zImage.initrd
64 boottarget-$(CONFIG_PPC_ISERIES) := vmlinux.sminitrd vmlinux.initrd vmlinux.sm
65 $(boottarget-y): vmlinux
66         $(Q)$(MAKE) $(build)=$(boot) $(boot)/$@
67
68 bootimage-$(CONFIG_PPC_PSERIES) := zImage
69 bootimage-$(CONFIG_PPC_MAPLE) := zImage
70 bootimage-$(CONFIG_PPC_ISERIES) := vmlinux
71 BOOTIMAGE := $(bootimage-y)
72 install: vmlinux
73         $(Q)$(MAKE) $(build)=$(boot) BOOTIMAGE=$(BOOTIMAGE) $@
74
75 all: $(BOOTIMAGE)
76
77 archclean:
78         $(Q)$(MAKE) $(clean)=$(boot)
79
80 prepare: include/asm-ppc64/offsets.h
81
82 arch/ppc64/kernel/asm-offsets.s: include/asm include/linux/version.h \
83                                    include/config/MARKER
84
85 include/asm-ppc64/offsets.h: arch/ppc64/kernel/asm-offsets.s
86         $(call filechk,gen-asm-offsets)
87
88 define archhelp
89   echo  '* zImage       - Compressed kernel image (arch/$(ARCH)/boot/zImage)'
90   echo  '  zImage.initrd- Compressed kernel image with initrd attached,'
91   echo  '                  sourced from arch/$(ARCH)/boot/ramdisk.image.gz'
92   echo  '                  (arch/$(ARCH)/boot/zImage.initrd)'
93 endef
94
95 CLEAN_FILES += include/asm-ppc64/offsets.h