GNUmakefile 1.15 KB
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 = atbtest.hex gen_testfile
ASFILES = entry.s 
CFILES  = atbtest.c

OPTIMIZER=

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

LLDLIBS += -lultra_d -lcrypto -lgcc

FLAGS  = $(LCDEFS) $(LCINCS) -non_shared -G 0 -mips3 -Wa,-32 -c $(GCFLAGS)

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

LDIRT += atbtest.elf atbtest.bin

.PRECIOUS: %.bin

default: $(TARGETS)

#test: default copy

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

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

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

#atbtest.o:   atbtest.c
#	$(CC) $(FLAGS) -o $@ atbtest.c


include $(COMMONRULES)

gen_testfile: gen_testfile.c
	$(HOST_CC) -o gen_testfile gen_testfile.c