commit 5a4a636
shrub
·
2026-01-30 20:18:57 +0000 UTC
parent 3ff7943
makefile changes fix wayland-scanner invocations, and use bmake syntax
1 files changed,
+14,
-9
+14,
-9
1@@ -14,19 +14,24 @@ PROTOCOL_EXTENSIONS = \
2
3 $(dir)_PACKAGES := wayland-server
4
5-define protocol_rules
6+.for ext in ${PROTOCOL_EXTENSIONS}
7+proto_base := ${ext:T:R}
8
9-$(dir)/$$(basename $$(notdir $(1)))-protocol.c: $(1)
10- $$(Q_GEN)$$(WAYLAND_SCANNER) code <$$< >$$@
11-$(dir)/$$(basename $$(notdir $(1)))-server-protocol.h: $(1)
12- $$(Q_GEN)$$(WAYLAND_SCANNER) server-header <$$< >$$@
13+${dir}/${proto_base}-protocol.c: ${ext} \
14+ ${dir}/${proto_base}-server-protocol.h \
15+ ${dir}/${proto_base}-client-protocol.h
16+ ${Q_GEN}${WAYLAND_SCANNER} code ${ext} ${.TARGET}
17
18-CLEAN_FILES += $(foreach type,protocol.c server-protocol.h, \
19- $(dir)/$$(basename $$(notdir $(1)))-$(type))
20+${dir}/${proto_base}-server-protocol.h: ${ext}
21+ ${Q_GEN}${WAYLAND_SCANNER} server-header ${ext} ${.TARGET}
22
23-endef
24+${dir}/${proto_base}-client-protocol.h: ${ext}
25+ ${Q_GEN}${WAYLAND_SCANNER} client-header ${ext} ${.TARGET}
26
27-$(eval $(foreach extension,$(PROTOCOL_EXTENSIONS),$(call protocol_rules,$(extension))))
28+CLEAN_FILES += ${dir}/${proto_base}-protocol.c \
29+ ${dir}/${proto_base}-server-protocol.h \
30+ ${dir}/${proto_base}-client-protocol.h
31+.endfor
32
33 install-$(dir): | $(DESTDIR)$(DATADIR)/swc
34 install -m 644 protocol/swc.xml $(DESTDIR)$(DATADIR)/swc