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

Subversion Repositories plasma

[/] [plasma/] [trunk/] [kernel/] [makefile] - Blame information for rev 308

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

Line No. Rev Author Line
1 246 rhoads
# Makefile for Plasma RTOS and Plasma TCP/IP stack
2
 
3 138 rhoads
# The MIPS gcc compiler must use the cygwin1.dll that came with the compiler.
4
 
5 201 rhoads
# Customize for Linux
6
#CC_X86 = gcc -Wall -O -g
7
#CP = cp
8
#RM = rm -rf
9
#BIN_MIPS = ../../mips/sde/bin
10
#VHDL_DIR = ../vhdl
11
#GCC_MIPS  = $(BIN_MIPS)/gcc $(CFLAGS)
12
#AS_MIPS   = $(BIN_MIPS)/as
13
#LD_MIPS   = $(BIN_MIPS)/ld
14
#DUMP_MIPS = $(BIN_MIPS)/objdump
15
 
16
# Customize for Windows
17 246 rhoads
CC_X86 = cl /O1 /DWIN32 /I..\tools /nologo
18 201 rhoads
CP = copy
19
RM = del
20
BIN_MIPS = ..\gccmips_elf
21
VHDL_DIR = ..\vhdl
22
GCC_MIPS  = $(BIN_MIPS)\gcc $(CFLAGS)
23
AS_MIPS   = $(BIN_MIPS)\as
24
LD_MIPS   = $(BIN_MIPS)\ld
25
DUMP_MIPS = $(BIN_MIPS)\objdump
26
 
27 198 rhoads
# Use software multiplier (don't use mult.vhd)
28
CFLAGS_SW_MULT = -mno-mul -DUSE_SW_MULT
29
 
30
# Use 16 fewer registers (make reg_bank.vhd smaller)
31 308 rhoads
CFLAGS_FEW_REGS = -ffixed-t0 -ffixed-t1 -ffixed-t2 -ffixed-t3 -ffixed-t4 -ffixed-t5 -ffixed-t6 -ffixed-t7 -ffixed-s0 -ffixed-s1 -ffixed-s2 -ffixed-s3 -ffixed-s4 -ffixed-s5 -ffixed-s6 -ffixed-s7
32 198 rhoads
 
33 308 rhoads
CFLAGS = -O2 -Wall -c -s -I..\tools -msoft-float
34
#CFLAGS += $(CFLAGS_SW_MULT)
35
#CFLAGS += $(CFLAGS_FEW_REGS)
36 138 rhoads
 
37 246 rhoads
# Build just the Plasma RTOS for Plasma CPU
38 138 rhoads
rtos:
39
        $(AS_MIPS) -o boot.o ..\tools\boot.asm
40
        $(GCC_MIPS) rtos.c
41
        $(GCC_MIPS) libc.c
42
        $(GCC_MIPS) uart.c
43
        $(GCC_MIPS) rtos_test.c
44
        $(GCC_MIPS) math.c
45 191 rhoads
        $(LD_MIPS) -Ttext 0x10000000 -eentry -Map test.map -s -N -o test.axf \
46 222 rhoads
        boot.o rtos.o libc.o uart.o rtos_test.o math.o
47 153 rhoads
        ..\tools\convert_bin
48
        @sort test2.map
49 191 rhoads
        @$(DUMP_MIPS) --disassemble test.axf > test.lst
50 138 rhoads
 
51 308 rhoads
rtos_nomult:
52
        $(AS_MIPS) -o boot.o ..\tools\boot.asm
53
        $(AS_MIPS) -o mult_sim.o ..\tools\mult_sim.asm
54
        $(GCC_MIPS) rtos.c
55
        $(GCC_MIPS) libc.c
56
        $(GCC_MIPS) uart.c
57
        $(GCC_MIPS) rtos_test.c
58
        $(GCC_MIPS) math.c
59
        $(LD_MIPS) -Ttext 0x10000000 -eentry -Map test.map -s -N -o test.axf \
60
        boot.o rtos.o libc.o uart.o rtos_test.o math.o mult_sim.o
61
        @sort test2.map
62
        @$(DUMP_MIPS) --disassemble test.axf > test.lst
