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

Subversion Repositories plasma

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

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 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 355 rhoads
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 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 358 rhoads
CFLAGS = -O2 -Wall -c -s -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
 
66
# Build just the Plasma RTOS for Plasma CPU
67
rtos:
68
        $(AS_MIPS) -o boot.o $(TOOLS_DIR)boot.asm
69
        $(GCC_MIPS) rtos.c
70
        $(GCC_MIPS) libc.c
71
        $(GCC_MIPS) uart.c
72
        $(GCC_MIPS) rtos_test.c
73
        $(GCC_MIPS) math.c $(ALIASING)
74
        $(LD_MIPS) -Ttext 0x10000000 -eentry -Map test.map -s -N -o test.axf \
75
        boot.o rtos.o libc.o uart.o rtos_test.o math.o
76
        $(CONVERT_BIN)
77
        @sort test2.map
78
        @$(DUMP_MIPS) --disassemble test.axf > test.lst
79
 
80
# Build the Plasma RTOS, Plasma TCP/IP stack, and web server for the Plasma CPU
81 359 rhoads
# Use the serial port and etermip for TCP/IP packets
82 355 rhoads
rtos_tcpip:
83
        $(AS_MIPS) -o boot.o $(TOOLS_DIR)boot.asm
84
        $(GCC_MIPS) rtos.c
85
        $(GCC_MIPS) libc.c
86
        $(GCC_MIPS) uart.c
87
        $(GCC_MIPS) rtos_test.c -DINCLUDE_HTML -DINCLUDE_CONSOLE
88
        $(GCC_MIPS) math.c $(ALIASING)
89 359 rhoads
        $(GCC_MIPS) tcpip.c -DINCLUDE_FILESYS
90 355 rhoads
        $(GCC_MIPS) http.c -DINCLUDE_FILESYS -DEXAMPLE_HTML
91
        $(GCC_MIPS) netutil.c
92
        $(GCC_MIPS) filesys.c
93
        $(LD_MIPS) -Ttext 0x10000000 -eentry -Map test.map -s -N -o test.axf \
94
        boot.o rtos.o libc.o uart.o rtos_test.o math.o tcpip.o \
95
        http.o netutil.o filesys.o
96
        $(CONVERT_BIN)
97
        @sort test2.map
98
        @$(DUMP_MIPS) --disassemble test.axf > test.lst
99
 
100 359 rhoads
# Use Ethernet for TCP/IP packets, use flash file system
101 355 rhoads
rtos_tcpip_eth:
102
        $(AS_MIPS) -o boot.o $(TOOLS_DIR)boot.asm
103
        $(GCC_MIPS) rtos.c
104
        $(GCC_MIPS) libc.c
105
        $(GCC_MIPS) uart.c -DNO_PACKETS
106
        $(GCC_MIPS) rtos_test.c -DINCLUDE_ETH -DINCLUDE_CONSOLE
107
        $(GCC_MIPS) math.c $(ALIASING)
108 359 rhoads
        $(GCC_MIPS) tcpip.c -DINCLUDE_FILESYS
109 355 rhoads
        $(GCC_MIPS) http.c -DINCLUDE_FILESYS -DEXAMPLE_HTML
110 359 rhoads
        $(GCC_MIPS) netutil.c -DINCLUDE_FLASH -DDLL_SETUP
111
        $(GCC_MIPS) filesys.c -DINCLUDE_FLASH
112 355 rhoads
        $(GCC_MIPS) ethernet.c
113 359 rhoads
        $(GCC_MIPS) flash.c
114 355 rhoads
        $(LD_MIPS) -Ttext 0x10000000 -eentry -Map test.map -s -N -o test.axf \
115
        boot.o rtos.o libc.o uart.o rtos_test.o math.o tcpip.o \
116 359 rhoads
        http.o netutil.o filesys.o ethernet.o flash.o
117 355 rhoads
        $(CONVERT_BIN)
118
        @sort test2.map
119
        @$(DUMP_MIPS) --disassemble test.axf > test.lst
120
 
121 394 rhoads
# Build full test application.  (Use rtos_tcpip_eth instead.)
122 355 rhoads
rtosfull:
123
        $(AS_MIPS) -o boot.o $(TOOLS_DIR)boot.asm
124
        $(GCC_MIPS) rtos.c
125
        $(GCC_MIPS) libc.c
126
        $(GCC_MIPS) uart.c -DNO_PACKETS
127
        $(GCC_MIPS) rtos_test.c -DINCLUDE_ETH -DINCLUDE_CONSOLE
128
        $(GCC_MIPS) math.c $(ALIASING)
129 359 rhoads
        $(GCC_MIPS) tcpip.c -DINCLUDE_FILESYS
