Makefile 324 B

1234567891011121314151617181920
  1. .POSIX:
  2. MAIN := main.img
  3. .PHONY: clean run
  4. $(MAIN):
  5. rm -f $(MAIN)
  6. # hlt instruction.
  7. printf '\364' >> '$(MAIN)'
  8. printf '%509s' >> '$(MAIN)'
  9. # Mandatory magic bytes 511 and 512 of a boot sector.
  10. printf '\125\252' >> '$(MAIN)'
  11. clean:
  12. rm -f '$(MAIN)'
  13. run: $(MAIN)
  14. qemu-system-i386 -drive file='$(MAIN)',format=raw