From: Simon Kuenzer Date: Thu, 23 Feb 2023 21:21:04 +0000 (+0100) Subject: build: Declare __LIBNAME__, __BASENAME__ and __VARIANT__ for .lds.S X-Git-Tag: RELEASE-0.13.0~59 X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=243f0c45;p=unikraft%2Funikraft.git build: Declare __LIBNAME__, __BASENAME__ and __VARIANT__ for .lds.S .lds.S files are linker script files that use the C preprocessor in order to generate the final .lds file. This commit provides Unikraft's common declarations of `__LIBNAME__`, `__BASENAME__`, `__VARIANT__` to this pre-processing step so that they can be used for generating linker scripts. Signed-off-by: Simon Kuenzer Reviewed-by: Delia Pavel Approved-by: Razvan Deaconescu Tested-by: Unikraft CI GitHub-Closes: #868 --- diff --git a/support/build/Makefile.rules b/support/build/Makefile.rules index 6a7a0c7b1..c1d84b89d 100644 --- a/support/build/Makefile.rules +++ b/support/build/Makefile.rules @@ -642,6 +642,7 @@ $(4): $(2) | preprocess $$(ASFLAGS) $$(ASFLAGS-y) $$(ASFLAGS_EXTRA) \ $$($(call vprefix_lib,$(1),ASFLAGS)) $$($(call vprefix_lib,$(1),ASFLAGS-y)) \ $$($(call vprefix_src,$(1),$(2),$(3),FLAGS)) $$($(call vprefix_src,$(1),$(2),$(3),FLAGS-y)) \ + -D__LIBNAME__=$(1) -D__BASENAME__=$(notdir $(2)) $(if $(3),-D__VARIANT__=$(3)) \ $(5) \ $(2) -o $(4) $(call depflags,$(4)) )