summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2015-11-02 14:54:17 +0100
committerJérémy Zurcher <jeremy@asynk.ch>2015-11-02 14:54:17 +0100
commit2febca7062c640a379b963d46adf7c356582d92a (patch)
treeb8b1828466ced293a3d63b76393ce7be9e7f3d4f
parent4c4e1c1920c28872e72faf91877467197a1d4b6a (diff)
downloados_skeleton-master.zip
os_skeleton-master.tar.gz
improve/fix top level makefileHEADmaster
-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