OpenCores
URL https://opencores.org/ocsvn/mlite/mlite/trunk

Subversion Repositories mlite

[/] [mlite/] [trunk/] [tools/] [makefile] - Blame information for rev 290

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 137 rhoads
# The MIPS gcc compiler must use the cygwin1.dll that came with the compiler.
2
# The CC_X86 is for compiling tools on your PC.
3
# The GCC_MIPS is for compiling code on the target.
4 191 rhoads
# Convert_bin changes test.axf into code.txt which is used by the VHDL.
5 290 rhoads
# Convert_bin == "objcopy -I elf32-big -O binary test.axf test.bin"
6 126 rhoads
 
7 290 rhoads
# Customize for Linux (for Linux GCC compiler see http://buildd.emdebian.org/)
8
# The site http://www.mips.com/ also has a MIPS cross compiler.
9 179 rhoads
#CC_X86 = gcc -Wall -O -g
10
#CP = cp
11
#RM = rm -rf
12 182 rhoads
#BIN_MIPS = ../../mips/sde/bin
13
#VHDL_DIR = ../vhdl
14 193 rhoads
#GCC_MIPS  = $(BIN_MIPS)/gcc $(CFLAGS)
15
#AS_MIPS   = $(BIN_MIPS)/as
16
#LD_MIPS   = $(BIN_MIPS)/ld
17
#DUMP_MIPS = $(BIN_MIPS)/objdump
18 179 rhoads
 
19
# Customize for Windows
20 243 rhoads
CC_X86 = cl /O1 /nologo
21 179 rhoads
CP = copy
22
RM = del
23 193 rhoads
BIN_MIPS = ..\gccmips_elf
24 182 rhoads
VHDL_DIR = ..\vhdl
25 193 rhoads
GCC_MIPS  = $(BIN_MIPS)\gcc $(CFLAGS)
26
AS_MIPS   = $(BIN_MIPS)\as
27
LD_MIPS   = $(BIN_MIPS)\ld
28
DUMP_MIPS = $(BIN_MIPS)\objdump
29 2 rhoads
 
30 200 rhoads
CFLAGS = -O2 -Wall -c -s
31 47 rhoads
 
32 179 rhoads
all: convert_bin.exe tracehex.exe bintohex.exe ram_image.exe
33 243 rhoads
        @echo make targets = count, opcodes, pi, test, run, tohex,\
34
        bootldr, toimage, etermip
35 2 rhoads
 
36 137 rhoads
clean:
37 272 rhoads
        -$(RM) *.o *.obj *.map *.lst *.hex *.txt *.exe *.axf
38 137 rhoads
 
39 290 rhoads
#Same as "objcopy -I elf32-big -O binary test.axf test.bin"
40 137 rhoads
convert_bin.exe: convert.c
41
        @$(CC_X86) -o convert_bin.exe convert.c
42
 
43 170 rhoads
convert_le.exe: convert.c
44
        @$(CC_X86) -DLITTLE_ENDIAN -o convert_le.exe convert.c
45
 
46 41 rhoads
mlite.exe: mlite.c
47 137 rhoads
        @$(CC_X86) -o mlite.exe mlite.c -DWIN32
48 2 rhoads
 
49 7 rhoads
tracehex.exe: tracehex.c
50 137 rhoads
        @$(CC_X86) -o tracehex.exe tracehex.c
51 2 rhoads
 
52 47 rhoads
bintohex.exe: bintohex.c
53 137 rhoads
        @$(CC_X86) -o bintohex.exe bintohex.c
54 47 rhoads
 
55 137 rhoads
ram_image.exe: ram_image.c
56
        @$(CC_X86) -o ram_image.exe ram_image.c
57 47 rhoads
 
58 243 rhoads
# Terminal program that will download a new image and supports Ethernet
59
# traffic over UART.  Get wpcap.lib from http://www.winpcap.org/.
60
etermip: etermip.c
61
        -@$(CC_X86) -o etermip.exe etermip.c wpcap.lib
62
        @echo Get wpcap.lib from http://www.winpcap.org/
63
 
64
download: etermip
65
        @echo Reset board before downloading code
66
        etermip
67
 
68 179 rhoads
opcodes:
69 137 rhoads
        $(AS_MIPS) -o opcodes.o opcodes.asm
70 191 rhoads
        $(LD_MIPS) -Ttext 0 -eentry -Map test.map -s -N -o test.axf opcodes.o
71
        -@$(DUMP_MIPS) --disassemble test.axf > test.lst
72 179 rhoads
        convert_bin.exe
