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

Subversion Repositories mlite

[/] [mlite/] [trunk/] [tools/] [makefile] - Diff between revs 126 and 137

Go to most recent revision | Show entire file | Details | Blame | View Log

Rev 126 Rev 137
Line 1... Line 1...
# NOTE:  CC is for the x86 compiler to compile the PC based tools.
# The MIPS gcc compiler must use the cygwin1.dll that came with the compiler.
# Gcc is for the MIPS test code.
# The CC_X86 is for compiling tools on your PC.
# If you get an error using GNU make.exe try a different make utility.
# The GCC_MIPS is for compiling code on the target.
# The MIPS gcc compiler libraries cause problems with GNU make.
# Convert_bin changes test.exe into code.txt which is used by the VHDL.
 
 
 
#CC_X86 = gcc_x86 -O
 
CC_X86 = cl /O1
 
 
 
CFLAGS = -O2 -Wall -c -s
 
GCC_MIPS = gcc $(CFLAGS)
 
AS_MIPS = as
 
LD_MIPS = ld
 
DUMP_MIPS = objdump
 
 
CC = cl /O1
all: convert_bin.exe mlite.exe tracehex.exe bintohex.exe ram_image.exe
#CC = gcc_x86 -O
        @echo make targets = count, opcodes, pi, test, run, tohex, toimage, rtos
 
 
all: convert.exe mlite.exe tracehex.exe bintohex.exe
clean:
        @echo make targets = count, opcodes, pi, test, run, tohex
        -del *.o *.obj *.exe *.map *.lst *.hex *.txt
 
 
convert.exe: convert.c
convert_bin.exe: convert.c
        @$(CC) -o convert.exe convert.c
        @$(CC_X86) -o convert_bin.exe convert.c
 
 
mlite.exe: mlite.c
mlite.exe: mlite.c
        @$(CC) -o mlite.exe mlite.c
        @$(CC_X86) -o mlite.exe mlite.c -DWIN32
 
 
tracehex.exe: tracehex.c
tracehex.exe: tracehex.c
        @$(CC) -o tracehex.exe tracehex.c
        @$(CC_X86) -o tracehex.exe tracehex.c
 
 
bintohex.exe: bintohex.c
bintohex.exe: bintohex.c
        @$(CC) -o bintohex.exe bintohex.c
        @$(CC_X86) -o bintohex.exe bintohex.c
 
 
tohex:
ram_image.exe: ram_image.c
        bintohex test2.exe
        @$(CC_X86) -o ram_image.exe ram_image.c
        copy code*.hex ..\vhdl
 
 
 
opcodes: all
opcodes: all
        as -o opcodes.o opcodes.asm
        $(AS_MIPS) -o opcodes.o opcodes.asm
        ld -Ttext 0 -eentry -Map test.map -s -N -o test.exe opcodes.o
        $(LD_MIPS) -Ttext 0 -eentry -Map test.map -s -N -o test.exe opcodes.o
        -@objdump --disassemble test.exe > test.lst
        -@$(DUMP_MIPS) --disassemble test.exe > test.lst
        @convert
        convert_bin
        -@mlite test2.exe BD > test.txt
        copy code.txt ..\vhdl
        @copy code.txt ..\vhdl
 
 
opcodes2: all
 
        $(AS_MIPS) -o opcodes.o opcodes.asm
 
        $(LD_MIPS) -Ttext 0x10000000 -eentry -Map test.map -s -N -o test.exe opcodes.o
 
        -@$(DUMP_MIPS) --disassemble test.exe > test.lst
 
        convert_bin
 
        copy code.txt ..\vhdl
 
 
test: all
test: all
        as -o boot.o boot.asm
        $(AS_MIPS) -o boot.o boot.asm
        gcc -O -DMLITE -Dmain=main2 -Wall -c -s test.c
        $(GCC_MIPS) test.c
        ld -Ttext 0 -eentry -Map test.map -s -N -o test.exe boot.o test.o
        $(GCC_MIPS) no_os.c
        -@objdump --disassemble test.exe > test.lst
        $(LD_MIPS) -Ttext 0 -eentry -Map test.map -s -N -o test.exe \
        @convert
                boot.o test.o no_os.o
        -@mlite test2.exe BD > test.txt
        -@$(DUMP_MIPS) --disassemble test.exe > test.lst
        @copy code.txt ..\vhdl
        convert_bin
 
        copy code.txt ..\vhdl
 
 
