1 | MIPS_TARGET=mipsel-linux-gnu
|
---|
2 | MIPS_CC_DIR=/usr/local/mipsel/bin
|
---|
3 | MIPS_BINUTILS_DIR=/usr/local/mipsel/bin
|
---|
4 |
|
---|
5 | CC=$(MIPS_CC_DIR)/$(MIPS_TARGET)-gcc
|
---|
6 | AS=$(MIPS_BINUTILS_DIR)/$(MIPS_TARGET)-as
|
---|
7 | LD=$(MIPS_BINUTILS_DIR)/$(MIPS_TARGET)-ld
|
---|
8 | OBJDUMP=$(MIPS_BINUTILS_DIR)/$(MIPS_TARGET)-objdump
|
---|
9 | OBJCOPY=$(MIPS_BINUTILS_DIR)/$(MIPS_TARGET)-objcopy
|
---|
10 | BFD_ARCH=mips
|
---|
11 |
|
---|
12 | DEFS=-DARCH=$(ARCH) -DMACHINE=${MACHINE} -DKERNEL_LOAD_ADDRESS=${KERNEL_LOAD_ADDRESS}
|
---|
13 | CFLAGS=$(DEFS) -mno-abicalls -G 0 -nostdlib -fno-builtin -O2 -fno-zero-initialized-in-bss
|
---|
14 | LFLAGS=-M -N
|
---|
15 | BFD_ARCH=mips
|
---|
16 |
|
---|
17 | # GCC 4.0.1 compiled for mipsEL has problems compiling in
|
---|
18 | # BigEndian mode with the swl/swr/lwl/lwr instructions.
|
---|
19 | # We have to compile it with mips-sgi-irix5 to get it right.
|
---|
20 | ifeq (${MACHINE},indy)
|
---|
21 | MIPS_TARGET=mips-sgi-irix5
|
---|
22 | MIPS_CC_DIR=/usr/local/mips/bin
|
---|
23 | MIPS_BINUTILS_DIR=/usr/local/mips/bin
|
---|
24 |
|
---|
25 | CFLAGS += -EB -DBIG_ENDIAN -DHAVE_FPU -DFPU_LAZY -march=r4600
|
---|
26 | BFD = ecoff-bigmips
|
---|
27 | KERNEL_LOAD_ADDRESS = 0x88002000
|
---|
28 | BFD_NAME=elf32-bigmips
|
---|
29 | endif
|
---|
30 |
|
---|
31 | ifeq (${MACHINE},lgxemul)
|
---|
32 | CFLAGS += -DHAVE_FPU -DFPU_LAZY -mips3
|
---|
33 | BFD = ecoff-littlemips
|
---|
34 | KERNEL_LOAD_ADDRESS = 0x80100000
|
---|
35 | BFD_NAME=elf32-little
|
---|
36 | endif
|
---|
37 |
|
---|
38 | ifeq (${MACHINE},bgxemul)
|
---|
39 | MIPS_TARGET=mips-sgi-irix5
|
---|
40 | MIPS_CC_DIR=/usr/local/mips/bin
|
---|
41 | MIPS_BINUTILS_DIR=/usr/local/mips/bin
|
---|
42 |
|
---|
43 | CFLAGS += -EB -DBIG_ENDIAN -DHAVE_FPU -DFPU_LAZY -mips3
|
---|
44 | BFD = ecoff-bigmips
|
---|
45 | KERNEL_LOAD_ADDRESS = 0x80100000
|
---|
46 | BFD_NAME=elf32-bigmips
|
---|
47 | endif
|
---|
48 |
|
---|
49 | # MSIM needs lwl/swl patch & 4kc instruction patch to work
|
---|
50 | # otherwise add -mmemcpy -mips3
|
---|
51 | ifeq (${MACHINE},msim)
|
---|
52 | BFD = binary
|
---|
53 | CFLAGS += -msoft-float -march=4kc
|
---|
54 | KERNEL_LOAD_ADDRESS = 0x80100000
|
---|
55 | BFD_NAME=elf32-little
|
---|
56 | endif
|
---|
57 |
|
---|
58 | # SIMICS 4kc emulation is broken, although for instructions
|
---|
59 | # that do not bother us
|
---|
60 | ifeq (${MACHINE},simics)
|
---|
61 | BFD = elf32-little
|
---|
62 | CFLAGS += -msoft-float -mips3
|
---|
63 | KERNEL_LOAD_ADDRESS = 0x80100000
|
---|
64 | BFD_NAME=elf32-little
|
---|
65 | endif
|
---|
66 |
|
---|
67 | ../arch/$(ARCH)/_link.ld: ../arch/$(ARCH)/_link.ld.in
|
---|
68 | $(CC) $(CFLAGS) -C -DBFD=${BFD} -E -x c $< | grep -v "^\#" > $@
|
---|
69 |
|
---|
70 | arch_sources= \
|
---|
71 | arch/start.S \
|
---|
72 | arch/context.S \
|
---|
73 | arch/panic.S \
|
---|
74 | arch/mips32.c \
|
---|
75 | arch/dummy.S \
|
---|
76 | arch/console.c \
|
---|
77 | arch/asm.S \
|
---|
78 | arch/exception.c \
|
---|
79 | arch/interrupt.c \
|
---|
80 | arch/cache.c \
|
---|
81 | arch/cpu/cpu.c \
|
---|
82 | arch/mm/frame.c \
|
---|
83 | arch/mm/page.c \
|
---|
84 | arch/mm/tlb.c \
|
---|
85 | arch/fpu_context.c \
|
---|
86 | arch/fmath.c \
|
---|
87 | arch/drivers/arc.c
|
---|