import of upstream 2.4.34.4 from kernel.org
[linux-2.4.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 ifeq ($(shell uname -m),ppc64)
19 CHECKS          = checks
20 endif
21
22 HAS_BIARCH      := $(shell if $(CC) -m64 -S -o /dev/null -xc /dev/null > /dev/null 2>&1; then echo y; else echo n; fi;)
23 ifeq ($(HAS_BIARCH),y)
24 AS              := $(AS) -64
25 LD              := $(LD) -m elf64ppc
26 CC              := $(CC) -m64
27 endif
28
29 LINKFLAGS       = -T arch/ppc64/vmlinux.lds -Bstatic \
30                 -e $(KERNELLOAD) -Ttext $(KERNELLOAD)
31 CFLAGS          := $(CFLAGS) -fsigned-char -msoft-float -pipe \
32                 -Wno-uninitialized -mminimal-toc -fno-builtin \
33                 -mtraceback=full
34 CPP             = $(CC) -E $(CFLAGS)
35
36 HAVE_ZERO_BSS := $(shell if $(CC) -fno-zero-initialized-in-bss -S -o /dev/null -xc /dev/null > /dev/null 2>&1; then echo y; else echo n; fi)
37
38 ifeq ($(HAVE_ZERO_BSS),y)
39 CFLAGS          += -fno-zero-initialized-in-bss
40 endif
41
42 HEAD := arch/ppc64/kernel/head.o
43
44 ARCH_SUBDIRS = arch/ppc64/kernel arch/ppc64/mm arch/ppc64/lib
45 SUBDIRS := $(SUBDIRS) $(ARCH_SUBDIRS)
46 ARCHIVES := arch/ppc64/kernel/kernel.o arch/ppc64/mm/mm.o arch/ppc64/lib/lib.o $(ARCHIVES)
47 CORE_FILES := arch/ppc64/kernel/kernel.o arch/ppc64/mm/mm.o arch/ppc64/lib/lib.o $(CORE_FILES)
48
49 ifdef CONFIG_XMON
50 SUBDIRS += arch/ppc64/xmon
51 CORE_FILES += arch/ppc64/xmon/x.o
52 endif
53
54 MAKEBOOT = $(MAKE) -C arch/$(ARCH)/boot
55
56 checks:
57         @$(MAKE) -C arch/$(ARCH)/kernel checks
58
59 ifdef CONFIG_PPC_PSERIES
60 BOOT_TARGETS = zImage znetboot.initrd zImage.initrd
61 endif
62
63 ifdef CONFIG_PPC_ISERIES
64 BOOT_TARGETS = vmlinux.sminitrd vmlinux.initrd vmlinux.sm
65 endif
66
67 $(BOOT_TARGETS): vmlinux
68         @$(MAKEBOOT) $@
69
70 znetboot: vmlinux
71 ifdef CONFIG_SMP
72         cp -f vmlinux /tftpboot/vmlinux.smp
73 else
74         cp -f vmlinux /tftpboot/vmlinux
75 endif
76         @$(MAKEBOOT) $@
77
78 %_config: arch/ppc64/configs/%_defconfig
79         rm -f .config arch/ppc64/defconfig
80         cp -f arch/ppc64/configs/$(@:config=defconfig) arch/ppc64/defconfig
81
82 archclean:
83         rm -f arch/ppc64/kernel/{ppc_defs.h,checks,mk_defs.s,mk_defs_out.c,mk_defs_tpl}
84         @$(MAKEBOOT) clean
85
86 archmrproper:
87
88 archdep:
89         $(MAKEBOOT) fastdep