X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?p=ld45_start_nothing;a=blobdiff_plain;f=Makefile;h=2055efd12331ff95b8e8b3e8fb49cce053a04712;hp=aadff3693d802294e9f2179e4f5ab9b8e46843a8;hb=6231fb6932f67c1f9ae159ea34f5ef9392d67778;hpb=78cf90d60c7cdbfcb8bc1d3e3d03a577d1b70f7b diff --git a/Makefile b/Makefile index aadff36..2055efd 100644 --- a/Makefile +++ b/Makefile @@ -5,13 +5,18 @@ name = game elf = $(name).elf bin = $(name).bin -ASFLAGS = -f elf32 +ASFLAGS = -f elf32 -i src/ LDFLAGS = -m elf_i386 -T game.ld -print-gc-sections QEMU_FLAGS = -fda floppy.img -serial file:serial.log -d guest_errors .PHONY: all -all: floppy.img +all: floppy.img disk.img + +disk.img: boot.img blank.img + cp blank.img $@ + dd of=$@ if=$< conv=notrunc + dd of=$@ if=blank.img bs=1 seek=440 skip=440 count=70 status=none conv=notrunc floppy.img: boot.img dd of=$@ if=/dev/zero bs=512 count=2880 @@ -20,24 +25,27 @@ floppy.img: boot.img boot.img: bootldr.bin $(bin) cat $^ >$@ +blank.img: Makefile + dd if=/dev/zero of=$@ bs=512 count=8192 + echo start=2048 type=c | sfdisk $@ + bootldr.bin: $(elf) objcopy -O binary -j '.boot*' $< $@ -$(bin): $(elf) $(data) +$(bin): $(elf) objcopy -O binary -R '.boot*' $< $@ $(elf): $(obj) $(LD) -o $@ $(obj) -Map link.map $(LDFLAGS) +src/data.o: src/data.asm $(data) + %.o: %.asm nasm -o $@ $(ASFLAGS) $< -data/sprsheet.inc: data/sprsheet.png - img2tiles -o $@ -n -t 32x32 $< - .PHONY: clean clean: - rm -f $(bin) $(obj) bootldr.bin floppy.img boot.img + rm -f $(bin) $(obj) $(data) bootldr.bin floppy.img boot.img .PHONY: disasm disasm: bootldr.disasm $(name).disasm @@ -61,3 +69,13 @@ debug: floppy.img .PHONY: sym sym: $(name).sym + + +tools/csprite/csprite: + $(MAKE) -C tools/csprite + +data/sprsheet.inc: data/sprsheet.png tools/csprite/csprite + tools/csprite/csprite -n sprsheet -s 32x32 $< >$@ + +#data/sprsheet.inc: data/sprsheet.png +# img2tiles -o $@ -n -t 32x32 $<