2
0
mirror of https://github.com/m-labs/artiq.git synced 2024-12-30 21:53:34 +08:00
artiq/soc/runtime/Makefile

69 lines
1.4 KiB
Makefile
Raw Normal View History

2014-07-04 23:49:08 +08:00
include $(MSCDIR)/software/common.mak
BOARD=papilio_pro
SERIAL=/dev/ttyUSB1
OBJECTS=isr.o elf_loader.o kernelcpu.o exception_jmp.o exceptions.o services.o comm_serial.o gpio.o rtio.o dds.o ksupport_data.o test_mode.o main.o
2014-07-04 23:49:08 +08:00
all: runtime.bin
# pull in dependency info for *existing* .o files
-include $(OBJECTS:.o=.d)
%.bin: %.elf
$(OBJCOPY) -O binary $< $@
@chmod -x $@
2014-07-04 23:49:08 +08:00
%.fbi: %.bin
$(MSCDIR)/mkmscimg.py -f -o $@ $<
runtime.elf: $(OBJECTS) libs
%.elf:
$(LD) $(LDFLAGS) \
-T linker.ld \
2014-07-04 23:49:08 +08:00
-N -o $@ \
$(MSCDIR)/software/libbase/crt0-$(CPU).o \
$(OBJECTS) \
-L$(MSCDIR)/software/libbase \
-L$(MSCDIR)/software/libcompiler-rt \
-lbase -lcompiler-rt
@chmod -x $@
ksupport.elf: ksupport.o
$(LD) $(LDFLAGS) \
-T ksupport.ld \
-N -o $@ \
$(MSCDIR)/software/libbase/crt0-$(CPU).o \
ksupport.o
@chmod -x $@
ksupport_data.o: ksupport.bin
$(LD) -r -b binary -o $@ $<
2014-07-04 23:49:08 +08:00
main.o: main.c
$(compile-dep)
%.o: %.c
$(compile-dep)
%.o: %.S
$(assemble)
libs:
$(MAKE) -C $(MSCDIR)/software/libcompiler-rt
$(MAKE) -C $(MSCDIR)/software/libbase
load: runtime.bin
$(MAKE) -C $(MSCDIR)/tools
$(MSCDIR)/tools/flterm --port $(SERIAL) --kernel runtime.bin
flash: runtime.fbi
$(MSCDIR)/flash_extra.py $(BOARD) runtime.fbi 0x70000
clean:
$(RM) $(OBJECTS) $(OBJECTS:.o=.d) runtime.elf runtime.bin runtime.fbi .*~ *~
$(RM) ksupport.d ksupport.o ksupport.elf ksupport.bin
2014-07-04 23:49:08 +08:00
.PHONY: all main.o clean libs load