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
|
|
|
|
$(OBJCOPY) -O binary $< $@
|
|
|
|
chmod -x $@
|
2014-04-18 18:01:29 -04:00
|
|
|
$(MSCDIR)/mkmscimg.py $@
|
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 \
|
2013-05-19 06:41:40 -04:00
|
|
|
-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)
|
|
|
|
|
2012-05-31 14:17:33 -04:00
|
|
|
%.o: %.c
|
|
|
|
$(compile-dep)
|
|
|
|
|
2013-01-10 11:20:31 -05:00
|
|
|
%.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
|
|
|
|
2014-02-15 08:01:50 -05:00
|
|
|
.PHONY: all main.o clean libs
|