forked from M-Labs/artiq
1
0
Fork 0
artiq/soc/runtime/Makefile

69 lines
1.6 KiB
Makefile
Raw Normal View History

2014-07-04 23:49:08 +08:00
include $(MSCDIR)/software/common.mak
OBJECTS := isr.o flash_storage.o clock.o elf_loader.o services.o session.o log.o test_mode.o kloader.o mailbox.o ksupport_data.o main.o
OBJECTS_KSUPPORT := ksupport.o exception_jmp.o exceptions.o mailbox.o bridge.o rtio.o dds.o
2014-07-04 23:49:08 +08:00
2015-04-22 15:01:32 +08:00
CFLAGS += -Ilwip/src/include -Iliblwip
2015-04-15 14:05:34 +08:00
all: runtime.bin runtime.fbi
2014-07-04 23:49:08 +08:00
# 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
2015-04-15 14:05:34 +08:00
@echo " MSCIMG " $@ && $(MSCDIR)/mkmscimg.py -f -o $@ $<
2014-07-04 23:49:08 +08:00
runtime.elf: $(OBJECTS) libs
$(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 \
2015-04-17 16:38:46 +08:00
-Lliblwip \
-lbase -lcompiler-rt -llwip
@chmod -x $@
ksupport.elf: $(OBJECTS_KSUPPORT)
$(LD) $(LDFLAGS) \
-T ksupport.ld \
-N -o $@ \
$(MSCDIR)/software/libbase/crt0-$(CPU).o \
$^
@chmod -x $@
ksupport_data.o: ksupport.bin
$(LD) -r -b binary -o $@ $<
2014-07-04 23:49:08 +08:00
service_table.h: ksupport.elf gen_service_table.py
@echo " GEN " $@ && ./gen_service_table.py ksupport.elf > $@
services.c: service_table.h
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
2015-04-17 16:38:46 +08:00
$(MAKE) -C liblwip
2014-07-04 23:49:08 +08:00
clean:
2015-04-17 16:38:46 +08:00
$(MAKE) -C liblwip clean
$(RM) $(OBJECTS) $(OBJECTS:.o=.d) $(OBJECTS_KSUPPORT) $(OBJECTS_KSUPPORT:.o=.d)
$(RM) runtime.elf runtime.bin runtime.fbi .*~ *~
$(RM) service_table.h ksupport.elf ksupport.bin
2014-07-04 23:49:08 +08:00
.PHONY: all main.o clean libs load