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
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
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
24 oformat
= elf32-littlemips
27 tool-prefix
= mips-linux-
28 ifdef CONFIG_MIPS_ECOFF
29 oformat
= ecoff-bigmips
31 oformat
= elf32-bigmips
35 ifdef CONFIG_CROSSCOMPILE
36 CROSS_COMPILE
= $(tool-prefix
)
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
51 ifdef CONFIG_ELF_KERNEL
52 CFLAGS
+= -G
0 -mno-abicalls
-fno-pic
55 ifdef CONFIG_ECOFF_KERNEL
56 CFLAGS
+= -G
0 -mno-abicalls
-fno-pic
57 LINKFLAGS
+= -G
0 -oformat ecoff-littlemips
60 ifdef CONFIG_REMOTE_DEBUG
61 CFLAGS
:= $(CFLAGS
) -g
65 # CPU-dependent compiler/assembler options for optimization.
67 ifdef CONFIG_CPU_R3000
68 CFLAGS
:= $(CFLAGS
) -mcpu
=r3000
-mips1
70 ifdef CONFIG_CPU_R6000
71 CFLAGS
:= $(CFLAGS
) -mcpu
=r6000
-mips2
73 ifdef CONFIG_CPU_R4300
74 CFLAGS
:= $(CFLAGS
) -mcpu
=r4300
-mips2
76 ifdef CONFIG_CPU_R4X00
77 CFLAGS
:= $(CFLAGS
) -mcpu
=r4600
-mips2
79 ifdef CONFIG_CPU_R5000
80 CFLAGS
:= $(CFLAGS
) -mcpu
=r8000
-mips2
82 ifdef CONFIG_CPU_NEVADA
83 CFLAGS
:= $(CFLAGS
) -mcpu
=r8000
-mips2
-mmad
85 ifdef CONFIG_CPU_R8000
86 CFLAGS
:= $(CFLAGS
) -mcpu
=r8000
-mips2
88 ifdef CONFIG_CPU_R10000
89 CFLAGS
:= $(CFLAGS
) -mcpu
=r8000
-mips2
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
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
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
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
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
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
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.
154 ifndef CONFIG_CPU_LITTLE_ENDIAN
155 LINKSCRIPT
= arch
/mips
/ld.script.big
157 LINKSCRIPT
= arch
/mips
/ld.script.little
160 LINKFLAGS
+= -T
$(word 1,$(LINKSCRIPT
))
163 LINKFLAGS
+= -Ttext
$(word 1,$(LOADADDR
))
167 # The pipe options is bad for my low-mem machine
168 # Uncomment this if you want this.
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
187 MAKEBOOT
= $(MAKE
) -C arch
/$(ARCH
)/boot
199 $(MAKE
) -C arch
/$(ARCH
)/kernel
clean
200 $(MAKE
) -C arch
/$(ARCH
)/tools
clean