caos-with-snake/Makefile
2022-09-21 17:37:27 +03:00

23 lines
400 B
Makefile

AS=x86_64-elf-as
LD=x86_64-elf-ld
run: mbr.bin
qemu-system-i386 -drive format=raw,file=$<
debug: mbr.bin
qemu-system-i386 -drive format=raw,file=$< -s -S &
i386-elf-gdb \
-ex "target remote localhost:1234" \
-ex "set architecture i8086" \
-ex "break *0x7c00" \
-ex "continue"
%.o: %.S
$(AS) $^ -o $@
mbr.bin: mbr.o
$(LD) -Ttext=0x7c00 --oformat=binary $^ -o $@
clean:
rm *.bin *.o