GNUmakefile 2.25 KB

BBDEPTH = ../..
include $(BBDEPTH)/BBdefs

LASINCS = -I$(ROOT)/usr/include/PR -I..
LCINCS = -I$(ROOT)/usr/include/PR -I.. -I.
OPTIMIZER = -O3 -g
LCFLAGS += -Wall

VPATH=..

LDFLAGS = -Ttext 0xbfc00000 -N
ifndef CPU_625
    LCFLAGS += -DDBG_JTAG
endif

ifdef NO_DDR_TEST
    LCFLAGS += -DNO_DDR_TEST
endif

ifdef NEC_IRAM_MARCH
    LCFLAGS += -DNEC_IRAM_MARCH
endif

ifdef PLL_BYPASS
    LCFLAGS += -DPLL_BYPASS
endif

ifdef NEC_IRAM_TEST
    LCFLAGS += -DNEC_IRAM_TEST
endif

ifdef PATTERN_0
    LCFLAGS += -DPATTERN_0
endif 

ifdef TOSHIBA_FLASH
    LCFLAGS += -DTOSHIBA_FLASH
endif 

TARGETS= bus_error.dat sane.dat secure.dat interrupt.dat reset.dat cacheun.dat\
	bandwidth.dat viragerw.dat ipcsane.dat emuwrite.dat bus_error2.dat \
	ddr.dat vi32bar.dat vi16bar.dat vifill.dat atspeed_ddr.dat atspeed_sram.dat \
	atspeed_comp.dat atspeed_comp_aisp.dat

LDIRT += $(TARGETS:.dat=.bin) $(TARGETS:.dat=.elf)

.SUFFIXES: .bin .dat .elf

include $(BBDEPTH)/BBrules

default: $(TARGETS)

.s.elf:
	$(ASF) -o $*.o $<
	$(LD) $(LDFLAGS) crt0.o $*.o -o $*.elf

.elf.bin:
	mips-linux-objcopy -O binary -R .mdebug -R .reginfo $*.elf $*.bin

.bin.dat:
	od -v -w4 -An -tx1 $*.bin | tr -d " " > $*.dat

.c.elf:
	$(CCF) -c -o $*.o $<
	$(LD) $(LDFLAGS) crt0.o $*.o -o $*.elf

cacheun.elf: cacheun.o cache.o 
	$(LD) $(LDFLAGS) crt0.o $^ -o $*.elf

ddr.elf: ddr.o cache.o 
	$(LD) $(LDFLAGS) crt0.o $^ -o $*.elf
ddr.o: ddr.c ../cpusim.h
	$(CCF) -c -o $*.o $<

vi32bar.elf: vi32bar.o cache.o 
	$(LD) $(LDFLAGS) crt0.o $^ -o $*.elf

vi16bar.elf: vi16bar.o cache.o 
	$(LD) $(LDFLAGS) crt0.o $^ -o $*.elf

vifill.elf: vifill.o cache.o 
	$(LD) $(LDFLAGS) crt0.o $^ -o $*.elf

interrupt.elf: interrupt.o cache.o 
	$(LD) $(LDFLAGS) crt0.o $^ -o $*.elf

bandwidth.elf: bandwidth.o cache.o 
	$(LD) $(LDFLAGS) crt0.o $^ -o $*.elf

bus_error2.elf: bus_error2.o cache.o 
	$(LD) $(LDFLAGS) crt0.o $^ -o $*.elf

##### Add for NEC at speed test vector #####
atspeed_ddr.elf: atspeed_ddr.o cache.o
	$(LD) $(LDFLAGS) crt0.o $^ -o $*.elf

atspeed_sram.elf: atspeed_sram.o
	$(LD) -Ttext 0x80201000 -N $^ -o $*.elf

atspeed_comp.elf: atspeed_comp.o cache.o
	$(LD) -Ttext 0x80201000 -N $^ -o $*.elf

atspeed_comp_aisp.elf: atspeed_comp_aisp.o cache.o
	$(LD) -Ttext 0x80201000 -N $^ -o $*.elf

$(TARGETS) : crt0.o ../cpusim.h

install exports: