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

Subversion Repositories plasma

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

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 411 rhoads
APP_DIR = ..\app\\
15 355 rhoads
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 406 rhoads
LFLAGS_X86 = /MT
25 355 rhoads
 
26
else
27
 
28
# Customized for Linux
29 359 rhoads
# See the GNU GCC tab on the Opencores Plasma page
30 436 rhoads
CC_X86 = gcc -Wall -O -g -I../tools -m32
31 355 rhoads
CP = cp
32
RM = rm -rf
33
DWIN32 =
34
TOOLS_DIR = ../tools/
35
TOOLS2_DIR = ../tools
36 411 rhoads
APP_DIR = ../app/
37 355 rhoads
LINUX_PWD = ./
38
ALIASING  = -fno-strict-aliasing
39 411 rhoads
#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
GCC_MIPS  = $(BIN_MIPS)mips-uclibc-gcc $(CFLAGS)
44
AS_MIPS   = $(BIN_MIPS)mips-uclibc-as
45
LD_MIPS   = $(BIN_MIPS)mips-uclibc-ld
46
DUMP_MIPS = $(BIN_MIPS)mips-uclibc-objdump
47 355 rhoads
CONVERT_BIN = $(TOOLS_DIR)convert_bin.exe
48
#CONVERT_BIN = $(BIN_MIPS)mips-elf-objcopy -I elf32-big -O binary test.axf test.bin
49
OBJ = o
50
CFLAGS_X86 = -c -DWIN32 -DLINUX
51
LFLAGS_X86 = -lm
52
 
53
endif
54
 
55
# Use software multiplier (don't use mult.vhd)
56
CFLAGS_SW_MULT = -mno-mul -DUSE_SW_MULT
57
 
58
# Use 16 fewer registers (make reg_bank.vhd smaller)
59
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
60
 
61 416 rhoads
CFLAGS = -O2 -Wall -c -I$(TOOLS2_DIR) -msoft-float -fno-builtin
62 411 rhoads
CFLAGS += -fno-pic -mips1 -mno-abicalls
63 355 rhoads
#CFLAGS += $(CFLAGS_SW_MULT)
64
#CFLAGS += $(CFLAGS_FEW_REGS)
65 416 rhoads
#CFLAGS += -Wa,-alhs -g
66 355 rhoads
 
67
# Build just the Plasma RTOS for Plasma CPU
68
rtos:
69
        $(AS_MIPS) -o boot.o $(TOOLS_DIR)boot.asm
70
        $(GCC_MIPS) rtos.c
71
        $(GCC_MIPS) libc.c
72
        $(GCC_MIPS) uart.c
73
        $(GCC_MIPS) rtos_test.c
74
        $(GCC_MIPS) math.c $(ALIASING)
75 416 rhoads
        $(LD_MIPS) -Ttext 0x10000000 -eentry -Map test.map \
76
                -s -N -o test.axf \
77
                boot.o rtos.o libc.o uart.o rtos_test.o math.o
78 355 rhoads
        $(CONVERT_BIN)
79
        @sort test2.map
80
        @$(DUMP_MIPS) --disassemble test.axf > test.lst
81
 
82
# Build the Plasma RTOS, Plasma TCP/IP stack, and web server for the Plasma CPU
83 359 rhoads
# Use the serial port and etermip for TCP/IP packets
84 416 rhoads
rtos_tcpip_uart:
85 355 rhoads
        $(AS_MIPS) -o boot.o $(TOOLS_DIR)boot.asm
86
        $(GCC_MIPS) rtos.c
87
        $(GCC_MIPS) libc.c
88 416 rhoads
        $(GCC_MIPS) uart.c -DUART_PACKETS
89
        $(GCC_MIPS) rtos_test.c -DINCLUDE_UART_PACKETS
90 355 rhoads
        $(GCC_MIPS) math.c $(ALIASING)
91 416 rhoads
        $(GCC_MIPS) tcpip.c
92
        $(GCC_MIPS) http.c -DEXAMPLE_HTML
93
        $(GCC_MIPS) netutil.c -DEXCLUDE_FLASH
94
        $(GCC_MIPS) filesys.c -DEXCLUDE_FLASH
95
        $(LD_MIPS) -Ttext 0x10000000 -eentry -Map test.map \
96
                -s -N -o test.axf \
97
                boot.o rtos.o libc.o uart.o rtos_test.o math.o \
98
                tcpip.o http.o netutil.o filesys.o
99 355 rhoads
        $(CONVERT_BIN)
100
        @sort test2.map
101
        @$(DUMP_MIPS) --disassemble test.axf > test.lst
102
 
103 359 rhoads
# Use Ethernet for TCP/IP packets, use flash file system
104 355 rhoads
rtos_tcpip_eth:
105
        $(AS_MIPS) -o boot.o $(TOOLS_DIR)boot.asm
106
        $(GCC_MIPS) rtos.c
107
        $(GCC_MIPS) libc.c
108 416 rhoads
        $(GCC_MIPS) uart.c
109
        $(GCC_MIPS) rtos_test.c -DINCLUDE_ETH
110 355 rhoads
        $(GCC_MIPS) math.c $(ALIASING)
111 416 rhoads
        $(GCC_MIPS) tcpip.c
112
        $(GCC_MIPS) http.c -DEXAMPLE_HTML
113
        $(GCC_MIPS) netutil.c
114
        $(GCC_MIPS) filesys.c
115 355 rhoads
        $(GCC_MIPS) ethernet.c
116 359 rhoads
        $(GCC_MIPS) flash.c
117 416 rhoads
        $(LD_MIPS) -Ttext 0x10000000 -eentry -Map test.map \
118
                -s -N -o test.axf \
119
                boot.o rtos.o libc.o uart.o rtos_test.o math.o \
