make oldconfig will rebuild these...
[linux-2.4.21-pre4.git] / arch / mips / Makefile
1 #
2 # This file is subject to the terms and conditions of the GNU General Public
3 # License.  See the file "COPYING" in the main directory of this archive
4 # for more details.
5 #
6 # Copyright (C) 1994, 1995, 1996 by Ralf Baechle
7 # DECStation modifications by Paul M. Antoine, 1996
8 # Copyright (C) 2002  Maciej W. Rozycki
9 #
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
14 #
15
16 #
17 # Select the object file format to substitute into the linker script.
18 #
19 ifdef CONFIG_CPU_LITTLE_ENDIAN
20 tool-prefix     = mipsel-linux-
21 else
22 tool-prefix     = mips-linux-
23 endif
24
25 ifdef CONFIG_CROSSCOMPILE
26 CROSS_COMPILE   = $(tool-prefix)
27 endif
28
29 #
30 # GCC uses -G 0 -mabicalls -fpic as default.  We don't want PIC in the kernel
31 # code since it only slows down the whole thing.  At some point we might make
32 # use of global pointer optimizations but their use of $28 conflicts with
33 # the current pointer optimization.
34 #
35 # The DECStation requires an ECOFF kernel for remote booting, other MIPS
36 # machines may also.  Since BFD is incredibly buggy with respect to
37 # crossformat linking we rely on the elf2ecoff tool for format conversion.
38 #
39 GCCFLAGS        := -I $(TOPDIR)/include/asm/gcc
40 GCCFLAGS        += -G 0 -mno-abicalls -fno-pic -pipe
41 LINKFLAGS       += -G 0 -static # -N
42 MODFLAGS        += -mlong-calls
43
44 ifdef CONFIG_REMOTE_DEBUG
45 GCCFLAGS        += -g
46 endif
47
48 #
49 # CPU-dependent compiler/assembler options for optimization.
50 #
51 ifdef CONFIG_CPU_R3000
52 GCCFLAGS        += -mcpu=r3000 -mips1
53 endif
54 ifdef CONFIG_CPU_TX39XX
55 GCCFLAGS        += -mcpu=r3000 -mips1
56 endif
57 ifdef CONFIG_CPU_R6000
58 GCCFLAGS        += -mcpu=r6000 -mips2 -Wa,--trap
59 endif
60 ifdef CONFIG_CPU_R4300
61 GCCFLAGS        += -mcpu=r4300 -mips2 -Wa,--trap
62 endif
63 ifdef CONFIG_CPU_VR41XX
64 GCCFLAGS        += -mcpu=r4600 -mips2 -Wa,--trap
65 endif
66 ifdef CONFIG_CPU_R4X00
67 GCCFLAGS        += -mcpu=r4600 -mips2 -Wa,--trap
68 endif
69 ifdef CONFIG_CPU_TX49XX
70 GCCFLAGS        += -mcpu=r4600 -mips2 -Wa,--trap
71 endif
72 ifdef CONFIG_CPU_MIPS32
73 GCCFLAGS        += -mcpu=r4600 -mips2 -Wa,--trap
74 endif
75 ifdef CONFIG_CPU_MIPS64
76 GCCFLAGS        += -mcpu=r4600 -mips2 -Wa,--trap
77 endif
78 ifdef CONFIG_CPU_R5000
79 GCCFLAGS        += -mcpu=r5000 -mips2 -Wa,--trap
80 endif
81 ifdef CONFIG_CPU_R5432
82 GCCFLAGS        += -mcpu=r5000 -mips2 -Wa,--trap
83 endif
84 ifdef CONFIG_CPU_NEVADA
85 # Cannot use -mmad with currently recommended tools
86 GCCFLAGS        += -mcpu=r5000 -mips2 -Wa,--trap
87 endif
88 ifdef CONFIG_CPU_RM7000
89 GCCFLAGS        += -mcpu=r5000 -mips2 -Wa,--trap
90 endif
91 ifdef CONFIG_CPU_SB1
92 GCCFLAGS        += -mcpu=sb1 -mips2 -Wa,--trap
93 ifdef CONFIG_SB1_PASS_1_WORKAROUNDS
94 MODFLAGS        += -msb1-pass1-workarounds
95 endif
96 endif
97
98 AFLAGS          += $(GCCFLAGS)
99 CFLAGS          += $(GCCFLAGS)
100
101
102 #
103 # We unconditionally build the math emulator
104 #
105 CORE_FILES      += arch/mips/math-emu/fpu_emulator.o
106 SUBDIRS         += arch/mips/math-emu
107
108 #
109 # ramdisk/initrd support
110 # You need a compressed ramdisk image, named ramdisk.gz in
111 # arch/mips/ramdisk
112 #
113 ifdef CONFIG_EMBEDDED_RAMDISK
114 CORE_FILES      += arch/mips/ramdisk/ramdisk.o
115 SUBDIRS         += arch/mips/ramdisk
116 endif
117
118
119 #
120 # Board-dependent options and extra files
121 #
122
123 #
124 # Acer PICA 61, Mips Magnum 4000 and Olivetti M700.
125 #
126 ifdef CONFIG_MIPS_JAZZ
127 CORE_FILES      += arch/mips/jazz/jazz.o
128 SUBDIRS         += arch/mips/jazz arch/mips/arc
129 LIBS            += arch/mips/arc/arclib.a
130 LOADADDR        := 0x80080000
131 endif
132
133 #
134 # Au1000 (Alchemy Semi PB1000) eval board
135 #
136 ifdef CONFIG_MIPS_PB1000
137 LIBS            += arch/mips/au1000/pb1000/pb1000.o \
138                    arch/mips/au1000/common/au1000.o
139 SUBDIRS         += arch/mips/au1000/pb1000 arch/mips/au1000/common
140 LOADADDR        := 0x80100000
141 endif
142
143 #
144 # Au1100 (Alchemy Semi PB1100) eval board
145 #
146 ifdef CONFIG_MIPS_PB1100
147 LIBS          += arch/mips/au1000/pb1100/pb1100.o \
148                  arch/mips/au1000/common/au1000.o
149 SUBDIRS       += arch/mips/au1000/pb1100 arch/mips/au1000/common
150 LOADADDR      += 0x80100000
151 endif
152
153 #
154 # Au1500 (Alchemy Semi PB1500) eval board
155 #
156 ifdef CONFIG_MIPS_PB1500
157 LIBS            += arch/mips/au1000/pb1500/pb1500.o \
158                    arch/mips/au1000/common/au1000.o
159 SUBDIRS         += arch/mips/au1000/pb1500 arch/mips/au1000/common
160 LOADADDR        := 0x80100000
161 endif
162
163 #
164 # Algorithmics P4032
165 #
166 ifdef CONFIG_ALGOR_P4032
167 CORE_FILES      += arch/mips/algor/algor.o
168 SUBDIRS         += arch/mips/algor
169 LOADADDR        := 0x80000000
170 endif
171
172 #
173 # Baget/MIPS
174 #
175 ifdef CONFIG_BAGET_MIPS
176 SUBDIRS         += arch/mips/baget arch/mips/baget/prom
177 LIBS            += arch/mips/baget/baget.a arch/mips/baget/prom/bagetlib.a
178 LOADADDR        := 0x80001000
179 endif
180
181 #
182 # Cobalt Server
183 #
184 ifdef CONFIG_MIPS_COBALT
185 SUBDIRS         += arch/mips/cobalt
186 CORE_FILES      += arch/mips/cobalt/cobalt.o
187 LOADADDR        := 0x80080000
188 endif
189
190 #
191 # DECstation family
192 #
193 ifdef CONFIG_DECSTATION
194 CORE_FILES      += arch/mips/dec/dec.o
195 SUBDIRS         += arch/mips/dec arch/mips/dec/prom
196 LIBS            += arch/mips/dec/prom/rexlib.a
197 LOADADDR        := 0x80040000
198 endif
199
200 #
201 # Galileo EV64120 Board
202 #
203 ifdef CONFIG_MIPS_EV64120
204 LIBS            += arch/mips/galileo-boards/ev64120/ev64120.o
205 SUBDIRS         += arch/mips/galileo-boards/ev64120
206 LOADADDR        := 0x80100000
207 endif
208
209 #
210 # Galileo EV96100 Board
211 #
212 ifdef CONFIG_MIPS_EV96100
213 LIBS            += arch/mips/galileo-boards/ev96100/ev96100.o \
214                    arch/mips/galileo-boards/generic/galboards.o
215 SUBDIRS         += arch/mips/galileo-boards/generic \
216                    arch/mips/galileo-boards/ev96100
217 LOADADDR        := 0x80100000
218 endif
219
220 #
221 # Globespan IVR eval board with QED 5231 CPU
222 #
223 ifdef CONFIG_MIPS_IVR
224 LIBS            += arch/mips/ite-boards/ivr/ivr.o \
225                    arch/mips/ite-boards/generic/it8172.o
226 SUBDIRS         += arch/mips/ite-boards/generic arch/mips/ite-boards/ivr
227 LOADADDR        := 0x80100000
228 endif
229
230 #
231 # HP LaserJet
232 #
233 ifdef CONFIG_HP_LASERJET
234 SUBDIRS         += arch/mips/hp-lj
235 LIBS            += arch/mips/hp-lj/hp-lj.o
236 LOADADDR        := 0x80030000
237 endif
238
239 #
240 # ITE 8172 eval board with QED 5231 CPU
241 #
242 ifdef CONFIG_MIPS_ITE8172
243 LIBS            += arch/mips/ite-boards/qed-4n-s01b/ite.o \
244                    arch/mips/ite-boards/generic/it8172.o
245 SUBDIRS         += arch/mips/ite-boards/generic arch/mips/ite-boards/qed-4n-s01b
246 LOADADDR        := 0x80100000
247 endif
248
249 #
250 # MIPS Atlas board
251 #
252 ifdef CONFIG_MIPS_ATLAS
253 LIBS            += arch/mips/mips-boards/atlas/atlas.o \
254                    arch/mips/mips-boards/generic/mipsboards.o
255 SUBDIRS         += arch/mips/mips-boards/generic arch/mips/mips-boards/atlas
256 LOADADDR        := 0x80100000
257 endif
258
259 #
260 # MIPS Malta board
261 #
262 ifdef CONFIG_MIPS_MALTA
263 LIBS            += arch/mips/mips-boards/malta/malta.o \
264                    arch/mips/mips-boards/generic/mipsboards.o
265 SUBDIRS         += arch/mips/mips-boards/malta arch/mips/mips-boards/generic
266 LOADADDR        := 0x80100000
267 endif
268
269 #
270 # MIPS SEAD board
271 #
272 ifdef CONFIG_MIPS_SEAD
273 LIBS            += arch/mips/mips-boards/sead/sead.o \
274                    arch/mips/mips-boards/generic/mipsboards.o
275 SUBDIRS         += arch/mips/mips-boards/generic arch/mips/mips-boards/sead
276 LOADADDR        := 0x80100000
277 endif
278
279 #
280 # Momentum Ocelot board
281 #
282 ifdef CONFIG_MOMENCO_OCELOT
283 # The Ocelot setup.o must be linked early - it does the ioremap() for the
284 # mips_io_port_base.
285 CORE_FILES      += arch/mips/gt64120/common/gt64120.o \
286                    arch/mips/gt64120/momenco_ocelot/momenco_ocelot.o
287 SUBDIRS         += arch/mips/gt64120/common arch/mips/gt64120/momenco_ocelot
288 LOADADDR        := 0x80100000
289 endif
290
291 #
292 # Momentum Ocelot-G board
293 #
294 ifdef CONFIG_MOMENCO_OCELOT_G
295 # The Ocelot-G setup.o must be linked early - it does the ioremap() for the
296 # mips_io_port_base.
297 CORE_FILES      += arch/mips/momentum/ocelot_g/ocelot_g.o
298 SUBDIRS         += arch/mips/momentum/ocelot_g
299 LOADADDR        := 0x80100000
300 endif
301
302 #
303 # NEC DDB Vrc-5074
304 #
305 ifdef CONFIG_DDB5074
306 SUBDIRS         += arch/mips/ddb5xxx/common arch/mips/ddb5xxx/ddb5074
307 LIBS            += arch/mips/ddb5xxx/common/ddb5xxx.o arch/mips/ddb5xxx/ddb5074/ddb5074.o
308 LOADADDR        := 0x80080000
309 endif
310
311 #
312 # NEC DDB Vrc-5476
313 #
314 ifdef CONFIG_DDB5476
315 SUBDIRS         += arch/mips/ddb5xxx/common arch/mips/ddb5xxx/ddb5476
316 LIBS            += arch/mips/ddb5xxx/common/ddb5xxx.o \
317                    arch/mips/ddb5xxx/ddb5476/ddb5476.o
318 LOADADDR        := 0x80080000
319 endif
320
321 #
322 # NEC DDB Vrc-5477
323 #
324 ifdef CONFIG_DDB5477
325 SUBDIRS         += arch/mips/ddb5xxx/common arch/mips/ddb5xxx/ddb5477
326 LIBS            += arch/mips/ddb5xxx/common/ddb5xxx.o \
327                    arch/mips/ddb5xxx/ddb5477/ddb5477.o
328 LOADADDR        := 0x80100000
329 endif
330
331 #
332 # NEC Osprey (vr4181) board
333 #
334 ifdef CONFIG_NEC_OSPREY
335 SUBDIRS         += arch/mips/vr4181/common arch/mips/vr4181/osprey
336 LIBS            += arch/mips/vr4181/common/vr4181.o \
337                    arch/mips/vr4181/osprey/osprey.o
338 LOADADDR        := 0x80002000
339 endif
340
341 #
342 # NEC Eagle/Hawk (VR4122/VR4131) board
343 #
344 ifdef CONFIG_NEC_EAGLE
345 SUBDIRS         += arch/mips/vr41xx/common \
346                    arch/mips/vr41xx/nec-eagle
347 LIBS            += arch/mips/vr41xx/common/vr41xx.o \
348                    arch/mips/vr41xx/nec-eagle/eagle.o
349 LOADADDR        := 0x80000000
350 endif
351
352 #
353 # ZAO Networks Capcella (VR4131)
354 #
355 ifdef CONFIG_ZAO_CAPCELLA
356 SUBDIRS         += arch/mips/vr41xx/common \
357                    arch/mips/vr41xx/zao-capcella
358 LIBS            += arch/mips/vr41xx/common/vr41xx.o \
359                    arch/mips/vr41xx/zao-capcella/capcella.o
360 LOADADDR        := 0x80000000
361 endif
362
363 #
364 # Philips Nino
365 #
366 ifdef CONFIG_NINO
367 CORE_FILES      += arch/mips/philips/nino/nino.o
368 SUBDIRS         += arch/mips/philips/nino
369 LOADADDR        := 0x80000000
370 endif
371
372 #
373 # SGI IP22 (Indy/Indigo2)
374 #
375 ifdef CONFIG_SGI_IP22
376 CORE_FILES      += arch/mips/sgi-ip22/ip22-kern.o
377 LIBS            += arch/mips/arc/arclib.a
378 SUBDIRS         += arch/mips/sgi-ip22 arch/mips/arc
379 #
380 # Set LOADADDR to >= 0x88069000 if you want to leave space for symmon,
381 # 0x88002000 for production kernels.  Note that the value must be
382 # 8kb aligned or the handling of the current variable will break.
383 #
384 LOADADDR        := 0x88002000
385 endif
386
387 #
388 # Sibyte SB1250 SOC
389 #
390 ifdef CONFIG_SIBYTE_SB1250
391 # This is a LIB so that it links at the end, and initcalls are later
392 # the sequence; but it is built as an object so that modules don't get
393 # removed (as happens, even if they have __initcall/module_init)
394 LIBS            += arch/mips/sibyte/sb1250/sb1250.o
395 SUBDIRS         += arch/mips/sibyte/sb1250
396 endif
397
398 #
399 # Sibyte SWARM board
400 #
401 ifdef CONFIG_SIBYTE_SWARM
402 LIBS            += arch/mips/sibyte/swarm/sbswarm.a
403 SUBDIRS         += arch/mips/sibyte/swarm
404 LOADADDR        := 0x80100000
405 endif
406
407 #
408 # Sibyte CFE firmware
409 #
410 ifdef CONFIG_SIBYTE_CFE
411 LIBS            += arch/mips/sibyte/cfe/cfe.a
412 SUBDIRS         += arch/mips/sibyte/cfe
413 endif
414
415 #
416 # SB1 Cache Error handler
417 #
418 ifdef CONFIG_SB1_CACHE_ERROR
419 LIBS            += arch/mips/sibyte/sb1/sb1kern.a
420 SUBDIRS         += arch/mips/sibyte/sb1
421 endif
422
423 #
424 # SNI RM200 PCI
425 #
426 ifdef CONFIG_SNI_RM200_PCI
427 CORE_FILES      += arch/mips/sni/sni.o
428 SUBDIRS         += arch/mips/sni arch/mips/arc
429 LIBS            += arch/mips/arc/arclib.a
430 LOADADDR        := 0x80080000
431 endif
432
433 #
434 # Toshiba JMR-TX3927 board
435 #
436 ifdef CONFIG_TOSHIBA_JMR3927
437 CORE_FILES      += arch/mips/jmr3927/rbhma3100/jmr3927.o \
438                    arch/mips/jmr3927/common/tx3927.o
439 SUBDIRS         += arch/mips/jmr3927/rbhma3100 arch/mips/jmr3927/common
440 LOADADDR        := 0x80050000
441 endif
442
443
444 #
445 # Choosing incompatible machines durings configuration will result in
446 # error messages during linking.  Select a default linkscript if
447 # none has been choosen above.
448 #
449 vmlinux: arch/$(ARCH)/ld.script
450
451 arch/$(ARCH)/ld.script: arch/$(ARCH)/ld.script.in arch/$(ARCH)/Makefile
452         sed -e 's/@@LOADADDR@@/$(LOADADDR)/' <$< >$@
453 LINKFLAGS       += -T arch/$(ARCH)/ld.script
454
455 HEAD := arch/mips/kernel/head.o arch/mips/kernel/init_task.o
456
457 SUBDIRS := $(addprefix arch/mips/, tools) $(SUBDIRS) $(addprefix arch/mips/, kernel mm lib)
458 CORE_FILES := arch/mips/kernel/kernel.o arch/mips/mm/mm.o $(CORE_FILES)
459 LIBS := arch/mips/lib/lib.a $(LIBS)
460
461 ifdef CONFIG_BAGET_MIPS
462
463 BAGETBOOT = $(MAKE) -C arch/$(ARCH)/baget
464
465 balo: vmlinux
466         $(BAGETBOOT) balo
467
468 endif
469
470 ifdef CONFIG_MIPS_EV64120
471 GALILEOBOOT = $(MAKE) -C arch/$(ARCH)/galileo-boards/ev64120
472
473 gboot: vmlinux
474         $(MAKE) -C arch/$(ARCH)/galileo-boards/ev64120/compressed
475 endif
476
477 MAKEBOOT = $(MAKE) -C arch/$(ARCH)/boot
478
479 vmlinux.ecoff: vmlinux
480         @$(MAKEBOOT) $@
481
482 archclean:
483         @$(MAKEBOOT) clean
484         rm -f arch/$(ARCH)/ld.script
485         $(MAKE) -C arch/$(ARCH)/tools clean
486         $(MAKE) -C arch/mips/baget clean
487
488 archmrproper:
489         @$(MAKEBOOT) mrproper
490         $(MAKE) -C arch/$(ARCH)/tools mrproper
491
492 archdep:
493         if [ ! -f $(TOPDIR)/include/asm-$(ARCH)/offset.h ]; then \
494                 touch $(TOPDIR)/include/asm-$(ARCH)/offset.h; \
495         fi;
496         @$(MAKEBOOT) dep