From 2febca7062c640a379b963d46adf7c356582d92a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Zurcher?= Date: Mon, 2 Nov 2015 14:54:17 +0100 Subject: improve/fix top level makefile --- makefile | 24 +++++++++++++++--------- 1 file 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 -- cgit v1.1-2-g2b99