Import 2.3.9pre5
[davej-history.git] / arch / mips / Makefile
blobd0e4406dabbfe01207b5952c4fb6fce8963997ac
1 # $Id: Makefile,v 1.13 1998/08/17 10:16:23 ralf Exp $
3 # This file is subject to the terms and conditions of the GNU General Public
4 # License. See the file "COPYING" in the main directory of this archive
5 # for more details.
7 # Copyright (C) 1994, 1995, 1996 by Ralf Baechle
8 # DECStation modifications by Paul M. Antoine, 1996
10 # This file is included by the global makefile so that you can add your own
11 # architecture-specific flags and dependencies. Remember to do have actions
12 # for "archclean" and "archdep" for cleaning up and making dependencies for
13 # this architecture
17 # Select the object file format to substitute into the linker script.
19 ifdef CONFIG_CPU_LITTLE_ENDIAN
20 tool-prefix = mipsel-linux-
21 ifdef CONFIG_MIPS_ECOFF
22 oformat = ecoff-littlemips
23 else
24 oformat = elf32-littlemips
25 endif
26 else
27 tool-prefix = mips-linux-
28 ifdef CONFIG_MIPS_ECOFF
29 oformat = ecoff-bigmips
30 else
31 oformat = elf32-bigmips
32 endif
33 endif
35 ifdef CONFIG_CROSSCOMPILE
36 CROSS_COMPILE = $(tool-prefix)
37 endif
39 LINKFLAGS = -static -N
40 MODFLAGS += -mlong-calls
43 # The new ELF GCC uses -G0 -mabicalls -fpic as default. We don't need PIC
44 # code in the kernel since it only slows down the whole thing. For the
45 # old GCC these options are just the defaults. At some point we might
46 # make use of global pointer optimizations.
48 # The DECStation requires an ECOFF kernel for remote booting, other MIPS
49 # machines may also.
51 ifdef CONFIG_ELF_KERNEL
52 CFLAGS += -G 0 -mno-abicalls -fno-pic
53 LINKFLAGS += -G 0
54 endif
55 ifdef CONFIG_ECOFF_KERNEL
56 CFLAGS += -G 0 -mno-abicalls -fno-pic
57 LINKFLAGS += -G 0 -oformat ecoff-littlemips
58 endif
60 ifdef CONFIG_REMOTE_DEBUG
61 CFLAGS := $(CFLAGS) -g
62 endif
65 # CPU-dependent compiler/assembler options for optimization.
67 ifdef CONFIG_CPU_R3000
68 CFLAGS := $(CFLAGS) -mcpu=r3000 -mips1
69 endif
70 ifdef CONFIG_CPU_R6000
71 CFLAGS := $(CFLAGS) -mcpu=r6000 -mips2
72 endif
73 ifdef CONFIG_CPU_R4300
74 CFLAGS := $(CFLAGS) -mcpu=r4300 -mips2
75 endif
76 ifdef CONFIG_CPU_R4X00
77 CFLAGS := $(CFLAGS) -mcpu=r4600 -mips2
78 endif
79 ifdef CONFIG_CPU_R5000
80 CFLAGS := $(CFLAGS) -mcpu=r8000 -mips2
81 endif
82 ifdef CONFIG_CPU_NEVADA
83 CFLAGS := $(CFLAGS) -mcpu=r8000 -mips2 -mmad
84 endif
85 ifdef CONFIG_CPU_R8000
86 CFLAGS := $(CFLAGS) -mcpu=r8000 -mips2
87 endif
88 ifdef CONFIG_CPU_R10000
89 CFLAGS := $(CFLAGS) -mcpu=r8000 -mips2
90 endif
93 # Board-dependent options and extra files
95 ifdef CONFIG_ALGOR_P4032
96 CORE_FILES += arch/mips/algor/algor.o
97 SUBDIRS += arch/mips/algor
98 #LOADADDR += 0x80000000
99 endif
102 # DECstation family
104 ifdef CONFIG_DECSTATION
105 CORE_FILES += arch/mips/dec/dec.o
106 SUBDIRS += arch/mips/dec arch/mips/dec/prom
107 LIBS += arch/mips/dec/prom/rexlib.a
108 LOADADDR += 0x80040000
109 endif
112 # Acer PICA 61, Mips Magnum 4000 and Olivetti M700.
114 ifdef CONFIG_MIPS_JAZZ
115 CORE_FILES += arch/mips/jazz/jazz.o
116 SUBDIRS += arch/mips/jazz arch/mips/arc
117 LIBS += arch/mips/arc/arclib.a
118 LOADADDR += 0x80080000
119 endif
121 ifdef CONFIG_SNI_RM200_PCI
122 CORE_FILES += arch/mips/sni/sni.o
123 SUBDIRS += arch/mips/sni arch/mips/arc
124 LIBS += arch/mips/arc/arclib.a
125 LOADADDR += 0x80080000
126 endif
128 ifdef CONFIG_SGI
129 LIBS += arch/mips/sgi/kernel/sgikern.a arch/mips/arc/arclib.a
130 SUBDIRS += arch/mips/sgi/kernel arch/mips/arc
132 # Set LOADADDR to >= 0x88069000 if you want to leave space for symmon,
133 # 0x88002000 for production kernels. Note that the value must be
134 # 8kb aligned or the handling of the current variable will break.
136 LOADADDR += 0x88002000
137 HOSTCC = cc
138 endif
141 # Baget/MIPS
143 ifdef CONFIG_BAGET_MIPS
144 SUBDIRS += arch/mips/baget arch/mips/baget/prom
145 LIBS += arch/mips/baget/baget.a arch/mips/baget/prom/bagetlib.a
146 endif
149 # Choosing incompatible machines durings configuration will result in
150 # error messages during linking. Select a default linkscript if
151 # none has been choosen above.
153 ifndef LINKSCRIPT
154 ifndef CONFIG_CPU_LITTLE_ENDIAN
155 LINKSCRIPT = arch/mips/ld.script.big
156 else
157 LINKSCRIPT = arch/mips/ld.script.little
158 endif
159 endif
160 LINKFLAGS += -T $(word 1,$(LINKSCRIPT))
162 ifdef LOADADDR
163 LINKFLAGS += -Ttext $(word 1,$(LOADADDR))
164 endif
167 # The pipe options is bad for my low-mem machine
168 # Uncomment this if you want this.
170 CFLAGS += -pipe
172 HEAD := arch/mips/kernel/head.o arch/mips/kernel/init_task.o
174 SUBDIRS := $(SUBDIRS) $(addprefix arch/mips/, kernel mm lib tools)
175 CORE_FILES := arch/mips/kernel/kernel.o arch/mips/mm/mm.o $(CORE_FILES)
176 LIBS := arch/mips/lib/lib.a $(LIBS)
178 ifdef CONFIG_BAGET_MIPS
180 BAGETBOOT = $(MAKE) -C arch/$(ARCH)/baget
182 balo: vmlinux
183 $(BAGETBOOT) balo
185 endif
187 MAKEBOOT = $(MAKE) -C arch/$(ARCH)/boot
189 zImage: vmlinux
190 @$(MAKEBOOT) zImage
192 compressed: zImage
194 zdisk: vmlinux
195 @$(MAKEBOOT) zdisk
197 archclean:
198 @$(MAKEBOOT) clean
199 $(MAKE) -C arch/$(ARCH)/kernel clean
200 $(MAKE) -C arch/$(ARCH)/tools clean
202 archmrproper:
204 archdep:
205 @$(MAKEBOOT) dep