63
        ..\tools\nomult test.axf test.lst test.map
64
        @$(DUMP_MIPS) --disassemble test.axf > test2.lst
65
        ..\tools\convert_bin
66
 
67 246 rhoads
# Build the Plasma RTOS, Plasma TCP/IP stack, and web server for the Plasma CPU
68
rtos_tcpip:
69
        $(AS_MIPS) -o boot.o ..\tools\boot.asm
70
        $(GCC_MIPS) rtos.c
71
        $(GCC_MIPS) libc.c
72
        $(GCC_MIPS) uart.c
73
        $(GCC_MIPS) rtos_test.c -DINCLUDE_HTML -DINCLUDE_CONSOLE
74
        $(GCC_MIPS) math.c
75
        $(GCC_MIPS) tcpip.c
76
        $(GCC_MIPS) http.c -DINCLUDE_FILESYS -DEXAMPLE_HTML
77
        $(GCC_MIPS) netutil.c
78
        $(GCC_MIPS) filesys.c
79
        $(LD_MIPS) -Ttext 0x10000000 -eentry -Map test.map -s -N -o test.axf \
80
        boot.o rtos.o libc.o uart.o rtos_test.o math.o tcpip.o \
81
        http.o netutil.o filesys.o
82
        ..\tools\convert_bin
83
        @sort test2.map
84
        @$(DUMP_MIPS) --disassemble test.axf > test.lst
85
 
86 297 rhoads
rtos_tcpip_eth:
87
        $(AS_MIPS) -o boot.o ..\tools\boot.asm
88
        $(GCC_MIPS) rtos.c
89
        $(GCC_MIPS) libc.c
90
        $(GCC_MIPS) uart.c -DNO_PACKETS
91
        $(GCC_MIPS) rtos_test.c -DINCLUDE_ETH -DINCLUDE_CONSOLE
92
        $(GCC_MIPS) math.c
93
        $(GCC_MIPS) tcpip.c
94
        $(GCC_MIPS) http.c -DINCLUDE_FILESYS -DEXAMPLE_HTML
95
        $(GCC_MIPS) netutil.c
96
        $(GCC_MIPS) filesys.c
97
        $(GCC_MIPS) ethernet.c
98
        $(LD_MIPS) -Ttext 0x10000000 -eentry -Map test.map -s -N -o test.axf \
99
        boot.o rtos.o libc.o uart.o rtos_test.o math.o tcpip.o \
100
        http.o netutil.o filesys.o ethernet.o
101
        ..\tools\convert_bin
102
        @sort test2.map
103
        @$(DUMP_MIPS) --disassemble test.axf > test.lst
104
 
105 246 rhoads
# Build full test application
106 297 rhoads
rtosuart:
107 222 rhoads
        $(AS_MIPS) -o boot.o ..\tools\boot.asm
108
        $(GCC_MIPS) rtos.c
109
        $(GCC_MIPS) libc.c
110
        $(GCC_MIPS) uart.c
111
        $(GCC_MIPS) rtos_test.c -DINCLUDE_HTML -DINCLUDE_CONSOLE
112
        $(GCC_MIPS) math.c
113
        $(GCC_MIPS) tcpip.c
114 236 rhoads
        $(GCC_MIPS) http.c -DINCLUDE_FILESYS
115 222 rhoads
        $(GCC_MIPS) netutil.c
116
        $(GCC_MIPS) filesys.c
117
        $(GCC_MIPS) -I. ..\app\html.c -DMainThread=HtmlThread
118
        $(GCC_MIPS) -I. ..\app\image.c
119
        $(GCC_MIPS) -I. ..\app\tictac.c
120
        $(GCC_MIPS) -I. ..\app\tic3d.c
121
        $(GCC_MIPS) -I. ..\app\connect4.c
122
        $(LD_MIPS) -Ttext 0x10000000 -eentry -Map test.map -s -N -o test.axf \
123
        boot.o rtos.o libc.o uart.o rtos_test.o math.o tcpip.o \
124 297 rhoads
        http.o netutil.o filesys.o html.o image.o tictac.o tic3d.o connect4.o
