This commit was manufactured by cvs2svn to create tag
[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      := $(shell if $(CC) -m64 -S -o /dev/null -xc /dev/null > /dev/null 2>&1; then echo y; else echo n; fi;)
19 ifeq ($(HAS_BIARCH),y)
20 AS              := $(AS) -64
21 LD              := $(LD) -m elf64ppc
22 CC              := $(CC) -m64
23 endif
24
25 CHECK           := $(CHECK) -m64 -D__powerpc__=1
26
27 LDFLAGS         := -m elf64ppc
28 LDFLAGS_vmlinux := -Bstatic -e $(KERNELLOAD) -Ttext $(KERNELLOAD)
29 CFLAGS          += -msoft-float -pipe -Wno-uninitialized -mminimal-toc \
30                    -mtraceback=none
31
32 ifeq ($(CONFIG_POWER4_ONLY),y)
33         CFLAGS += $(call check_gcc,-mcpu=power4,)
34 else
35         CFLAGS += $(call check_gcc,-mtune=power4,)
36 endif
37
38 # Enable unit-at-a-time mode when possible. It shrinks the
39 # kernel considerably.
40 CFLAGS += $(call check_gcc,-funit-at-a-time,)
41
42 head-y := arch/ppc64/kernel/head.o
43
44 libs-y                          += arch/ppc64/lib/
45 core-y                          += arch/ppc64/kernel/
46 core-y                          += arch/ppc64/mm/
47 core-$(CONFIG_XMON)             += arch/ppc64/xmon/
48 drivers-$(CONFIG_OPROFILE)      += arch/ppc64/oprofile/
49
50 boot := arch/ppc64/boot
51 bzImage: vmlinux
52         cp vmlinux arch/ppc64/boot/bzImage
53
54 boottarget-$(CONFIG_PPC_PSERIES) := zImage zImage.initrd
55 boottarget-$(CONFIG_PPC_ISERIES) := vmlinux.sminitrd vmlinux.initrd vmlinux.sm
56 $(boottarget-y): vmlinux
57         $(Q)$(MAKE) $(build)=$(boot) $(boot)/$@
58
59 bootimage-$(CONFIG_PPC_PSERIES) := zImage
60 bootimage-$(CONFIG_PPC_ISERIES) := vmlinux
61 BOOTIMAGE := $(bootimage-y)
62 install: vmlinux
63         $(Q)$(MAKE) $(build)=$(boot) BOOTIMAGE=$(BOOTIMAGE) $@
64
65 all: $(BOOTIMAGE)
66
67 archclean:
68         $(Q)$(MAKE) $(clean)=$(boot)
69
70 prepare: include/asm-ppc64/offsets.h
71
72 arch/ppc64/kernel/asm-offsets.s: include/asm include/linux/version.h \
73                                    include/config/MARKER
74
75 include/asm-ppc64/offsets.h: arch/ppc64/kernel/asm-offsets.s
76         $(call filechk,gen-asm-offsets)
77
78 define archhelp
79   echo  '* zImage       - Compressed kernel image (arch/$(ARCH)/boot/zImage)'
80   echo  '  zImage.initrd- Compressed kernel image with initrd attached,'
81   echo  '                  sourced from arch/$(ARCH)/boot/ramdisk.image.gz'
82   echo  '                  (arch/$(ARCH)/boot/zImage.initrd)'
83 endef
84
85 CLEAN_FILES += include/asm-ppc64/offsets.h