[PATCH weston 06/10] Makefile.am: Make the external xml scanning rule version generic

Jonas Ådahl jadahl at gmail.com
Wed Nov 4 00:49:55 PST 2015


Signed-off-by: Jonas Ådahl <jadahl at gmail.com>
---
 Makefile.am | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index 6b2b3da..66d133d 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1414,13 +1414,21 @@ doc: $(DOXYGEN_INDICES)
 
 .SECONDEXPANSION:
 
-protocol/%-unstable-v1-protocol.c : $(WAYLAND_PROTOCOLS_DATADIR)/unstable/$$*/$$*-unstable-v1.xml
+define protostability
+$(shell echo $1 | sed 's/.*\(\<unstable\>\|\<stable\>\).*/\1/')
+endef
+
+define protoname
+$(shell echo $1 | sed 's/\([a-z\-]\+\)-[a-z]\+-v[0-9]\+/\1/')
+endef
+
+protocol/%-protocol.c : $(WAYLAND_PROTOCOLS_DATADIR)/$$(call protostability,$$*)/$$(call protoname,$$*)/$$*.xml
 	$(AM_V_GEN)$(MKDIR_P) $(dir $@) && $(wayland_scanner) code < $< > $@
 
-protocol/%-unstable-v1-server-protocol.h : $(WAYLAND_PROTOCOLS_DATADIR)/unstable/$$*/$$*-unstable-v1.xml
+protocol/%-server-protocol.h : $(WAYLAND_PROTOCOLS_DATADIR)/$$(call protostability,$$*)/$$(call protoname,$$*)/$$*.xml
 	$(AM_V_GEN)$(MKDIR_P) $(dir $@) && $(wayland_scanner) server-header < $< > $@
 
-protocol/%-unstable-v1-client-protocol.h : $(WAYLAND_PROTOCOLS_DATADIR)/unstable/$$*/$$*-unstable-v1.xml
+protocol/%-client-protocol.h : $(WAYLAND_PROTOCOLS_DATADIR)/$$(call protostability,$$*)/$$(call protoname,$$*)/$$*.xml
 	$(AM_V_GEN)$(MKDIR_P) $(dir $@) && $(wayland_scanner) client-header < $< > $@
 
 protocol/%-protocol.c : $(top_srcdir)/protocol/%.xml
-- 
2.4.3



More information about the wayland-devel mailing list