GNUmakefile 914 Bytes
include $(ROOT)/usr/include/make/commondefs
include $(ROOT)/usr/include/make/PRdefs

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

TARGETS = cartdma.hex
ASFILES = entry.s 
CFILES  = cartdma.c

OPTIMIZER=

#LCOPTS += -mips3 -g 
#LCOPTS += -mips2 -Os -G 0
LCOPTS += -mips2 -g -G 0
#LASOPTS += -mips2 -Os -G 0
LASOPTS += -mips2 -g -G 0
LLDOPTS += -N -lultra_d -lgcc --no-warn-mismatch
ifdef ENTRY_ADDR
LLDOPTS += -Ttext $(ENTRY_ADDR)
else
LLDOPTS += -Ttext 0x80004000
endif
LDIRT += cpu.log*

#ifeq ($(BIG_APP), 1)
#LASOPTS += -DBIG_APP
#endif

LDIRT += cartdma.elf cartdma.bin

.PRECIOUS: %.bin

default: $(TARGETS)

#test: default copy

cartdma.elf: $(OBJECTS)
	$(CCF) -o cartdma.elf $(OBJECTS) $(LDFLAGS)

%.bin: %.elf
	$(OBJCOPY) -O binary -S $(REMOVE_SECTS) $< $@

%.hex: %.bin
	od -v -w4 -An -tx1 $< | tr -d " " > $@
	
install exports headers:

include $(COMMONRULES)