2015-09-28 08:33:37 -04:00
|
|
|
include ../include/generated/variables.mak
|
|
|
|
include $(MISOC_DIRECTORY)/software/common.mak
|
2012-02-05 14:01:28 -05:00
|
|
|
|
2014-05-14 04:24:56 -04:00
|
|
|
OBJECTS=isr.o sdram.o main.o boot-helper-$(CPU).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
|
|
|
|
$(OBJCOPY) -O binary $< $@
|
|
|
|
chmod -x $@
|
2015-09-28 08:33:37 -04:00
|
|
|
$(PYTHON) -m misoc.tools.mkmscimg $@
|
2012-02-05 14:01:28 -05:00
|
|
|
|
2015-09-28 08:33:37 -04:00
|
|
|
bios.elf: $(BIOS_DIRECTORY)/linker.ld $(OBJECTS)
|
2012-02-05 14:01:28 -05:00
|
|
|
|
|
|
|
%.elf:
|
2013-07-11 12:36:26 -04:00
|
|
|
$(LD) $(LDFLAGS) -T $< -N -o $@ \
|
2015-09-28 08:33:37 -04:00
|
|
|
../libbase/crt0-$(CPU).o \
|
2013-07-11 12:36:26 -04:00
|
|
|
$(OBJECTS) \
|
2015-09-28 08:33:37 -04:00
|
|
|
-L../libnet \
|
|
|
|
-L../libbase \
|
|
|
|
-L../libcompiler_rt \
|
|
|
|
-lnet -lbase-nofloat -lcompiler_rt
|
2012-02-05 14:01:28 -05:00
|
|
|
chmod -x $@
|
|
|
|
|
2015-09-28 08:33:37 -04:00
|
|
|
main.o: $(BIOS_DIRECTORY)/main.c
|
2013-02-17 08:29:11 -05:00
|
|
|
$(compile-dep)
|
|
|
|
|
2015-09-28 08:33:37 -04:00
|
|
|
%.o: $(BIOS_DIRECTORY)/%.c
|
2012-05-31 14:17:33 -04:00
|
|
|
$(compile-dep)
|
|
|
|
|
2015-09-28 08:33:37 -04:00
|
|
|
%.o: $(BIOS_DIRECTORY)/%.S
|
2013-01-10 11:20:31 -05:00
|
|
|
$(assemble)
|
|
|
|
|
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
|
|
|
|
2015-09-28 08:33:37 -04:00
|
|
|
.PHONY: all main.o clean
|