GNUmakefile 871 Bytes

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

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

VPATH=..

LDFLAGS = -Ttext 0xbfc00000 -N

TARGETS= master.dat ipcslave.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

master.elf: master.o cache.o
	$(LD) $(LDFLAGS) crt0.o master.o cache.o -o $*.elf
 
ipcslave.elf: ipcslave.o cache.o
	$(LD) $(LDFLAGS) crt0.o ipcslave.o cache.o -o $*.elf

$(TARGETS:.dat=.elf) : crt0.o ../cpusim.h

install exports: