aboutsummaryrefslogtreecommitdiff
path: root/toolchain.makefile
blob: ce8fdc6779ed681ba6db783cab77179a9086454d (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
31
32
33
# Toolchain
TARGET := i686-elf

NM := llvm-nm
SED := sed

AS       := clang
AS_FLAGS :=

LD       := ld.lld
LD_FLAGS := -nostdlib -T linker.ld --thinlto-cache-dir=$(OBJ_DIR)/thinlto_cache
# TODO: linking fails with -O0 and -O1 without -flto=thin

CXX         := clang++
TEST_CXX    := clang++
CXX_FLAGS   := -std=c++20 -g -O2 -flto=thin \
	       -mkernel -ffreestanding -nostdlib -nostdinc -nostdinc++ \
	       -Wall -Wextra -Werror=pedantic \
	       -Werror=date-time \
	       -Werror=shadow-all \
	       -Wold-style-cast -Wconversion \
	       -Wconsumed
CXX_TEST_FLAGS := -std=c++20 -Wall -Wextra -Werror=pedantic
CXX_INCLUDE := $(CURDIR)/libk $(CURDIR)/src $(CURDIR)/drivers
CXX_SYSTEM_INCLUDE := $(CURDIR)/grub

#
GRUB_MKRESCUE := grub-mkrescue
GRUB_FILE     := grub-file
GRUB_SCRIPT   := grub-script-check

EMU := qemu-system-i386 -cdrom