ftp://ftp.kernel.org/pub/linux/kernel/v2.6/linux-2.6.6.tar.bz2
[linux-2.6.git] / arch / ppc / Makefile
1 # This file is included by the global makefile so that you can add your own
2 # architecture-specific flags and dependencies.
3 #
4 # This file is subject to the terms and conditions of the GNU General Public
5 # License.  See the file "COPYING" in the main directory of this archive
6 # for more details.
7 #
8 # Copyright (C) 1994 by Linus Torvalds
9 # Changes for PPC by Gary Thomas
10 # Rewritten by Cort Dougan and Paul Mackerras
11 #
12
13 # This must match PAGE_OFFSET in include/asm-ppc/page.h.
14 KERNELLOAD      := $(CONFIG_KERNEL_START)
15
16 LDFLAGS_vmlinux := -Ttext $(KERNELLOAD) -Bstatic
17 CPPFLAGS        += -Iarch/$(ARCH)
18 AFLAGS          += -Iarch/$(ARCH)
19 cflags-y        += -Iarch/$(ARCH) -msoft-float -pipe \
20                 -ffixed-r2 -Wno-uninitialized -mmultiple -mstring
21 CPP             = $(CC) -E $(CFLAGS)
22
23 cflags-$(CONFIG_4xx)            += -Wa,-m405
24 cflags-$(CONFIG_PPC64BRIDGE)    += -Wa,-mppc64bridge
25
26 CFLAGS += $(cflags-y)
27
28
29 head-y                          := arch/ppc/kernel/head.o
30 head-$(CONFIG_8xx)              := arch/ppc/kernel/head_8xx.o
31 head-$(CONFIG_4xx)              := arch/ppc/kernel/head_4xx.o
32 head-$(CONFIG_44x)              := arch/ppc/kernel/head_44x.o
33
34 head-$(CONFIG_6xx)              += arch/ppc/kernel/idle_6xx.o
35 head-$(CONFIG_POWER4)           += arch/ppc/kernel/idle_power4.o
36
37 core-y                          += arch/ppc/kernel/ arch/ppc/platforms/ \
38                                    arch/ppc/mm/ arch/ppc/lib/ arch/ppc/syslib/
39 core-$(CONFIG_4xx)              += arch/ppc/platforms/4xx/
40 core-$(CONFIG_MATH_EMULATION)   += arch/ppc/math-emu/
41 core-$(CONFIG_XMON)             += arch/ppc/xmon/
42 core-$(CONFIG_APUS)             += arch/ppc/amiga/
43 drivers-$(CONFIG_8xx)           += arch/ppc/8xx_io/
44 drivers-$(CONFIG_4xx)           += arch/ppc/4xx_io/
45 drivers-$(CONFIG_8260)          += arch/ppc/8260_io/
46 drivers-$(CONFIG_OCP)           += arch/ppc/ocp/
47
48 BOOT_TARGETS = zImage zImage.initrd znetboot znetboot.initrd vmlinux.sm
49
50 .PHONY: $(BOOT_TARGETS)
51
52 all: zImage
53
54 AFLAGS_vmlinux.lds.o    := -Upowerpc
55
56 # All the instructions talk about "make bzImage".
57 bzImage: zImage
58
59 boot := arch/$(ARCH)/boot
60
61 $(BOOT_TARGETS): vmlinux
62         $(Q)$(MAKE) $(build)=$(boot) $@
63
64 uImage: vmlinux
65         $(Q)$(MAKE) $(build)=$(boot)/images $(boot)/images/$@
66
67 define archhelp
68   @echo '* zImage          - Compressed kernel image (arch/$(ARCH)/boot/images/zImage.*)'
69   @echo '  uImage          - Create a bootable image for U-Boot / PPCBoot'
70   @echo '  install         - Install kernel using'
71   @echo '                    (your) ~/bin/installkernel or'
72   @echo '                    (distribution) /sbin/installkernel or'
73   @echo '                    install to $$(INSTALL_PATH) and run lilo'
74   @echo '  *_defconfig     - Select default config from arch/$(ARCH)/ppc/configs'
75 endef
76
77 archclean:
78         $(Q)$(MAKE) $(clean)=arch/ppc/boot
79
80 prepare: include/asm-$(ARCH)/offsets.h checkbin
81
82 arch/$(ARCH)/kernel/asm-offsets.s: include/asm include/linux/version.h \
83                                    include/config/MARKER
84
85 include/asm-$(ARCH)/offsets.h: arch/$(ARCH)/kernel/asm-offsets.s
86         $(call filechk,gen-asm-offsets)
87
88 ifdef CONFIG_6xx
89 # Ensure this is binutils 2.12.1 (or 2.12.90.0.7) or later
90 NEW_AS  := $(shell echo dssall | $(AS) -o /dev/null >/dev/null 2>&1 ; echo $$?)
91 GOODVER := 2.12.1
92 else
93 NEW_AS  := 0
94 endif
95
96 ifneq ($(NEW_AS),0)
97 checkbin:
98         @echo -n '*** ${VERSION}.${PATCHLEVEL} kernels no longer build'
99         @echo 'correctly with old versions of binutils.'
100         @echo '*** Please upgrade your binutils to ${GOODVER} or newer'
101         @false
102 else
103 checkbin:
104         @true
105 endif
106
107 CLEAN_FILES +=  include/asm-$(ARCH)/offsets.h \
108                 arch/$(ARCH)/kernel/asm-offsets.s