summaryrefslogtreecommitdiffstats
path: root/Makefile
blob: 0f7ed299bea5e3d2ff1d93e9b2073d0cbeed0584 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
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