summaryrefslogtreecommitdiff
path: root/src/Makefile.am
diff options
context:
space:
mode:
authorDerek Foreman <derekf@osg.samsung.com>2017-01-17 15:37:50 -0600
committerDerek Foreman <derekf@osg.samsung.com>2017-01-18 13:04:47 -0600
commit553751cb40b79f23b9c8e4d057c2f15feb2c52bf (patch)
treeef03ec34ad0cf8cdc5159417d467f73c15a2b4d5 /src/Makefile.am
parent76066f2d9fa38aa7633e7c289bdc998e3325c6f7 (diff)
build: Add rules to auto-generate wayland headers from protocol xml
We've been checking in protocol headers and implementations that wayland-scanner generates. We should just generate them from the upstream xml files.
Diffstat (limited to 'src/Makefile.am')
-rw-r--r--src/Makefile.am36
1 files changed, 36 insertions, 0 deletions
diff --git a/src/Makefile.am b/src/Makefile.am
index b29bfda..4c92039 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -192,3 +192,39 @@ install-exec-hook:
192 mv $$FNAMEEXT $$FNAME; \ 192 mv $$FNAMEEXT $$FNAME; \
193 done 193 done
194 $(EFL_INSTALL_EXEC_HOOK) 194 $(EFL_INSTALL_EXEC_HOOK)
195
196#At the bottom because .SECONDEXPANSION is applied to all following rules.
197if HAVE_WAYLAND_SCANNER
198#Stolen from weston's Makefile.am and modified for Enlightenment
199.SECONDEXPANSION:
200
201define protostability
202$(if $(findstring unstable,$1),unstable,stable)
203endef
204
205define protoname
206$(shell echo $1 | sed 's/\([a-z\-]\+\)-[a-z]\+-v[0-9]\+/\1/')
207endef
208
209#rules for generating protocol from wayland_protocols
210%-protocol.c : $(WAYLAND_PROTOCOLS_DATADIR)/$$(call protostability,$$*)/$$(call protoname,$$*)/$$*.xml
211 $(AM_V_GEN)$(MKDIR_P) $(dir $@) && $(wayland_scanner) code < $< > $@
212
213%-server-protocol.h : $(WAYLAND_PROTOCOLS_DATADIR)/$$(call protostability,$$*)/$$(call protoname,$$*)/$$*.xml
214 $(AM_V_GEN)$(MKDIR_P) $(dir $@) && $(wayland_scanner) server-header < $< > $@
215
216%-client-protocol.h : $(WAYLAND_PROTOCOLS_DATADIR)/$$(call protostability,$$*)/$$(call protoname,$$*)/$$*.xml
217 $(AM_V_GEN)$(MKDIR_P) $(dir $@) && $(wayland_scanner) client-header < $< > $@
218
219#rules for generating local protocols which must be in src/wayland_protocol
220%-protocol.c : $(top_srcdir)/src/wayland_protocol/$(notdir $$*).xml
221 $(AM_V_GEN)$(MKDIR_P) $(dir $@) && $(wayland_scanner) code < $< > $@
222
223%-server-protocol.h : $(top_srcdir)/src/wayland_protocol/$(notdir $$*).xml
224 $(AM_V_GEN)$(MKDIR_P) $(dir $@) && $(wayland_scanner) server-header < $< > $@
225
226%-client-protocol.h : $(top_srcdir)/src/wayland_protocol/$(notdir $$*).xml
227 $(AM_V_GEN)$(MKDIR_P) $(dir $@) && $(wayland_scanner) client-header < $< > $@
228
229#End of weston stuff
230endif