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 ifeq ($(shell uname -m),ppc64)
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)
25 LD := $(LD) -m elf64ppc
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 \
34 CPP = $(CC) -E $(CFLAGS)
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)
38 ifeq ($(HAVE_ZERO_BSS),y)
39 CFLAGS += -fno-zero-initialized-in-bss
42 HEAD := arch/ppc64/kernel/head.o
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)
50 SUBDIRS += arch/ppc64/xmon
51 CORE_FILES += arch/ppc64/xmon/x.o
54 MAKEBOOT = $(MAKE) -C arch/$(ARCH)/boot
57 @$(MAKE) -C arch/$(ARCH)/kernel checks
59 ifdef CONFIG_PPC_PSERIES
60 BOOT_TARGETS = zImage znetboot.initrd zImage.initrd
63 ifdef CONFIG_PPC_ISERIES
64 BOOT_TARGETS = vmlinux.sminitrd vmlinux.initrd vmlinux.sm
67 $(BOOT_TARGETS): vmlinux
72 cp -f vmlinux /tftpboot/vmlinux.smp
74 cp -f vmlinux /tftpboot/vmlinux
78 %_config: arch/ppc64/configs/%_defconfig
79 rm -f .config arch/ppc64/defconfig
80 cp -f arch/ppc64/configs/$(@:config=defconfig) arch/ppc64/defconfig
83 rm -f arch/ppc64/kernel/{ppc_defs.h,checks,mk_defs.s,mk_defs_out.c,mk_defs_tpl}