litex/software/bios/Makefile

48 lines
917 B
Makefile

M2DIR=../..
include $(M2DIR)/software/common.mak
OBJECTS=crt0.o isr.o sdram.o main.o boot-helper.o boot.o dataflow.o
all: bios.bin
# pull in dependency info for *existing* .o files
-include $(OBJECTS:.o=.d)
%.bin: %.elf
$(MAKE) -C $(M2DIR)/tools
$(OBJCOPY) -O binary $< $@
chmod -x $@
$(M2DIR)/tools/mkmmimg $@ write
bios.elf: linker.ld $(OBJECTS) libs
%.elf:
$(LD) $(LDFLAGS) -T $< -N -o $@ $(OBJECTS) \
-L$(M2DIR)/software/libnet \
-L$(M2DIR)/software/libbase \
-L$(M2DIR)/software/libcompiler-rt \
-lnet -lbase-nofloat -lcompiler-rt
chmod -x $@
main.o: main.c
$(compile-dep)
%.o: %.c
$(compile-dep)
%.o: %.S
$(assemble)
libs:
$(MAKE) -C $(M2DIR)/software/libcompiler-rt
$(MAKE) -C $(M2DIR)/software/libbase
$(MAKE) -C $(M2DIR)/software/libnet
flash: bios.bin
m1nor-ng bios.bin
clean:
$(RM) $(OBJECTS) $(OBJECTS:.o=.d) bios.elf bios.bin .*~ *~
.PHONY: all main.o clean libs flash