summaryrefslogtreecommitdiffstats
path: root/makefile
blob: 2dcead7b15339d29b61455977eb1b15df73ce1e6 (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
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 $(ISO)

create_iso: cpy
	grub-mkrescue -o $(ISO) $(DST)

cpy:
	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 $(KERNEL_DIR); $(MAKE) clean
	-rm -fr $(ISO) $(DST) 2>/dev/null