GNUmakefile 768 Bytes

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

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

VPATH=../..

LDFLAGS = -Ttext 0xbfc00000 -N

TARGETS=start_rom.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

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

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

install exports: