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

Subversion Repositories plasma

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

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

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

powered by: WebSVN 2.1.0

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