GNUmakefile 1.03 KB
include $(ROOT)/usr/include/make/commondefs
include $(ROOT)/usr/include/make/PRdefs

FLASH_FILE = psk.nand
VRAM_FILE = vram2.sim
PSK_BUILD_TOOL = psk_tool

OBJCOPY = mips-linux-objcopy
REMOVE_SECTS = -R .reginfo -R .note -R .comment -R .mdebug

TARGETS = psk.bin
ASFILES = psk.s 

#LCOPTS += -mcpu=4300 -mips3 -g
OPTIMIZER=

#LCOPTS += -mips3 -g 
LCOPTS += -mips3 -Os 
#LLDOPTS += -Ttext 0x80000000 -N
LLDOPTS += -Ttext 0x9fc00000 -N
#LLDOPTS += -Wl,-T rom.lk -N
LDIRT += cpu.log*

LDIRT += psk_tool psk.elf

default: $(TARGETS)

test: default copy

testsimos: default

psk.bin: $(OBJECTS) $(PSK_BUILD_TOOL)
	$(CCF) -o psk.elf $(OBJECTS) $(LDFLAGS)
	$(OBJCOPY) -O binary -S $(REMOVE_SECTS) psk.elf psk.bin
	od -v -w4 -An -tx1 psk.bin | tr -d " " > psk.sim
	./$(PSK_BUILD_TOOL) -f $(FLASH_FILE) -v $(VRAM_FILE) psk.sim 

include $(COMMONRULES)

unexport

$(PSK_BUILD_TOOL): $(PSK_BUILD_TOOL).c sha1.c
	$(MAKE) -f ToolMakefile

copy:
	cp -f $(FLASH_FILE) $(BBROOT)/hw/chip/vsim/External_File.txt
	cp -f $(VRAM_FILE) $(BBROOT)/hw/chip/vsim/tests/v2.dat