-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
54 lines (41 loc) · 1.17 KB
/
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
GDBPORT := 26000
TOP = .
CC := i386-fos-elf-gcc -pipe
GDB := gdb
AS := as
AR := ar
LD := ld
CFLAGS := -O1 -fno-builtin -fno-tree-ch -I$(TOP)
CFLAGS += -fno-omit-frame-pointer
CFLAGS += -std=gnu99
CFLAGS += -static
CFLAGS += -gstabs
CFLAGS += -Wall -Wno-format -Wno-unused -Werror -m32
CFLAGS += -fno-stack-protector
LD_FLAGS := -m elf_i386
ULDFLAGS := -T user/user.ld
KERN_CFLAGS := $(CFLAGS) -DKERNEL
USER_CFLAGS := $(CFLAGS) -DUSER
GCC_LIB := /usr/local/lib/gcc/i386-fos-elf/4.6.4/libgcc.a
include kern/kern.mk
include lib/lib.mk
include user/user.mk
include boot/boot.mk
QEMU := /usr/local/bin/qemu-system-i386
QEMUOPTS = -drive file=obj/kern/kernel.img,index=0,media=disk,format=raw -m 128 -serial mon:stdio -gdb tcp::$(GDBPORT)
QEMUOPTS += -drive file=obj/disk/user_disk.img,index=1,media=disk,format=raw
gdb:
gdb -n -tui -x .gdbinit
qemu: obj/kern/kernel.img
@$(QEMU) $(QEMUOPTS) 2>/dev/null
qemu-nox: obj/kern/kernel.img
@$(QEMU) -nographic $(QEMUOPTS)
qemu-gdb: obj/kern/kernel.img
@$(QEMU) $(QEMUOPTS) -S 2>/dev/null
qemu-nox-gdb: obj/kern/kernel.img
@$(QEMU) -nographic $(QEMUOPTS) -S
clean:
rm -f obj/kern/*
rm -f obj/user/*
rm -f obj/lib/*
rm -f obj/boot/*