120
                tcpip.o http.o netutil.o filesys.o ethernet.o flash.o
121 355 rhoads
        $(CONVERT_BIN)
122
        @sort test2.map
123
        @$(DUMP_MIPS) --disassemble test.axf > test.lst
124
 
125 394 rhoads
# Build full test application.  (Use rtos_tcpip_eth instead.)
126 355 rhoads
rtosfull:
127
        $(AS_MIPS) -o boot.o $(TOOLS_DIR)boot.asm
128
        $(GCC_MIPS) rtos.c
129
        $(GCC_MIPS) libc.c
130 416 rhoads
        $(GCC_MIPS) uart.c
131
        $(GCC_MIPS) rtos_test.c -DINCLUDE_ETH
132 355 rhoads
        $(GCC_MIPS) math.c $(ALIASING)
133 416 rhoads
        $(GCC_MIPS) tcpip.c
134
        $(GCC_MIPS) http.c
135
        $(GCC_MIPS) netutil.c
136
        $(GCC_MIPS) filesys.c
137 355 rhoads
        $(GCC_MIPS) ethernet.c
138
        $(GCC_MIPS) flash.c
139
        $(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 416 rhoads
        $(LD_MIPS) -Ttext 0x10000000 -eentry -Map test.map \
145
                -s -N -o test.axf \
146
                boot.o rtos.o libc.o uart.o rtos_test.o math.o \
147
                tcpip.o http.o netutil.o filesys.o ethernet.o \
148
                flash.o html.o image.o tictac.o tic3d.o connect4.o
149 355 rhoads
        $(CONVERT_BIN)
150
        @sort test2.map
151
        @$(DUMP_MIPS) --disassemble test.axf > test.lst
152
 
153 359 rhoads
# Create a separate Dynamically Linked Library executable
154 416 rhoads
# ftp test.bin to /flash/bin/dlltest
155 359 rhoads
# telnet to board and execute "dlltest"
156
dlltest:
157
        $(GCC_MIPS) -G0 dlltest.c
158 416 rhoads
        $(LD_MIPS) -Ttext 0x10100000 -s -N -o dlltest.axf dlltest.o
159
        @echo PlasmaSend > ftp.txt
160
        @echo password >> ftp.txt
161
        @echo send dlltest.axf >> ftp.txt
162
        @echo quit >> ftp.txt
163
        ftp -s:ftp.txt plasma
164 359 rhoads
 
165 416 rhoads
# Test the RTOS running on a PC (requires Windows)
166 355 rhoads
testrtos:
167
        @$(CC_X86) $(CFLAGS_X86) rtos.c
168 402 rhoads
        @$(CC_X86) $(CFLAGS_X86) rtos_ex.c
169 359 rhoads
        @$(CC_X86) $(CFLAGS_X86) libc.c
170 355 rhoads
        @$(CC_X86) $(CFLAGS_X86) rtos_test.c
171
        @$(CC_X86) $(CFLAGS_X86) math.c $(ALIASING)
172 416 rhoads
        @$(CC_X86) $(LFLAGS_X86) -o testrtos.exe rtos.$(OBJ) rtos_ex.$(OBJ) libc.$(OBJ) rtos_test.$(OBJ) math.$(OBJ)
173 355 rhoads
        $(LINUX_PWD)testrtos.exe
174
 
175 364 rhoads
# Test the TCP/IP protocol stack running on a PC (requires Windows)
176 416 rhoads
testip: *.c
177 355 rhoads
        @$(CC_X86) $(CFLAGS_X86) tcpip.c
178
        @$(CC_X86) $(CFLAGS_X86) http.c /DEXAMPLE_HTML
179
        @$(CC_X86) $(CFLAGS_X86) netutil.c
180 416 rhoads
        @$(CC_X86) $(CFLAGS_X86) filesys.c /DEXCLUDE_FLASH
181 359 rhoads
        @$(CC_X86) $(CFLAGS_X86) libc.c /I$(TOOLS_DIR)
182 355 rhoads
        @$(CC_X86) $(CFLAGS_X86) /DSIMULATE_PLASMA $(TOOLS_DIR)etermip.c
183 359 rhoads
        @$(CC_X86) $(CFLAGS_X86) os_stubs.c
184 355 rhoads
        @$(CC_X86) -o testip.exe etermip.obj $(TOOLS_DIR)wpcap.lib \
185 359 rhoads
        tcpip.obj http.obj netutil.obj filesys.obj libc.obj os_stubs.obj
186 355 rhoads
        @echo Try http://plasmb/.  Try telnet plasmb.  Try ftp plasmb.
187
        $(LINUX_PWD)testip.exe
188
 
189 416 rhoads
install:
190
        @echo PlasmaSend > ftp.txt
191
        @echo password >> ftp.txt
192
        @echo send test.bin >> ftp.txt
193
        @echo quit >> ftp.txt
194
        ftp -s:ftp.txt plasma
195
        @echo Telnet to plasma and run 'reboot test.bin [flash]'
196
 
197 355 rhoads
clean:
198
        -$(RM) *.o *.obj *.axf *.map *.lst *.hex *.txt *.bin *.exe
199
 
200
# Run a Plasma CPU opcode simulator (can execute rtos target)
201
run:
202
        @$(TOOLS_DIR)mlite.exe test.bin
203
 
204
disassemble:
205
        -@$(TOOLS_DIR)mlite.exe test.bin BD > test.txt
206
 
207 416 rhoads
# Start the EtermIP terminal program to download the code to the
208
# Plasma CPU and permit an Ethernet packets to be transfered.
209 355 rhoads
download:
210
        @echo Reset board before downloading code
211
        $(TOOLS_DIR)etermip.exe
212
 
213
 

powered by: WebSVN 2.1.0

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