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