73 182 rhoads
        $(CP) code.txt $(VHDL_DIR)
74 7 rhoads
 
75 179 rhoads
opcodes2:
76 137 rhoads
        $(AS_MIPS) -o opcodes.o opcodes.asm
77 191 rhoads
        $(LD_MIPS) -Ttext 0x10000000 -eentry -Map test.map -s -N -o test.axf opcodes.o
78
        -@$(DUMP_MIPS) --disassemble test.axf > test.lst
79 179 rhoads
        convert_bin.exe
80 182 rhoads
        $(CP) code.txt $(VHDL_DIR)
81 137 rhoads
 
82 179 rhoads
test:
83 137 rhoads
        $(AS_MIPS) -o boot.o boot.asm
84
        $(GCC_MIPS) test.c
85
        $(GCC_MIPS) no_os.c
86 191 rhoads
        $(LD_MIPS) -Ttext 0 -eentry -Map test.map -s -N -o test.axf \
87 137 rhoads
                boot.o test.o no_os.o
88 191 rhoads
        -@$(DUMP_MIPS) --disassemble test.axf > test.lst
89 179 rhoads
        convert_bin.exe
90 182 rhoads
        $(CP) code.txt $(VHDL_DIR)
91 22 rhoads
 
92 179 rhoads
count:
93 137 rhoads
        $(AS_MIPS) -o boot.o boot.asm
94
        $(GCC_MIPS) count.c
95
        $(GCC_MIPS) no_os.c
96 191 rhoads
        $(LD_MIPS) -Ttext 0 -eentry -Map test.map -s -N -o test.axf \
97 137 rhoads
                boot.o count.o no_os.o
98 191 rhoads
        -$(DUMP_MIPS) --disassemble test.axf > test.lst
99 179 rhoads
        convert_bin.exe
100 182 rhoads
        $(CP) code.txt $(VHDL_DIR)
101 32 rhoads
 
102 179 rhoads
count2:
103 137 rhoads
        $(AS_MIPS) -o boot.o boot.asm
104
        $(GCC_MIPS) count.c
105
        $(GCC_MIPS) no_os.c
106 191 rhoads
        $(LD_MIPS) -Ttext 0x10000000 -eentry -Map test.map -s -N -o test.axf \
107 137 rhoads
                boot.o count.o no_os.o
108 191 rhoads
        -$(DUMP_MIPS) --disassemble test.axf > test.lst
109 179 rhoads
        convert_bin.exe
110 182 rhoads
        $(CP) code.txt $(VHDL_DIR)
111 137 rhoads
 
112 272 rhoads
count3:
113
        $(AS_MIPS) -o boot.o boot.asm
114
        $(GCC_MIPS) count.c
115
        $(GCC_MIPS) no_os.c
116
        $(LD_MIPS) -Ttext 0x1000 -eentry -Map test.map -s -N -o test.axf \
117
                boot.o count.o no_os.o
118
        -$(DUMP_MIPS) --disassemble test.axf > test.lst
119
        convert_bin.exe
120
        $(CP) code.txt $(VHDL_DIR)
121
 
122 179 rhoads
pi:
123 137 rhoads
        $(AS_MIPS) -o boot.o boot.asm
124
        $(GCC_MIPS) pi.c
125 191 rhoads
        $(LD_MIPS) -Ttext 0 -eentry -Map test.map -s -N -o test.axf \
126 137 rhoads
                boot.o pi.o
127 191 rhoads
        @$(DUMP_MIPS) --disassemble test.axf > test.lst
128 179 rhoads
        convert_bin.exe
129 182 rhoads
        $(CP) code.txt $(VHDL_DIR)
130 32 rhoads
 
131 179 rhoads
pi2:
132 137 rhoads
        $(AS_MIPS) -o boot.o boot.asm
133
        $(GCC_MIPS) pi.c
134 191 rhoads
        $(LD_MIPS) -Ttext 0x10000000 -eentry -Map test.map -s -N -o test.axf \
135 137 rhoads
                boot.o pi.o
136 191 rhoads
        @$(DUMP_MIPS) --disassemble test.axf > test.lst
137 179 rhoads
        convert_bin.exe
138 182 rhoads
        $(CP) code.txt $(VHDL_DIR)
139 137 rhoads
 
140 272 rhoads
ddr_test:
141
        $(AS_MIPS) -o boot.o boot.asm
142
        $(GCC_MIPS) ddr_init.c -DDDR_TEST_MAIN
143
        $(GCC_MIPS) no_os.c
144
        $(LD_MIPS) -Ttext 0x0 -eentry -Map test.map -s -N -o test.axf \
