]> xenbits.xensource.com Git - unikraft/unikraft.git/commitdiff
build: Compile dependencies for source files (`*_CDEPS`)
authorSimon Kuenzer <simon@unikraft.io>
Mon, 28 Aug 2023 20:20:39 +0000 (22:20 +0200)
committerRazvan Deaconescu <razvand@unikraft.io>
Fri, 20 Oct 2023 16:35:55 +0000 (19:35 +0300)
For each source file, additional dependencies that trigger recompilation
can be specified in `Makefile.uk` with `*_CDEPS`:
```
 <LIBNAME>_<SOURCENAME>[_<VARIANT>]_CDEPS   += <dependency>
 <LIBNAME>_<SOURCENAME>[_<VARIANT>]_CDEPS-y += <dependency>
```
Please note that because of the need to remove quotes from filenames,
`qstrip` is called and therefore the CDEPS variable cannot be expanded
with a second expansion (`$$()`).

Signed-off-by: Simon Kuenzer <simon@unikraft.io>
Reviewed-by: Cezar Craciunoiu <cezar.craciunoiu@unikraft.io>
Reviewed-by: Sergiu Moga <sergiu@unikraft.io>
Reviewed-by: Marco Schlumpp <marco@unikraft.io>
Approved-by: Marco Schlumpp <marco@unikraft.io>
GitHub-Closes: #1070

support/build/Makefile.rules

index 1aa6abf59cd585d79cfabea9921430278139b815..08cb44f10e0ac09164f450fd5a39275d1cde116a 100644 (file)
@@ -819,7 +819,7 @@ $(error buildrule_$(call fileext,$(strip $(2))) is not defined: Failed to instal
 $(call buildrule_$(call fileext,$(strip $(2))),$(strip $(1)),$(strip $(2)),$(strip $(3)),$(strip $(4)),$(strip $(5)))
 
 # Default buildrule_* dependencies
-$(4): | preprocess
+$(4): $(call qstrip,$($(call vprefix_src,$(1),$(2),$(3),CDEPS)) $($(call vprefix_src,$(1),$(2),$(3),CDEPS-y))) | preprocess
 endef
 
 #################################################