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

Subversion Repositories mlite

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

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
# Convert_bin changes test.exe into code.txt which is used by the VHDL.
5 126 rhoads
 
6 179 rhoads
# Customize for Linux
7
#CC_X86 = gcc -Wall -O -g
8
#CP = cp
9
#RM = rm -rf
10
#BIN_MIPS  =../../mips/sde/bin
11
 
12
# Customize for Windows
13 137 rhoads
CC_X86 = cl /O1
14 179 rhoads
CP = copy
15
RM = del
16
BIN_MIPS  =../gccmips_elf
17 2 rhoads
 
18 137 rhoads
CFLAGS = -O2 -Wall -c -s
19 47 rhoads
 
20 179 rhoads
 
21
GCC_MIPS  = $(BIN_MIPS)/gcc $(CFLAGS)
22
AS_MIPS   = $(BIN_MIPS)/as
23
LD_MIPS   = $(BIN_MIPS)/ld
24
DUMP_MIPS = $(BIN_MIPS)/objdump
25
 
26
all: convert_bin.exe tracehex.exe bintohex.exe ram_image.exe
27 137 rhoads
        @echo make targets = count, opcodes, pi, test, run, tohex, toimage, rtos
28 2 rhoads
 
29 137 rhoads
clean:
30 179 rhoads
        -$(RM) *.o *.obj *.map *.lst *.hex *.txt
31 137 rhoads
 
32
convert_bin.exe: convert.c
33
        @$(CC_X86) -o convert_bin.exe convert.c
34
 
35 170 rhoads
convert_le.exe: convert.c
36
        @$(CC_X86) -DLITTLE_ENDIAN -o convert_le.exe convert.c
37
 
38 41 rhoads
mlite.exe: mlite.c
39 137 rhoads
        @$(CC_X86) -o mlite.exe mlite.c -DWIN32
40 2 rhoads
 
41 7 rhoads
tracehex.exe: tracehex.c
42 137 rhoads
        @$(CC_X86) -o tracehex.exe tracehex.c
43 2 rhoads
 
44 47 rhoads
bintohex.exe: bintohex.c
45 137 rhoads
        @$(CC_X86) -o bintohex.exe bintohex.c
46 47 rhoads
 
47 137 rhoads
ram_image.exe: ram_image.c
48
        @$(CC_X86) -o ram_image.exe ram_image.c
49 47 rhoads
 
50 179 rhoads
opcodes:
51 137 rhoads
        $(AS_MIPS) -o opcodes.o opcodes.asm
52
        $(LD_MIPS) -Ttext 0 -eentry -Map test.map -s -N -o test.exe opcodes.o
53
        -@$(DUMP_MIPS) --disassemble test.exe > test.lst
54 179 rhoads
        convert_bin.exe
55
        $(CP) code.txt ../vhdl
56 7 rhoads
 
57 179 rhoads
opcodes2:
58 137 rhoads
        $(AS_MIPS) -o opcodes.o opcodes.asm
59
        $(LD_MIPS) -Ttext 0x10000000 -eentry -Map test.map -s -N -o test.exe opcodes.o
60
        -@$(DUMP_MIPS) --disassemble test.exe > test.lst
61 179 rhoads
        convert_bin.exe
62
        $(CP) code.txt ../vhdl
63 137 rhoads
 
64 179 rhoads
test:
65 137 rhoads
        $(AS_MIPS) -o boot.o boot.asm
66
        $(GCC_MIPS) test.c
67
        $(GCC_MIPS) no_os.c
68
        $(LD_MIPS) -Ttext 0 -eentry -Map test.map -s -N -o test.exe \
69
                boot.o test.o no_os.o
70
        -@$(DUMP_MIPS) --disassemble test.exe > test.lst
71 179 rhoads
        convert_bin.exe
72
        $(CP) code.txt ../vhdl
73 22 rhoads
 
74 179 rhoads
count:
75 137 rhoads
        $(AS_MIPS) -o boot.o boot.asm
76
        $(GCC_MIPS) count.c
77
        $(GCC_MIPS) no_os.c
