f373e252df049116b1bafe312ea2fa712a3400d8
[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         $(LD) $(LDFLAGS) -T linker.ld -N -o $@ $(OBJECTS) -L$(MMDIR)/software/libbase -lbase-light
16         chmod -x $@
17
18 splash.raw: splash.png
19         $(MMDIR)/tools/makeraw splash.png
20
21 bios_padded.bin: bios.bin
22         dd if=bios.bin of=bios_padded.bin bs=65536 conv=sync
23
24 bios_splash.bin: bios_padded.bin splash.raw
25         cat bios_padded.bin splash.raw > bios_splash.bin
26
27 .PHONY: clean depend
28
29 depend:
30         makedepend -Y -- $(CFLAGS) -- *.c
31
32 clean:
33         rm -f *.o bios.elf bios.bin bios_padded.bin splash.raw bios_splash.bin .*~ *~ Makefile.bak
34
35 # DO NOT DELETE
36
37 boot.o: ../../software/include/stdio.h ../../software/include/stdlib.h
38 boot.o: ../../software/include/console.h ../../software/include/uart.h
39 boot.o: ../../software/include/system.h ../../software/include/board.h
40 boot.o: ../../software/include/cffat.h ../../software/include/crc.h
41 boot.o: ../../tools/sfl.h ../../software/include/hw/hpdmc.h
42 boot.o: ../../software/include/hw/common.h boot.h
43 main.o: ../../software/include/stdio.h ../../software/include/stdlib.h
44 main.o: ../../software/include/console.h ../../software/include/string.h
45 main.o: ../../software/include/uart.h ../../software/include/cffat.h
46 main.o: ../../software/include/crc.h ../../software/include/system.h
47 main.o: ../../software/include/board.h ../../software/include/version.h
48 main.o: ../../software/include/hw/hpdmc.h ../../software/include/hw/common.h
49 main.o: ../../software/include/hw/vga.h ../../software/include/hw/fmlbrg.h
50 main.o: ../../software/include/hw/sysctl.h ../../software/include/hw/gpio.h
51 main.o: ../../software/include/hw/uart.h boot.h splash.h
52 splash.o: ../../software/include/stdio.h ../../software/include/stdlib.h
53 splash.o: ../../software/include/system.h ../../software/include/hw/vga.h
54 splash.o: ../../software/include/hw/common.h splash.h