]> xenbits.xensource.com Git - unikraft/unikraft.git/commitdiff
build: Declare __LIBNAME__, __BASENAME__ and __VARIANT__ for .lds.S
authorSimon Kuenzer <simon@unikraft.io>
Thu, 23 Feb 2023 21:21:04 +0000 (22:21 +0100)
committerUnikraft <monkey@unikraft.io>
Sun, 7 May 2023 16:44:41 +0000 (16:44 +0000)
.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 <simon@unikraft.io>
Reviewed-by: Delia Pavel <delia_maria.pavel@stud.acs.upb.ro>
Approved-by: Razvan Deaconescu <razvand@unikraft.io>
Tested-by: Unikraft CI <monkey@unikraft.io>
GitHub-Closes: #868

support/build/Makefile.rules

index 6a7a0c7b12f7ff787ebbdee01674fe12ccd128be..c1d84b89d9fc4e94aa4926d07fb349ddc179d8d8 100644 (file)
@@ -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))
        )