-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
35 lines (26 loc) · 869 Bytes
/
Makefile
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
31
32
33
34
export BOOTBLOCK_TARGET := dbr.img
export BOOTLOADER_TARGET := loader.bin
export KERNEL_TARGET := okernel
export CC := gcc
export AS := nasm
export INCLUDE := include
export CFLAGS += -std=c11 -m32 -nostdlib -fno-stack-protector -fno-builtin -O2 -mno-sse -fno-PIE -g
export LDFLAGS := -melf_i386 -g -O2
export ASFLAGS := -g -O2 -w+all
all:
$(MAKE) -C boot
$(MAKE) -C kernel
bochs: all .bochsrc
bash scripts/mkfd.sh
bochs -q
qemu: all
bash scripts/mkfd.sh
qemu-system-i386 -drive file=a.img,format=raw,if=floppy -drive file=c.img,format=raw -boot a -serial mon:stdio
qemu-dbg: all
bash scripts/mkfd.sh
qemu-system-i386 -s -S -drive file=a.img,format=raw,if=floppy -drive file=c.img,format=raw -boot a -serial mon:stdio
.phony: clean
clean:
$(MAKE) -C boot clean
$(MAKE) -C kernel clean
$(RM) $(KERNEL_TARGET) $(BOOTBLOCK_TARGET) $(BOOTLOADER_TARGET)