-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
40 lines (26 loc) · 899 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
35
36
37
38
39
export CCFLAGS = -fno-builtin -m32 -Wall -nostartfiles -ffreestanding -nostdlib -nostdinc -std=gnu99 -g -c -O0
export ASFLAGS = -f elf32
export LDFLAGS = -melf_i386 -Ttext 0x1000 --oformat elf32-i386 -T link.ld
export KERNEL_INCDIR = $(shell pwd)/kernel/include
export LIBC_INCDIR = $(shell pwd)/libc/include
.PHONY: all run debug qemu bochs clean libc zbos kernel bootloader prereq
all: libc zbos
run: qemu
debug: bochs
qemu: all
/usr/bin/qemu-system-i386 -drive file=build/zbos.img,format=raw
bochs: all
/usr/bin/bochs
clean:
find . -iname "*.img" -o -iname "*.bin" -o -iname "*.o" -o -iname "*.a" | xargs rm -v
prereq:
mkdir -p build
libc: prereq
cd libc; make
zbos: kernel bootloader prereq
dd if=/dev/zero of=build/zero.img bs=64K count=1
cat build/boot.img build/kernel.bin build/zero.img > build/zbos.img
kernel: prereq
cd kernel; make
bootloader: prereq
cd boot; make