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

Subversion Repositories plasma

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

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

powered by: WebSVN 2.1.0

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