litex/misoc/software/memtest/Makefile

48 lines
814 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
%.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)
2013-07-11 13:03:45 -04:00
%.o: %.c
$(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:
$(RM) $(OBJECTS) memtest.elf memtest.bin
2013-07-11 13:03:45 -04:00
$(RM) .*~ *~
.PHONY: all main.o clean libs load