count: all
count: all
        as -o boot.o boot.asm
        $(AS_MIPS) -o boot.o boot.asm
        gcc -O -DMLITE -Dmain=main2 -Wall -c -s count.c
        $(GCC_MIPS) count.c
        ld -Ttext 0 -eentry -Map test.map -s -N -o test.exe boot.o count.o
        $(GCC_MIPS) no_os.c
        -objdump --disassemble test.exe > test.lst
        $(LD_MIPS) -Ttext 0 -eentry -Map test.map -s -N -o test.exe \
        convert
                boot.o count.o no_os.o
        -mlite test2.exe BD > test.txt
        -$(DUMP_MIPS) --disassemble test.exe > test.lst
 
        convert_bin
 
        copy code.txt ..\vhdl
 
 
 
count2: all
 
        $(AS_MIPS) -o boot.o boot.asm
 
        $(GCC_MIPS) count.c
 
        $(GCC_MIPS) no_os.c
 
        $(LD_MIPS) -Ttext 0x10000000 -eentry -Map test.map -s -N -o test.exe \
 
                boot.o count.o no_os.o
 
        -$(DUMP_MIPS) --disassemble test.exe > test.lst
 
        convert_bin
        copy code.txt ..\vhdl
        copy code.txt ..\vhdl
 
 
pi: all
pi: all
        as -o boot.o boot.asm
        $(AS_MIPS) -o boot.o boot.asm
        gcc -O -DMLITE -Dmain=main2 -Wall -c -s pi.c
        $(GCC_MIPS) pi.c
        ld -Ttext 0 -eentry -Map test.map -s -N -o test.exe boot.o pi.o
        $(LD_MIPS) -Ttext 0 -eentry -Map test.map -s -N -o test.exe \
        @objdump --disassemble test.exe > test.lst
                boot.o pi.o
        @convert
        @$(DUMP_MIPS) --disassemble test.exe > test.lst
        -@mlite test2.exe BD > test.txt
        convert_bin
        @copy code.txt ..\vhdl
        copy code.txt ..\vhdl
 
 
 
pi2: all
 
        $(AS_MIPS) -o boot.o boot.asm
 
        $(GCC_MIPS) pi.c
 
        $(LD_MIPS) -Ttext 0x10000000 -eentry -Map test.map -s -N -o test.exe \
 
                boot.o pi.o
 
        @$(DUMP_MIPS) --disassemble test.exe > test.lst
 
        convert_bin
 
        copy code.txt ..\vhdl
 
 
 
bootldr: all
 
        $(AS_MIPS) -o boot.o boot.asm
 
        $(GCC_MIPS) bootldr.c
 
        $(GCC_MIPS) no_os.c
 
        $(LD_MIPS) -Ttext 0 -eentry -Map test.map -s -N -o test.exe \
 
                boot.o bootldr.o no_os.o
 
        @$(DUMP_MIPS) --disassemble test.exe > test.lst
 
        convert_bin
 
        copy code.txt ..\vhdl
 
 
 
# Run a MIPS opcode simulator
run: mlite.exe
run: mlite.exe
        @mlite test2.exe B
        @mlite test.bin
 
 
 
disassemble:
 
        -@mlite test.bin BD > test.txt
 
 
 
# Used by Altera FPGAs for ram image
 
tohex:
 
        bintohex test2.exe
 
        copy code*.hex ..\vhdl
 
 
 
# Used by Xilinx FPGAs for ram image
 
toimage:
 
        ram_image ..\vhdl\ram_xilinx.vhd ..\vhdl\code.txt ..\vhdl\ram_image.vhd
 
 
 
 

powered by: WebSVN 2.1.0

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