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

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


  • To: Simon Kuenzer <simon.kuenzer@xxxxxxxxx>
  • From: Vlad-Andrei BĂDOIU <vlad_andrei.badoiu@xxxxxx>
  • Date: Mon, 19 Apr 2021 13:04:35 +0300 (EEST)
  • Cc: minios-devel <minios-devel@xxxxxxxxxxxxx>
  • Delivery-date: Mon, 19 Apr 2021 10:04:48 +0000
  • Dkim-filter: OpenDKIM Filter v2.10.3 mx.upb.ro C2F80B5600AD
  • List-id: Mini-os development list <minios-devel.lists.xenproject.org>
  • Thread-index: nK6jPE11HkBIyZ3iYX8j9NjTRCOR8g==
  • Thread-topic: build: Enable extending pre-processing rules

Hi Simon,

Thank you for the patch. It works alright.

Reviewed-by: Vlad-Andrei Badoiu <vlad_andrei.badoiu@xxxxxx>

----- Original Message -----
From: "Simon Kuenzer" <simon.kuenzer@xxxxxxxxx>
To: "minios-devel" <minios-devel@xxxxxxxxxxxxx>
Cc: "Simon Kuenzer" <simon.kuenzer@xxxxxxxxx>
Sent: Friday, December 18, 2020 8:09:18 PM
Subject: [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®.