diff options
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..0f7ed29 --- /dev/null +++ b/Makefile @@ -0,0 +1,27 @@ +GRUB_DIR=grub +KERNEL_DIR=kernel +DST=iso +ISO=kernel.iso + +all: run + +run: kernel.elf + qemu-system-i386 -kernel $(KERNEL_DIR)/kernel.elf + +run-iso: create_iso + qemu-system-i386 -hda $(ISO) + +create_iso: cpy + grub-mkrescue -o $(ISO) $(DST) + +cpy: kernel.elf + mkdir -p $(DST)/boot/grub + cp $(KERNEL_DIR)/kernel.elf $(DST)/boot/ + cp $(GRUB_DIR)/grub.cfg $(DST)/boot/grub/ + +kernel.elf: + cd $(KERNEL_DIR); $(MAKE) + +clean: + cd $(KERNEL_DIR); $(MAKE) clean + -rm -fr $(ISO) $(DST) 2>/dev/null |