caos-with-snake/Makefile

23 lines
400 B
Makefile
Raw Normal View History

2022-09-21 16:53:45 +03:00
AS=x86_64-elf-as
LD=x86_64-elf-ld
run: mbr.bin
qemu-system-i386 -drive format=raw,file=$<
2022-09-21 17:37:27 +03:00
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"
2022-09-21 16:53:45 +03:00
%.o: %.S
$(AS) $^ -o $@
mbr.bin: mbr.o
$(LD) -Ttext=0x7c00 --oformat=binary $^ -o $@
2022-09-21 17:37:27 +03:00
clean:
rm *.bin *.o