145
                boot.o ddr_init.o no_os.o
146
        @$(DUMP_MIPS) --disassemble test.axf > test.lst
147
        convert_bin.exe
148
        $(CP) code.txt $(VHDL_DIR)
149
 
150
memtest:
151
        $(AS_MIPS) -o boot.o boot.asm
152
        $(GCC_MIPS) memtest.c
153
        $(LD_MIPS) -Ttext 0x1000 -eentry -o test.axf boot.o memtest.o
154
        convert_bin.exe
155
 
156
memtest2:
157
        $(AS_MIPS) -o boot.o boot.asm
158
        $(GCC_MIPS) -DINIT_DDR memtest.c
159
        $(GCC_MIPS) ddr_init.c
160
        $(LD_MIPS) -Ttext 0x0 -eentry -o test.axf boot.o memtest.o ddr_init.o
161
        convert_bin.exe
162
 
163 290 rhoads
memtest3:
164
        $(AS_MIPS) -o boot.o boot.asm
165
        $(GCC_MIPS) memtest.c
166
        $(LD_MIPS) -Ttext 0x10000000 -eentry -o test.axf boot.o memtest.o
167
        convert_bin.exe
168
 
169 179 rhoads
bootldr:
170 137 rhoads
        $(AS_MIPS) -o boot.o boot.asm
171
        $(GCC_MIPS) bootldr.c
172
        $(GCC_MIPS) no_os.c
173 272 rhoads
        $(GCC_MIPS) -DDLL_DISABLE ddr_init.c
174 191 rhoads
        $(LD_MIPS) -Ttext 0 -eentry -Map test.map -s -N -o test.axf \
175 272 rhoads
                boot.o bootldr.o no_os.o ddr_init.o
176 191 rhoads
        @$(DUMP_MIPS) --disassemble test.axf > test.lst
177 179 rhoads
        convert_bin.exe
178 182 rhoads
        $(CP) code.txt $(VHDL_DIR)
179 290 rhoads
        @echo Next do "make toimage" or "make tohex".
180 137 rhoads
 
181 290 rhoads
bootldr2:
182
        $(AS_MIPS) -o boot.o boot.asm
183
        $(GCC_MIPS) bootldr.c
184
        $(GCC_MIPS) no_os.c
185
        $(GCC_MIPS) -DDLL_DISABLE ddr_init.c
186
        $(LD_MIPS) -Ttext 0x1000 -eentry -Map test.map -s -N -o test.axf \
187
                boot.o bootldr.o no_os.o ddr_init.o
188
        @$(DUMP_MIPS) --disassemble test.axf > test.lst
189
        convert_bin.exe
190
        $(CP) code.txt $(VHDL_DIR)
191
 
192 179 rhoads
bootldr_little_endian: convert_le.exe
193 170 rhoads
        $(AS_MIPS) -EL -o boot.o boot.asm
194
        $(GCC_MIPS) -EL bootldr.c
195
        $(GCC_MIPS) -EL no_os.c
196 272 rhoads
        $(GCC_MIPS) -EL ddr_init.c
197 191 rhoads
        $(LD_MIPS) -EL -Ttext 0 -eentry -Map test.map -s -N -o test.axf \
198 272 rhoads
                boot.o bootldr.o no_os.o ddr_init.o
199 191 rhoads
        @$(DUMP_MIPS) --disassemble test.axf > test.lst
200 179 rhoads
        convert_le.exe
201 182 rhoads
        $(CP) code.txt $(VHDL_DIR)
202 170 rhoads
 
203 137 rhoads
# Run a MIPS opcode simulator
204 41 rhoads
run: mlite.exe
205 179 rhoads
        @mlite.exe test.bin
206 22 rhoads
 
207 170 rhoads
run_little_endian: mlite.exe
208 179 rhoads
        @mlite.exe test.bin L
209 170 rhoads
 
210 243 rhoads
disassemble: mlite.exe
211
        mlite.exe test.bin BD > test.txt
212 22 rhoads
 
213 137 rhoads
# Used by Altera FPGAs for ram image
214 243 rhoads
tohex: bintohex.exe
215
        bintohex.exe test.bin
216 182 rhoads
        $(CP) code*.hex $(VHDL_DIR)
217 137 rhoads
 
218
# Used by Xilinx FPGAs for ram image
219
toimage:
220 179 rhoads
        ram_image.exe ../vhdl/ram_xilinx.vhd ../vhdl/code.txt ../vhdl/ram_image.vhd
221 137 rhoads
 
222
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.