clean
[linux-2.4.21-pre4.git] / arch / ppc / Makefile
1 # BK Id: SCCS/s.Makefile 1.38 11/13/01 08:50:13 trini
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
18 ifdef CONFIG_KERNEL_START_BOOL
19 KERNELLOAD      =$(CONFIG_KERNEL_START)
20 else
21 KERNELLOAD      =0xc0000000
22 endif
23
24 ifeq ($(shell uname -m),ppc)
25 CHECKS          = checks
26 endif
27
28 LINKFLAGS       = -T arch/ppc/vmlinux.lds -Ttext $(KERNELLOAD) -Bstatic
29 CPPFLAGS        := $(CPPFLAGS) -I$(TOPDIR)/arch/$(ARCH)
30 AFLAGS          := $(AFLAGS) -I$(TOPDIR)/arch/$(ARCH)
31 CFLAGS          := $(CFLAGS) -I$(TOPDIR)/arch/$(ARCH) -fsigned-char \
32                 -msoft-float -pipe -ffixed-r2 -Wno-uninitialized \
33                 -mmultiple -mstring
34 HOSTCFLAGS      += -I$(TOPDIR)/arch/$(ARCH)
35 CPP             = $(CC) -E $(CFLAGS)
36
37 ifdef CONFIG_4xx
38 CFLAGS := $(CFLAGS) -Wa,-m405
39 endif
40
41 ifdef CONFIG_PPC64BRIDGE
42 CFLAGS := $(CFLAGS) -Wa,-mppc64bridge
43 endif
44
45 ifdef CONFIG_MORE_COMPILE_OPTIONS
46 # Use sed to remove the quotes.
47   CFLAGS += $(shell echo $(CONFIG_COMPILE_OPTIONS) | sed -e 's/"//g')
48 endif
49
50 ifdef CONFIG_40x
51   HEAD := arch/ppc/kernel/head_4xx.o
52 else
53   ifdef CONFIG_440
54     HEAD := arch/ppc/kernel/head_440.o
55   else
56     ifdef CONFIG_8xx
57       HEAD := arch/ppc/kernel/head_8xx.o
58     else
59       ifdef CONFIG_PPC_ISERIES
60         HEAD := arch/ppc/kernel/iSeries_head.o
61       else
62         HEAD := arch/ppc/kernel/head.o
63         ifdef CONFIG_6xx
64           HEAD += arch/ppc/kernel/idle_6xx.o
65         endif
66       endif
67     endif
68   endif
69 endif
70 ARCH_SUBDIRS = arch/ppc/kernel arch/ppc/platforms arch/ppc/mm arch/ppc/lib
71 SUBDIRS := $(SUBDIRS) $(ARCH_SUBDIRS)
72 CORE_FILES := arch/ppc/kernel/kernel.o arch/ppc/platforms/platform.o \
73         arch/ppc/mm/mm.o arch/ppc/lib/lib.o $(CORE_FILES)
74
75 ifdef CONFIG_MATH_EMULATION
76 SUBDIRS += arch/ppc/math-emu
77 CORE_FILES += arch/ppc/math-emu/math-emu.o
78 endif
79
80 ifdef CONFIG_XMON
81 SUBDIRS += arch/ppc/xmon
82 CORE_FILES += arch/ppc/xmon/x.o
83 endif
84
85 MAKEBOOT = $(MAKE) -C arch/$(ARCH)/boot
86
87 ifdef CONFIG_8xx
88 SUBDIRS += arch/ppc/8xx_io
89 DRIVERS += arch/ppc/8xx_io/8xx_io.o
90 endif
91
92 ifdef CONFIG_8260
93 SUBDIRS += arch/ppc/8260_io
94 DRIVERS += arch/ppc/8260_io/8260_io.o
95 endif
96
97 ifdef CONFIG_40x
98 SUBDIRS += arch/ppc/4xx_io
99 DRIVERS += arch/ppc/4xx_io/4xx_io.o
100 endif
101
102 ifdef CONFIG_APUS
103 SUBDIRS += arch/ppc/amiga
104 CORE_FILES += arch/ppc/amiga/amiga.o
105 endif
106
107 ifdef CONFIG_PPC_ISERIES
108 SUBDIRS += arch/ppc/iSeries
109 CORE_FILES += arch/ppc/iSeries/iSeries.o
110 endif
111
112 checks:
113         @$(MAKE) -C arch/$(ARCH)/kernel checks
114
115 BOOT_TARGETS = zImage zImage.initrd znetboot znetboot.initrd pImage vmlinux.sm
116
117 # All the instructions talk about "make bzImage".
118 bzImage: zImage
119
120 $(BOOT_TARGETS): $(CHECKS) vmlinux
121         @$(MAKEBOOT) $@
122
123 %_config: arch/ppc/configs/%_defconfig
124         rm -f .config arch/ppc/defconfig
125         cp -f arch/ppc/configs/$(@:config=defconfig) arch/ppc/defconfig
126
127 archclean:
128         rm -f arch/ppc/kernel/{mk_defs,ppc_defs.h,find_name,checks}
129         rm -f arch/ppc/iSeries/ReleaseData.h
130         @$(MAKEBOOT) clean
131
132 archmrproper:
133
134 archdep: scripts/mkdep
135         $(MAKEBOOT) fastdep