2013-11-09 09:27:32 -05:00
|
|
|
MSCDIR=../..
|
|
|
|
include $(MSCDIR)/software/common.mak
|
2013-07-11 13:03:45 -04:00
|
|
|
|
|
|
|
OBJECTS=isr.o main.o
|
|
|
|
|
|
|
|
all: memtest.bin
|
|
|
|
|
|
|
|
%.bin: %.elf
|
|
|
|
$(OBJCOPY) -O binary $< $@
|
|
|
|
chmod -x $@
|
|
|
|
|
|
|
|
memtest.elf: $(OBJECTS) libs
|
|
|
|
|
|
|
|
%.elf:
|
|
|
|
$(LD) $(LDFLAGS) \
|
2013-11-09 09:27:32 -05:00
|
|
|
-T $(MSCDIR)/software/libbase/linker-sdram.ld \
|
2013-07-11 13:03:45 -04:00
|
|
|
-N -o $@ \
|
2014-05-14 04:24:56 -04:00
|
|
|
$(MSCDIR)/software/libbase/crt0-$(CPU).o \
|
2013-07-11 13:03:45 -04:00
|
|
|
$(OBJECTS) \
|
2013-11-09 09:27:32 -05:00
|
|
|
-L$(MSCDIR)/software/libbase \
|
|
|
|
-L$(MSCDIR)/software/libcompiler-rt \
|
2013-07-11 13:03:45 -04:00
|
|
|
-lbase -lcompiler-rt
|
|
|
|
chmod -x $@
|
|
|
|
|
|
|
|
main.o: main.c
|
2015-11-03 11:31:53 -05:00
|
|
|
$(compile)
|
2013-07-11 13:03:45 -04:00
|
|
|
|
|
|
|
%.o: %.c
|
2015-11-03 11:31:53 -05:00
|
|
|
$(compile)
|
2013-07-11 13:03:45 -04:00
|
|
|
|
|
|
|
%.o: %.S
|
|
|
|
$(assemble)
|
|
|
|
|
|
|
|
libs:
|
2013-11-09 09:27:32 -05:00
|
|
|
$(MAKE) -C $(MSCDIR)/software/libcompiler-rt
|
|
|
|
$(MAKE) -C $(MSCDIR)/software/libbase
|
2013-07-11 13:03:45 -04:00
|
|
|
|
|
|
|
load: memtest.bin
|
2013-11-09 09:27:32 -05:00
|
|
|
$(MAKE) -C $(MSCDIR)/tools
|
|
|
|
$(MSCDIR)/tools/flterm --port /dev/ttyUSB0 --kernel memtest.bin
|
2013-07-11 13:03:45 -04:00
|
|
|
|
|
|
|
|
|
|
|
clean:
|
2015-11-03 11:31:53 -05:00
|
|
|
$(RM) $(OBJECTS) memtest.elf memtest.bin
|
2013-07-11 13:03:45 -04:00
|
|
|
$(RM) .*~ *~
|
|
|
|
|
|
|
|
.PHONY: all main.o clean libs load
|