BIOS starting on M1, SDRAM not working
[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_splash.bin
8
9 %.bin: %.elf
10         $(OBJCOPY) $(SEGMENTS) -O binary $< $@
11         chmod -x $@
12         $(MMDIR)/tools/crc32 $@ write
13
14 bios.elf: linker.ld $(OBJECTS)
15         $(MAKE) -C $(MMDIR)/software/libhpdmc
16         $(MAKE) -C $(MMDIR)/software/libbase
17         $(MAKE) -C $(MMDIR)/software/libnet
18         $(LD) $(LDFLAGS) -T linker.ld -N -o $@ $(OBJECTS) -L$(MMDIR)/software/libhpdmc -L$(MMDIR)/software/libbase -L$(MMDIR)/software/libnet -lhpdmc -lbase-light -lnet
19         chmod -x $@
20
21 splash.raw: splash.png
22         $(MMDIR)/tools/makeraw splash.png
23
24 bios_padded.bin: bios.bin
25         dd if=bios.bin of=bios_padded.bin bs=65536 conv=sync
26
27 bios_splash.bin: bios_padded.bin splash.raw
28         cat bios_padded.bin splash.raw > bios_splash.bin
29
30 .PHONY: clean depend bios.elf
31
32 depend:
33         makedepend -Y -- $(CFLAGS) -- *.c
34
35 clean:
36         rm -f *.o bios.elf bios.bin bios_padded.bin splash.raw bios_splash.bin .*~ *~ Makefile.bak
37
38 # DO NOT DELETE
39
40 boot.o: ../../software/include/base/stdio.h
41 boot.o: ../../software/include/base/stdlib.h
42 boot.o: ../../software/include/base/console.h
43 boot.o: ../../software/include/base/uart.h
44 boot.o: ../../software/include/base/system.h
45 boot.o: ../../software/include/base/board.h
46 boot.o: ../../software/include/base/cffat.h ../../software/include/base/crc.h
47 boot.o: ../../tools/sfl.h ../../software/include/net/microudp.h
48 boot.o: ../../software/include/net/tftp.h ../../software/include/hw/hpdmc.h
49 boot.o: ../../software/include/hw/common.h boot.h
50 main.o: ../../software/include/base/stdio.h
51 main.o: ../../software/include/base/stdlib.h
52 main.o: ../../software/include/base/console.h
53 main.o: ../../software/include/base/string.h
54 main.o: ../../software/include/base/uart.h
55 main.o: ../../software/include/base/cffat.h ../../software/include/base/crc.h
56 main.o: ../../software/include/base/system.h
57 main.o: ../../software/include/base/board.h
58 main.o: ../../software/include/base/version.h
59 main.o: ../../software/include/net/mdio.h ../../software/include/hw/vga.h
60 main.o: ../../software/include/hw/common.h ../../software/include/hw/fmlbrg.h
61 main.o: ../../software/include/hw/sysctl.h
62 main.o: ../../software/include/hw/capabilities.h
63 main.o: ../../software/include/hw/gpio.h ../../software/include/hw/uart.h
64 main.o: ../../software/include/hw/hpdmc.h boot.h splash.h
65 splash.o: ../../software/include/base/stdio.h
66 splash.o: ../../software/include/base/stdlib.h
67 splash.o: ../../software/include/hw/vga.h ../../software/include/hw/common.h
68 splash.o: splash.h