Added build type detection, simplified legacy BIOS booting on x86_64

This commit is contained in:
Jozef Nagy 2025-01-25 19:53:01 +01:00
parent 0236209e95
commit 1fc97f9c5f
Signed by untrusted user who does not match committer: crz
GPG key ID: 459A4811CEAC7068
18 changed files with 298 additions and 107 deletions

View file

@ -21,16 +21,19 @@
export INCLUDE_DIRS := $(BOOT_ROOT)/include
export DEFINES += __$(ARCH)__ \
_AXBOOT
export BUILD_DIR ?= build
export SYSROOT_DIR ?= sysroot
export ASFLAGS :=
export CFLAGS := -D__$(ARCH) -D_AXBOOT -ffreestanding -fno-stack-protector -fno-stack-check -MMD -MP
export ASFLAGS := $(foreach d, $(DEFINES), -D$d)
export CFLAGS := $(foreach d, $(DEFINES), -D$d) -ffreestanding -fno-stack-protector -fno-stack-check -MMD -MP
export LDFLAGS := -nostdlib
export BOOT_ROOT := $(ROOT_DIR)/boot
ifeq ($(DEBUG),yes)
ifeq ($(BUILD_TYPE),debug)
CFLAGS += -O0 -g3
else
CFLAGS += -O2