summaryrefslogtreecommitdiffstats
path: root/makefile
diff options
context:
space:
mode:
Diffstat (limited to 'makefile')
-rw-r--r--makefile24
1 files changed, 15 insertions, 9 deletions
diff --git a/makefile b/makefile
index fd06b87..2dcead7 100644
--- a/makefile
+++ b/makefile
@@ -1,19 +1,25 @@
-SUBDIR=kernel
+GRUB_DIR=grub
+KERNEL_DIR=kernel
+DST=mini_kernel
+ISO=mini_kernel.iso
all: run
+check:
+ qemu-system-i386 -kernel $(KERNEL_DIR)/kernel.elf
+
run: create_iso
- qemu-system-i386 -hda mini_kernel/mini_kernel.iso
+ qemu-system-i386 -hda $(ISO)
create_iso: cpy
- grub-mkrescue -o mini_kernel/mini_kernel.iso mini_kernel
+ grub-mkrescue -o $(ISO) $(DST)
cpy:
- cd $(SUBDIR); $(MAKE) run
- cp grub/grub.cfg mini_kernel/
- cp kernel/kernel.elf mini_kernel/
-
+ cd $(KERNEL_DIR); $(MAKE)
+ mkdir -p $(DST)/boot $(DST)/grub
+ cp $(KERNEL_DIR)/kernel.elf $(DST)/boot/
+ cp $(GRUB_DIR)/grub.cfg $(DST)/grub/
clean:
- cd $(SUBDIR); $(MAKE) clean
- -rm mini_kernel/*.iso mini_kernel/*.cfg mini_kernel/*.elf 2>/dev/null
+ cd $(KERNEL_DIR); $(MAKE) clean
+ -rm -fr $(ISO) $(DST) 2>/dev/null