130 355 rhoads
        $(GCC_MIPS) http.c -DINCLUDE_FILESYS
131
        $(GCC_MIPS) netutil.c -DINCLUDE_FLASH -DDLL_SETUP
132
        $(GCC_MIPS) filesys.c -DINCLUDE_FLASH
133
        $(GCC_MIPS) ethernet.c
134
        $(GCC_MIPS) flash.c
135
        $(GCC_MIPS) -I. $(APP_DIR)html.c -DMainThread=HtmlThread
136
        $(GCC_MIPS) -I. $(APP_DIR)image.c
137
        $(GCC_MIPS) -I. $(APP_DIR)tictac.c
138
        $(GCC_MIPS) -I. $(APP_DIR)tic3d.c
139
        $(GCC_MIPS) -I. $(APP_DIR)connect4.c
140
        $(LD_MIPS) -Ttext 0x10000000 -eentry -Map test.map -s -N -o test.axf \
141
        boot.o rtos.o libc.o uart.o rtos_test.o math.o tcpip.o \
142
        http.o netutil.o filesys.o ethernet.o flash.o \
143
        html.o image.o tictac.o tic3d.o connect4.o
144
        $(CONVERT_BIN)
145
        @sort test2.map
146
        @$(DUMP_MIPS) --disassemble test.axf > test.lst
147
 
148 359 rhoads
# Create a separate Dynamically Linked Library executable
149
# ftp test.bin to /flash/web/dlltest
150
# telnet to board and execute "dlltest"
151
dlltest:
152
        $(GCC_MIPS) -G0 dlltest.c
153
        $(LD_MIPS) -Ttext 0x10100000 -s -N -o test.axf dlltest.o
154
        $(CONVERT_BIN)
155
        @$(DUMP_MIPS) --disassemble test.axf > test.lst
156
 
157 355 rhoads
# Test the RTOS running on a PC
158
testrtos:
159
        @$(CC_X86) $(CFLAGS_X86) rtos.c
160 402 rhoads
        @$(CC_X86) $(CFLAGS_X86) rtos_ex.c
161 359 rhoads
        @$(CC_X86) $(CFLAGS_X86) libc.c
162 355 rhoads
        @$(CC_X86) $(CFLAGS_X86) uart.c
163
        @$(CC_X86) $(CFLAGS_X86) rtos_test.c
164
        @$(CC_X86) $(CFLAGS_X86) math.c $(ALIASING)
165 402 rhoads
        @$(CC_X86) $(LFLAGS_X86) -o testrtos.exe rtos.$(OBJ) rtos_ex.$(OBJ) libc.$(OBJ) uart.$(OBJ) rtos_test.$(OBJ) math.$(OBJ)
166 355 rhoads
        $(LINUX_PWD)testrtos.exe
167
 
168 364 rhoads
# Test the TCP/IP protocol stack running on a PC (requires Windows)
169 355 rhoads
testip:
170
        @$(CC_X86) $(CFLAGS_X86) tcpip.c
171
        @$(CC_X86) $(CFLAGS_X86) http.c /DEXAMPLE_HTML
172
        @$(CC_X86) $(CFLAGS_X86) netutil.c
173
        @$(CC_X86) $(CFLAGS_X86) filesys.c
174 359 rhoads
        @$(CC_X86) $(CFLAGS_X86) libc.c /I$(TOOLS_DIR)
175 355 rhoads
        @$(CC_X86) $(CFLAGS_X86) /DSIMULATE_PLASMA $(TOOLS_DIR)etermip.c
176 359 rhoads
        @$(CC_X86) $(CFLAGS_X86) os_stubs.c
177 355 rhoads
        @$(CC_X86) -o testip.exe etermip.obj $(TOOLS_DIR)wpcap.lib \
178 359 rhoads
        tcpip.obj http.obj netutil.obj filesys.obj libc.obj os_stubs.obj
179 355 rhoads
        @echo Try http://plasmb/.  Try telnet plasmb.  Try ftp plasmb.
180
        $(LINUX_PWD)testip.exe
181
 
182
clean:
183
        -$(RM) *.o *.obj *.axf *.map *.lst *.hex *.txt *.bin *.exe
184
 
185
# Run a Plasma CPU opcode simulator (can execute rtos target)
186
run:
187
        @$(TOOLS_DIR)mlite.exe test.bin
188
 
189
disassemble:
190
        -@$(TOOLS_DIR)mlite.exe test.bin BD > test.txt
191
 
192
# Start the EtermIP terminal program to download the code to the Plasma CPU
193
# and permit an Ethernet packets to be transfered.
194
download:
195
        @echo Reset board before downloading code
196
        $(TOOLS_DIR)etermip.exe
197
 
198
 

powered by: WebSVN 2.1.0

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