summaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2015-11-03 00:15:58 +0100
committerJérémy Zurcher <jeremy@asynk.ch>2015-11-03 00:15:58 +0100
commita71fe5ed5d709ef0a3caefb744a99c575fb9dd29 (patch)
tree9a33e76614e7f51a4c255d8b59068e1dd289b35c /Makefile
downloadjeyzuos-a71fe5ed5d709ef0a3caefb744a99c575fb9dd29.zip
jeyzuos-a71fe5ed5d709ef0a3caefb744a99c575fb9dd29.tar.gz
initial commit
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile27
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