-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathconfig.mk
76 lines (63 loc) · 1.77 KB
/
config.mk
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
on_check=$(filter $(1),on true 1)
ifeq ($(OS),Windows_NT)
BUILDOS ?= win
else
BUILDOS ?= nix
endif
export BUILDOS
export ARCH?=x86
DEBUG?=on
OSVER?=1.0
OSNAME?=DepthOS
export BINCPATH?=/bin
BUILDDIR=build
INITRD_FILE?=initrd.img
INITRD_ROOT=initrd
FS_ROOT=disk-fs
KERNEL_MAP_FILE?=$(INITRD_ROOT)/kernel.map
QEMU_ARGS=-nographics -display none
# QEMU_ARGS=-no-reboot
QEMU_DEBUG?=false
ifeq ($(QEMU_DEBUG),$(call on_check,$(QEMU_DEBUG)))
QEMU_ARGS += -s -S
QEMU_TTY=on
endif
QEMU_APPEND?=
ifeq ($(QEMU_TTY),$(call on_check,$(QEMU_TTY)))
QEMU_APPEND += console=ttyS0
QEMU_ARGS += -monitor none -serial stdio
endif
ifeq ($(NO_COLOR),$(call on_check,$(NO_COLOR)))
QEMU_APPEND += console_no_color
endif
# QEMU_APPEND += console_no_color shutdown_on_panic
QEMU_ARGS += -append "$(QEMU_APPEND)" -m 4G
CC?=$(BINCPATH)/gcc
LD?=$(BINCPATH)/ld
ASM?=nasm
export CC
export LD
export ASM
CSTD=11
export CEMU=-m32
CCFLAGS = -Iinclude -ffreestanding -nostdlib -nostdinc -fno-builtin -fno-exceptions -fno-leading-underscore -fno-pic -MP -MD -fno-pie -fno-PIC
# TODO: resolve int-to-pointer-cast in list.h (to and from macros)
CCFLAGS += -W -Wall -Wno-unused-parameter -Wno-type-limits -Wno-parentheses -Wno-unused-variable -Wno-maybe-uninitialized -Wno-return-local-addr -Wno-return-type -Wno-int-to-pointer-cast
ASFLAGS = -m32
NASMFLAGS= -f elf32
export LDEMU=-melf_i386
LDFILE=link.ld
LDFLAGS=-L
OUTBIN=$(OSNAME)-v$(OSVER)-$(ARCH)
BUILDDEFS=-DOSVER=\"$(OSVER)\" -DCONFIG_EMULATOR # -DCONFIG_EMULATOR_QEMU
ifeq ($(DEBUG), $(call on_check,$(DEBUG)))
BUILDDEFS += -DDEBUG
endif
# APPS=init nyancat donut # test-gcc cat
# APPS=init donut # test-gcc
# APPS=mdinit nyancat music-player
# INITRD_APPS=mdinit
# APPS_BUILDDIR=build
# APPS_ROOTPATH=..
# APPS_INSTALLDIR=$(INITRD_ROOT)
# APPS_INSTALLDIR=$(FS_ROOT)/bin