125 222 rhoads
        ..\tools\convert_bin
126
        @sort test2.map
127
        @$(DUMP_MIPS) --disassemble test.axf > test.lst
128
 
129 297 rhoads
# Build full test application
130
rtosfull:
131
        $(AS_MIPS) -o boot.o ..\tools\boot.asm
132
        $(GCC_MIPS) rtos.c
133
        $(GCC_MIPS) libc.c
134
        $(GCC_MIPS) uart.c -DNO_PACKETS
135
        $(GCC_MIPS) rtos_test.c -DINCLUDE_ETH -DINCLUDE_CONSOLE
136
        $(GCC_MIPS) math.c
137
        $(GCC_MIPS) tcpip.c
138
        $(GCC_MIPS) http.c -DINCLUDE_FILESYS
139 302 rhoads
        $(GCC_MIPS) netutil.c -DINCLUDE_FLASH
140
        $(GCC_MIPS) filesys.c -DINCLUDE_FLASH
141 297 rhoads
        $(GCC_MIPS) ethernet.c
142
        $(GCC_MIPS) flash.c
143
        $(GCC_MIPS) -I. ..\app\html.c -DMainThread=HtmlThread
144
        $(GCC_MIPS) -I. ..\app\image.c
145
        $(GCC_MIPS) -I. ..\app\tictac.c
146
        $(GCC_MIPS) -I. ..\app\tic3d.c
147
        $(GCC_MIPS) -I. ..\app\connect4.c
148
        $(LD_MIPS) -Ttext 0x10000000 -eentry -Map test.map -s -N -o test.axf \
149
        boot.o rtos.o libc.o uart.o rtos_test.o math.o tcpip.o \
150
        http.o netutil.o filesys.o ethernet.o flash.o \
151
        html.o image.o tictac.o tic3d.o connect4.o
152
        ..\tools\convert_bin
153
        @sort test2.map
154
        @$(DUMP_MIPS) --disassemble test.axf > test.lst
155
 
156 246 rhoads
# Test the RTOS running on a PC
157
testrtos:
158
        @$(CC_X86) /c rtos.c
159
        @$(CC_X86) /c libc.c
160
        @$(CC_X86) /c uart.c
161
        @$(CC_X86) /c rtos_test.c
162
        @$(CC_X86) /c math.c
163
        @$(CC_X86) -o testrtos.exe rtos.obj libc.obj uart.obj rtos_test.obj math.obj
164
        testrtos.exe
165
 
166
# Test the TCP/IP protocol stack running on a PC
167
testip:
168
        @$(CC_X86) /c tcpip.c
169
        @$(CC_X86) /c http.c /DEXAMPLE_HTML
170
        @$(CC_X86) /c netutil.c
171
        @$(CC_X86) /c filesys.c
172
        @$(CC_X86) /c libc.c /I..\tools
173
        @$(CC_X86) /c /DSIMULATE_PLASMA ..\tools\etermip.c
174 302 rhoads
        @$(CC_X86) /c os_stubs.c
175 246 rhoads
        @$(CC_X86) -o testip.exe etermip.obj ..\tools\wpcap.lib \
176 302 rhoads
        tcpip.obj http.obj netutil.obj filesys.obj libc.c os_stubs.c
177 246 rhoads
        @echo Try http://plasmb/.  Try telnet plasmb.  Try ftp plasmb.
178
        testip.exe
179
 
180 145 rhoads
clean:
181 246 rhoads
        -$(RM) *.o *.obj *.axf *.map *.lst *.hex *.txt *.bin *.exe
182 138 rhoads
 
183 246 rhoads
# Run a Plasma CPU opcode simulator (can execute rtos target)
184 138 rhoads
run:
185
        @..\tools\mlite test.bin
186
 
187
disassemble:
188
        -@..\tools\mlite test.bin BD > test.txt
189
 
190 246 rhoads
# Start the EtermIP terminal program to download the code to the Plasma CPU
191
# and permit an Ethernet packets to be transfered.
192
download:
193
        @echo Reset board before downloading code
194
        ..\tools\etermip
195 138 rhoads
 
196 246 rhoads
 

powered by: WebSVN 2.1.0

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