78
        $(LD_MIPS) -Ttext 0 -eentry -Map test.map -s -N -o test.exe \
79
                boot.o count.o no_os.o
80
        -$(DUMP_MIPS) --disassemble test.exe > test.lst
81 179 rhoads
        convert_bin.exe
82
        $(CP) code.txt ../vhdl
83 32 rhoads
 
84 179 rhoads
count2:
85 137 rhoads
        $(AS_MIPS) -o boot.o boot.asm
86
        $(GCC_MIPS) count.c
87
        $(GCC_MIPS) no_os.c
88
        $(LD_MIPS) -Ttext 0x10000000 -eentry -Map test.map -s -N -o test.exe \
89
                boot.o count.o no_os.o
90
        -$(DUMP_MIPS) --disassemble test.exe > test.lst
91 179 rhoads
        convert_bin.exe
92
        $(CP) code.txt ../vhdl
93 137 rhoads
 
94 179 rhoads
pi:
95 137 rhoads
        $(AS_MIPS) -o boot.o boot.asm
96
        $(GCC_MIPS) pi.c
97
        $(LD_MIPS) -Ttext 0 -eentry -Map test.map -s -N -o test.exe \
98
                boot.o pi.o
99
        @$(DUMP_MIPS) --disassemble test.exe > test.lst
100 179 rhoads
        convert_bin.exe
101
        $(CP) code.txt ../vhdl
102 32 rhoads
 
103 179 rhoads
pi2:
104 137 rhoads
        $(AS_MIPS) -o boot.o boot.asm
105
        $(GCC_MIPS) pi.c
106
        $(LD_MIPS) -Ttext 0x10000000 -eentry -Map test.map -s -N -o test.exe \
107
                boot.o pi.o
108
        @$(DUMP_MIPS) --disassemble test.exe > test.lst
109 179 rhoads
        convert_bin.exe
110
        $(CP) code.txt ../vhdl
111 137 rhoads
 
112 179 rhoads
bootldr:
113 137 rhoads
        $(AS_MIPS) -o boot.o boot.asm
114
        $(GCC_MIPS) bootldr.c
115
        $(GCC_MIPS) no_os.c
116
        $(LD_MIPS) -Ttext 0 -eentry -Map test.map -s -N -o test.exe \
117
                boot.o bootldr.o no_os.o
118
        @$(DUMP_MIPS) --disassemble test.exe > test.lst
119 179 rhoads
        convert_bin.exe
120
        $(CP) code.txt ../vhdl
121 137 rhoads
 
122 179 rhoads
bootldr_little_endian: convert_le.exe
123 170 rhoads
        $(AS_MIPS) -EL -o boot.o boot.asm
124
        $(GCC_MIPS) -EL bootldr.c
125
        $(GCC_MIPS) -EL no_os.c
126
        $(LD_MIPS) -EL -Ttext 0 -eentry -Map test.map -s -N -o test.exe \
127
                boot.o bootldr.o no_os.o
128
        @$(DUMP_MIPS) --disassemble test.exe > test.lst
129 179 rhoads
        convert_le.exe
130
        $(CP) code.txt ../vhdl
131 170 rhoads
 
132 137 rhoads
# Run a MIPS opcode simulator
133 41 rhoads
run: mlite.exe
134 179 rhoads
        @mlite.exe test.bin
135 22 rhoads
 
136 170 rhoads
run_little_endian: mlite.exe
137 179 rhoads
        @mlite.exe test.bin L
138 170 rhoads
 
139 137 rhoads
disassemble:
140 179 rhoads
        -@mlite.exe test.bin BD > test.txt
141 22 rhoads
 
142 137 rhoads
# Used by Altera FPGAs for ram image
143
tohex:
144 179 rhoads
        bintohex.exe test2.exe
145
        $(CP) code*.hex ../vhdl
146 137 rhoads
 
147
# Used by Xilinx FPGAs for ram image
148
toimage:
149 179 rhoads
        ram_image.exe ../vhdl/ram_xilinx.vhd ../vhdl/code.txt ../vhdl/ram_image.vhd
150 137 rhoads
 
151
 

powered by: WebSVN 2.1.0

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