Fast boot from flash
[mw/milkymist.git] / software / bios / Makefile
1 MMDIR=../..
2 include $(MMDIR)/software/include.mak
3
4 OBJECTS=crt0.o main.o boot.o splash.o
5 SEGMENTS=-j .text -j .data -j .rodata
6
7 all: bios.bin
8
9 %.bin: %.elf
10         $(MAKE) -C $(MMDIR)/tools
11         $(OBJCOPY) $(SEGMENTS) -O binary $< $@
12         chmod -x $@
13         $(MMDIR)/tools/crc32 $@ write
14
15 bios.elf: linker.ld $(OBJECTS)
16         $(MAKE) -C $(MMDIR)/software/libhpdmc
17         $(MAKE) -C $(MMDIR)/software/libbase
18         $(MAKE) -C $(MMDIR)/software/libnet
19         $(LD) $(LDFLAGS) -T linker.ld -N -o $@ $(OBJECTS) -L$(MMDIR)/software/libhpdmc -L$(MMDIR)/software/libbase -L$(MMDIR)/software/libnet -lhpdmc -lbase-light -lnet
20         chmod -x $@
21
22 .PHONY: clean depend bios.elf
23
24 depend:
25         makedepend -Y -- $(CFLAGS) -- *.c
26
27 clean:
28         rm -f *.o bios.elf bios.bin .*~ *~ Makefile.bak
29
30 # DO NOT DELETE
31
32 boot.o: ../../software/include/base/stdio.h
33 boot.o: ../../software/include/base/stdlib.h
34 boot.o: ../../software/include/base/console.h
35 boot.o: ../../software/include/base/uart.h
36 boot.o: ../../software/include/base/system.h
37 boot.o: ../../software/include/base/board.h ../../software/include/base/crc.h
38 boot.o: ../../tools/sfl.h ../../software/include/base/blockdev.h
39 boot.o: ../../software/include/base/fatfs.h
40 boot.o: ../../software/include/net/microudp.h
41 boot.o: ../../software/include/net/tftp.h ../../software/include/hw/hpdmc.h
42 boot.o: ../../software/include/hw/common.h boot.h
43 main.o: ../../software/include/base/stdio.h
44 main.o: ../../software/include/base/stdlib.h
45 main.o: ../../software/include/base/console.h
46 main.o: ../../software/include/base/string.h
47 main.o: ../../software/include/base/uart.h
48 main.o: ../../software/include/base/blockdev.h
49 main.o: ../../software/include/base/fatfs.h ../../software/include/base/crc.h
50 main.o: ../../software/include/base/system.h
51 main.o: ../../software/include/base/board.h
52 main.o: ../../software/include/base/version.h
53 main.o: ../../software/include/net/mdio.h ../../software/include/hw/vga.h
54 main.o: ../../software/include/hw/common.h ../../software/include/hw/fmlbrg.h
55 main.o: ../../software/include/hw/sysctl.h
56 main.o: ../../software/include/hw/capabilities.h
57 main.o: ../../software/include/hw/gpio.h ../../software/include/hw/uart.h
58 main.o: ../../software/include/hw/hpdmc.h ../../software/include/hw/flash.h
59 main.o: boot.h splash.h
60 splash.o: ../../software/include/base/stdio.h
61 splash.o: ../../software/include/base/stdlib.h
62 splash.o: ../../software/include/hw/vga.h ../../software/include/hw/common.h
63 splash.o: ../../software/include/hw/flash.h splash.h