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