litex/misoc/software/memtest/Makefile

51 lines
916 B
Makefile
Raw Normal View History

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
# pull in dependency info for *existing* .o files
-include $(OBJECTS:.o=.d)
%.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 $@ \
$(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
$(compile-dep)
%.o: %.c
$(compile-dep)
%.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:
$(RM) $(OBJECTS) $(OBJECTS:.o=.d) memtest.elf memtest.bin
$(RM) .*~ *~
.PHONY: all main.o clean libs load