litex/software/bios/Makefile

47 lines
921 B
Makefile
Raw Normal View History

2013-11-09 09:27:32 -05:00
MSCDIR=../..
include $(MSCDIR)/software/common.mak
2012-02-05 14:01:28 -05:00
2013-07-11 12:36:26 -04:00
OBJECTS=isr.o sdram.o main.o boot-helper.o boot.o dataflow.o
2012-02-05 14:01:28 -05:00
all: bios.bin
# pull in dependency info for *existing* .o files
-include $(OBJECTS:.o=.d)
%.bin: %.elf
2013-11-09 09:27:32 -05:00
$(MAKE) -C $(MSCDIR)/tools
2012-02-05 14:01:28 -05:00
$(OBJCOPY) -O binary $< $@
chmod -x $@
2013-11-09 09:27:32 -05:00
$(MSCDIR)/tools/mkmscimg $@ write
2012-02-05 14:01:28 -05:00
bios.elf: linker.ld $(OBJECTS) libs
%.elf:
2013-07-11 12:36:26 -04:00
$(LD) $(LDFLAGS) -T $< -N -o $@ \
2013-11-09 09:27:32 -05:00
$(MSCDIR)/software/libbase/crt0.o \
2013-07-11 12:36:26 -04:00
$(OBJECTS) \
2013-11-09 09:27:32 -05:00
-L$(MSCDIR)/software/libnet \
-L$(MSCDIR)/software/libbase \
-L$(MSCDIR)/software/libcompiler-rt \
-lnet -lbase-nofloat -lcompiler-rt
2012-02-05 14:01:28 -05:00
chmod -x $@
2013-02-17 08:29:11 -05:00
main.o: main.c
$(compile-dep)
%.o: %.c
$(compile-dep)
%.o: %.S
$(assemble)
2012-02-05 14:01:28 -05:00
libs:
2013-11-09 09:27:32 -05:00
$(MAKE) -C $(MSCDIR)/software/libcompiler-rt
$(MAKE) -C $(MSCDIR)/software/libbase
$(MAKE) -C $(MSCDIR)/software/libnet
2012-02-05 14:01:28 -05:00
clean:
2013-05-28 10:15:30 -04:00
$(RM) $(OBJECTS) $(OBJECTS:.o=.d) bios.elf bios.bin .*~ *~
2012-02-17 12:16:29 -05:00
.PHONY: all main.o clean libs