summaryrefslogtreecommitdiffstats
path: root/Makefile
blob: bf0f6112ef50ee7a8e67fc11842a120510f549c8 (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
28
29
30
GRUB_DIR=grub
KERNEL_DIR=kernel
ISO_DIR=iso
ISO=kernel.iso

.PHONY: kernel iso

all: run

run: kernel
	./tools/test_port &
	qemu-system-i386 -kernel $(KERNEL_DIR)/kernel.elf -serial pty

run-iso: $(ISO)
	qemu-system-i386 -hda $(ISO)

kernel.iso: iso
	grub-mkrescue -o $(ISO) $(ISO_DIR)

iso: kernel
	mkdir -p $(ISO_DIR)/boot/grub
	cp $(KERNEL_DIR)/kernel.elf $(ISO_DIR)/boot/
	cp $(GRUB_DIR)/grub.cfg $(ISO_DIR)/boot/grub/

kernel:
	cd $(KERNEL_DIR); $(MAKE)

clean:
	cd $(KERNEL_DIR); $(MAKE) clean
	-rm -fr $(ISO) $(ISO_DIR) 2>/dev/null