build: Misc updates for new freestanding-toolchain

This commit is contained in:
mintsuki 2023-03-16 03:38:53 +01:00
parent 852750548e
commit 282d2df6db
4 changed files with 17 additions and 2 deletions

View File

@ -25,7 +25,7 @@ MKESCAPE = $(subst $(SPACE),\ ,$(1))
SHESCAPE = $(subst ','\'',$(1))
NASMESCAPE = $(subst ','"'$(COMMA) \"'\"$(COMMA) '"',$(1))
define DEFAULT_VAR =
define PROPER_ASSIGN =
ifeq ($(origin $1),default)
override $(1) := $(2)
endif
@ -43,7 +43,7 @@ override BUILD_PXE := @BUILD_PXE@
override BUILD_CD := @BUILD_CD@
override BUILD_LIMINE_DEPLOY := @BUILD_LIMINE_DEPLOY@
$(eval $(call DEFAULT_VAR,CC,@CC@))
$(eval $(call PROPER_ASSIGN,CC,@CC@))
export CC
override MKDIR_P := @MKDIR_P@

View File

@ -1,6 +1,11 @@
override MAKEFLAGS += -rR
include $(TOOLCHAIN_FILE)
export CC_FOR_TARGET
export LD_FOR_TARGET
export OBJDUMP_FOR_TARGET
export OBJCOPY_FOR_TARGET
export READELF_FOR_TARGET
TARGET ?=
BUILDDIR ?=

View File

@ -1,6 +1,11 @@
override MAKEFLAGS += -rR
include $(TOOLCHAIN_FILE)
export CC_FOR_TARGET
export LD_FOR_TARGET
export OBJDUMP_FOR_TARGET
export OBJCOPY_FOR_TARGET
export READELF_FOR_TARGET
BUILDDIR ?=

View File

@ -1,4 +1,9 @@
include $(TOOLCHAIN_FILE)
export CC_FOR_TARGET
export LD_FOR_TARGET
export OBJDUMP_FOR_TARGET
export OBJCOPY_FOR_TARGET
export READELF_FOR_TARGET
override CC := $(CC_FOR_TARGET)
CFLAGS = -O2 -g -Wall -Wextra