Makefile 867 B

1234567891011121314151617181920212223242526272829303132
  1. QEMU_ARGS=-drive file=build/boot.img,format=raw -no-reboot -no-shutdown -enable-kvm
  2. .PHONY: run
  3. run: build
  4. qemu-system-i386 $(QEMU_ARGS) -display curses -S -s
  5. .PHONY: srun
  6. srun: build
  7. qemu-system-i386 $(QEMU_ARGS) -display none -S -s -serial mon:stdio
  8. .PHONY: nativerun
  9. nativerun: build
  10. qemu-system-i386 $(QEMU_ARGS) -display none -serial mon:stdio
  11. .PHONY: configure
  12. configure:
  13. cmake -Bbuild -DCMAKE_BUILD_TYPE=Debug
  14. cp build/compile_commands.json .
  15. .PHONY: build
  16. build:
  17. cmake --build build --target boot.img
  18. .PHONY: clean
  19. clean:
  20. -rm -rf build
  21. -rm compile_commands.json
  22. .PHONY: debug
  23. debug:
  24. gdb --symbols=build/kernel.out --init-eval-command 'set pagination off' --init-eval-command 'target remote:1234' --eval-command 'hbr kernel_main' --eval-command 'c'
  25. build/boot.vdi: build/boot.img
  26. -rm build/boot.vdi
  27. VBoxManage convertfromraw $< $@ --format VDI