]> git.lizzy.rs Git - nyax.git/blob - Makefile
VESA support
[nyax.git] / Makefile
1 OBJS = main.o framebuffer.o memory.o
2 DEV=/dev/sdb
3
4 nyax.img: stage1.out stage2.out stage3.out
5         cat stage{1,2,3}.out > nyax.img
6
7 stage1.out: mbr.asm stage2.out stage3.out
8         nasm -f bin mbr.asm -o stage1.out \
9                 -dKSIZE=$$(du -cb stage{2,3}.out | tail -n1 | cut -f1)
10
11 stage2.out: setup.asm
12         nasm -f bin setup.asm -o stage2.out
13
14 stage3.out: $(OBJS) stage2.out
15         ld -o stage3.out --oformat binary $(OBJS) \
16                 -Ttext $$(printf "%x\n" $$(echo $$(du -b stage2.out | cut -f1)+32256 | bc))
17
18 %.o: %.asm
19         nasm -f elf64 $< -o $@
20
21 .PHONY: run
22 run: nyax.img
23         bochs -q
24
25 .PHONY: clean
26 clean:
27         rm -rf *.o *.out *.img
28
29 flash: nyax.img
30         dd if=./nyax.img of=$(DEV)