[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[UNIKRAFT PATCH 1/7] build: Enable extending pre-processing rules



Similar to build rules, we enable extending the supported pre-process
rules. This can be achieved by specifying a pre-process rule definition
within a libraries' `Makefule.rules` with the following name scheme:

preprule_<source file extension>

Examples:
 preprule_m4 for *.m4 source files
 preprule_awk for *.awk source files

Signed-off-by: Simon Kuenzer <simon.kuenzer@xxxxxxxxx>
---
 support/build/Makefile.rules | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/support/build/Makefile.rules b/support/build/Makefile.rules
index 9a5963fd..82d8fd7c 100644
--- a/support/build/Makefile.rules
+++ b/support/build/Makefile.rules
@@ -634,12 +634,14 @@ endef
 
 # wrapper for preprule_*,
 # selects appropriate pre-process rule depending on file extension
+# if there is no such pre-process rule available, we throw an error.
 #
 # preprule $libname,$source,$preptarget,$extraflags(optional)
 define preprule =
-$(if $(filter %.m4   ,$(2)),$(call preprule_m4 ,$(1),$(2),$(3),$(4)),\
-$(error $(3): missing pre-processing rule for source type $(suffix $(2))) \
-)
+$(if $(filter preprule_$(call fileext,$(strip $(2))),$(.VARIABLES)),,\
+$(error preprule_$(call fileext,$(strip $(2))) is not defined: Failed to 
install rule for $(2)))
+
+$(call preprule_$(call fileext,$(strip $(2))),$(strip $(1)),$(strip 
$(2)),$(strip $(3)),$(strip $(4)),$(strip $(5)))
 endef
 
 
-- 
2.20.1



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.