1# BK Id: %F% %I% %G% %U% %#%
2#
3# This file is included by the global makefile so that you can add your own
4# architecture-specific flags and dependencies. Remember to do have actions
5# for "archclean" and "archdep" for cleaning up and making dependencies for
6# this architecture
7#
8# This file is subject to the terms and conditions of the GNU General Public
9# License.  See the file "COPYING" in the main directory of this archive
10# for more details.
11#
12# Copyright (C) 1994 by Linus Torvalds
13# Changes for PPC by Gary Thomas
14# Rewritten by Cort Dougan and Paul Mackerras
15#
16
17# Be sure to change PAGE_OFFSET in include/asm-ppc/page.h to match
18KERNELLOAD	=0xc0000000
19
20ifeq ($(shell uname -m),ppc)
21CHECKS		= checks
22endif
23
24LINKFLAGS	= -T arch/ppc/vmlinux.lds -Ttext $(KERNELLOAD) -Bstatic
25CPPFLAGS	:= $(CPPFLAGS) -I$(TOPDIR)/arch/$(ARCH)
26AFLAGS		:= $(AFLAGS) -I$(TOPDIR)/arch/$(ARCH)
27CFLAGS		:= $(CFLAGS) -I$(TOPDIR)/arch/$(ARCH) -fsigned-char \
28		-msoft-float -pipe -ffixed-r2 -Wno-uninitialized \
29		-mmultiple -mstring
30HOSTCFLAGS	+= -I$(TOPDIR)/arch/$(ARCH)
31CPP		= $(CC) -E $(CFLAGS)
32
33ifdef CONFIG_4xx
34CFLAGS := $(CFLAGS) -Wa,-m405
35endif
36
37ifdef CONFIG_8xx
38CFLAGS := $(CFLAGS) -mcpu=860
39endif
40
41ifdef CONFIG_PPC64BRIDGE
42CFLAGS := $(CFLAGS) -Wa,-mppc64bridge
43endif
44
45ifdef CONFIG_MORE_COMPILE_OPTIONS
46# Use sed to remove the quotes.
47  CFLAGS += $(shell echo $(CONFIG_COMPILE_OPTIONS) | sed -e 's/"//g')
48endif
49
50ifdef CONFIG_4xx
51  HEAD := arch/ppc/kernel/head_4xx.o
52else
53  ifdef CONFIG_8xx
54    HEAD := arch/ppc/kernel/head_8xx.o
55  else
56    HEAD := arch/ppc/kernel/head.o
57    ifdef CONFIG_6xx
58	HEAD += arch/ppc/kernel/idle_6xx.o
59    endif
60  endif
61endif
62
63ARCH_SUBDIRS = arch/ppc/kernel arch/ppc/platforms arch/ppc/mm arch/ppc/lib
64SUBDIRS := $(SUBDIRS) $(ARCH_SUBDIRS)
65CORE_FILES := arch/ppc/kernel/kernel.o arch/ppc/platforms/platform.o \
66	arch/ppc/mm/mm.o arch/ppc/lib/lib.o $(CORE_FILES)
67
68ifdef CONFIG_MATH_EMULATION
69SUBDIRS += arch/ppc/math-emu
70CORE_FILES += arch/ppc/math-emu/math-emu.o
71endif
72
73ifdef CONFIG_XMON
74SUBDIRS += arch/ppc/xmon
75CORE_FILES += arch/ppc/xmon/x.o
76endif
77
78MAKEBOOT = $(MAKE) -C arch/$(ARCH)/boot
79
80ifdef CONFIG_8xx
81SUBDIRS += arch/ppc/8xx_io
82DRIVERS += arch/ppc/8xx_io/8xx_io.o
83endif
84
85ifdef CONFIG_8260
86SUBDIRS += arch/ppc/8260_io
87DRIVERS += arch/ppc/8260_io/8260_io.o
88endif
89
90ifdef CONFIG_APUS
91SUBDIRS += arch/ppc/amiga
92CORE_FILES += arch/ppc/amiga/amiga.o
93endif
94
95checks:
96	@$(MAKE) -C arch/$(ARCH)/kernel checks
97
98BOOT_TARGETS = zImage zImage.initrd znetboot znetboot.initrd
99
100# All the instructions talk about "make bzImage".
101bzImage: zImage
102
103$(BOOT_TARGETS): $(CHECKS) vmlinux
104	@$(MAKEBOOT) $@
105
106%_config: arch/ppc/configs/%_defconfig
107	rm -f .config arch/ppc/defconfig
108	cp -f arch/ppc/configs/$(@:config=defconfig) arch/ppc/defconfig
109
110archclean:
111	rm -f arch/ppc/kernel/{mk_defs,ppc_defs.h,find_name,checks}
112	@$(MAKEBOOT) clean
113
114archmrproper:
115
116archdep: scripts/mkdep
117	$(MAKEBOOT) fastdep
118