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

Subversion Repositories plasma

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

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
CFLAGS_FEW_REGS = -ffixed-t1 -ffixed-t2 -ffixed-t3 -ffixed-t4 -ffixed-t5 -ffixed-t6 -ffixed-t7 -ffixed-t8 -ffixed-t9 -ffixed-s2 -ffixed-s3 -ffixed-s4 -ffixed-s5 -ffixed-s6 -ffixed-s7 -ffixed-s8
32
 
33 138 rhoads
CFLAGS = -O2 -Wall -c -s -I..\tools -msoft-float
34
 
35 246 rhoads
# Build just the Plasma RTOS for Plasma CPU
36 138 rhoads
rtos:
37
        $(AS_MIPS) -o boot.o ..\tools\boot.asm
38
        $(GCC_MIPS) rtos.c
39
        $(GCC_MIPS) libc.c
40
        $(GCC_MIPS) uart.c
41
        $(GCC_MIPS) rtos_test.c
42
        $(GCC_MIPS) math.c
43 191 rhoads
        $(LD_MIPS) -Ttext 0x10000000 -eentry -Map test.map -s -N -o test.axf \
44 222 rhoads
        boot.o rtos.o libc.o uart.o rtos_test.o math.o
45 153 rhoads
        ..\tools\convert_bin
46
        @sort test2.map
47 191 rhoads
        @$(DUMP_MIPS) --disassemble test.axf > test.lst
48
        cp test.bin ..\tools
49 138 rhoads
 
50 246 rhoads
# Build the Plasma RTOS, Plasma TCP/IP stack, and web server for the Plasma CPU
51
rtos_tcpip:
52
        $(AS_MIPS) -o boot.o ..\tools\boot.asm
53
        $(GCC_MIPS) rtos.c
54
        $(GCC_MIPS) libc.c
55
        $(GCC_MIPS) uart.c
56
        $(GCC_MIPS) rtos_test.c -DINCLUDE_HTML -DINCLUDE_CONSOLE
57
        $(GCC_MIPS) math.c
58
        $(GCC_MIPS) tcpip.c
59
        $(GCC_MIPS) http.c -DINCLUDE_FILESYS -DEXAMPLE_HTML
60
        $(GCC_MIPS) netutil.c
61
        $(GCC_MIPS) filesys.c
62
        $(LD_MIPS) -Ttext 0x10000000 -eentry -Map test.map -s -N -o test.axf \
63
        boot.o rtos.o libc.o uart.o rtos_test.o math.o tcpip.o \
64
        http.o netutil.o filesys.o
65
        ..\tools\convert_bin
66
        @sort test2.map
67
        @$(DUMP_MIPS) --disassemble test.axf > test.lst
68
        cp test.bin ..\tools
69
 
70
# Build full test application
71 222 rhoads
rtosfull:
72
        $(AS_MIPS) -o boot.o ..\tools\boot.asm
73
        $(GCC_MIPS) rtos.c
74
        $(GCC_MIPS) libc.c
75
        $(GCC_MIPS) uart.c
76
        $(GCC_MIPS) rtos_test.c -DINCLUDE_HTML -DINCLUDE_CONSOLE
77
        $(GCC_MIPS) math.c
78
        $(GCC_MIPS) tcpip.c
79 236 rhoads
        $(GCC_MIPS) http.c -DINCLUDE_FILESYS
80 222 rhoads
        $(GCC_MIPS) netutil.c
81
        $(GCC_MIPS) filesys.c
82
        $(GCC_MIPS) -I. ..\app\html.c -DMainThread=HtmlThread
83
        $(GCC_MIPS) -I. ..\app\image.c
84
        $(GCC_MIPS) -I. ..\app\tictac.c
85
        $(GCC_MIPS) -I. ..\app\tic3d.c
86
        $(GCC_MIPS) -I. ..\app\connect4.c
87
        $(LD_MIPS) -Ttext 0x10000000 -eentry -Map test.map -s -N -o test.axf \
88
        boot.o rtos.o libc.o uart.o rtos_test.o math.o tcpip.o \
89
        http.o netutil.o filesys.o html.o image.o tictac.o tic3d.o connect4.o
90
        ..\tools\convert_bin
91
        @sort test2.map
92
        @$(DUMP_MIPS) --disassemble test.axf > test.lst
93
        cp test.bin ..\tools
94
 
95 246 rhoads
# Test the RTOS running on a PC
96
testrtos:
97
        @$(CC_X86) /c rtos.c
98
        @$(CC_X86) /c libc.c
99
        @$(CC_X86) /c uart.c
100
        @$(CC_X86) /c rtos_test.c
101
        @$(CC_X86) /c math.c
102
        @$(CC_X86) -o testrtos.exe rtos.obj libc.obj uart.obj rtos_test.obj math.obj
103
        testrtos.exe
104
 
105
# Test the TCP/IP protocol stack running on a PC
106
testip:
107
        @$(CC_X86) /c tcpip.c
108
        @$(CC_X86) /c http.c /DEXAMPLE_HTML
109
        @$(CC_X86) /c netutil.c
110
        @$(CC_X86) /c filesys.c
111
        @$(CC_X86) /c libc.c /I..\tools
112
        @$(CC_X86) /c /DSIMULATE_PLASMA ..\tools\etermip.c
113
        @$(CC_X86) -o testip.exe etermip.obj ..\tools\wpcap.lib \
114
        tcpip.obj http.obj netutil.obj filesys.obj libc.c
115
        @echo Try http://plasmb/.  Try telnet plasmb.  Try ftp plasmb.
116
        testip.exe
117
 
118 145 rhoads
clean:
119 246 rhoads
        -$(RM) *.o *.obj *.axf *.map *.lst *.hex *.txt *.bin *.exe
120 138 rhoads
 
121 246 rhoads
# Run a Plasma CPU opcode simulator (can execute rtos target)
122 138 rhoads
run:
123
        @..\tools\mlite test.bin
124
 
125
disassemble:
126
        -@..\tools\mlite test.bin BD > test.txt
127
 
128 246 rhoads
# Start the EtermIP terminal program to download the code to the Plasma CPU
129
# and permit an Ethernet packets to be transfered.
130
download:
131
        @echo Reset board before downloading code
132
        ..\tools\etermip
133 138 rhoads
 
134 246 rhoads
 

powered by: WebSVN 2.1.0

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