commit 5a4a636be72d4cc9ee42febee84144fce2026905
parent 3ff79437aa4fccf584adbd245b0f51771295b20e
Author: shrub <maybeshrub@gmail.com>
Date: Fri, 30 Jan 2026 20:18:57 +0000
makefile changes
fix wayland-scanner invocations, and use bmake syntax
Diffstat:
1 file changed, 14 insertions(+), 9 deletions(-)
diff --git a/protocol/local.mk b/protocol/local.mk
@@ -14,19 +14,24 @@ PROTOCOL_EXTENSIONS = \
$(dir)_PACKAGES := wayland-server
-define protocol_rules
+.for ext in ${PROTOCOL_EXTENSIONS}
+proto_base := ${ext:T:R}
-$(dir)/$$(basename $$(notdir $(1)))-protocol.c: $(1)
- $$(Q_GEN)$$(WAYLAND_SCANNER) code <$$< >$$@
-$(dir)/$$(basename $$(notdir $(1)))-server-protocol.h: $(1)
- $$(Q_GEN)$$(WAYLAND_SCANNER) server-header <$$< >$$@
+${dir}/${proto_base}-protocol.c: ${ext} \
+ ${dir}/${proto_base}-server-protocol.h \
+ ${dir}/${proto_base}-client-protocol.h
+ ${Q_GEN}${WAYLAND_SCANNER} code ${ext} ${.TARGET}
-CLEAN_FILES += $(foreach type,protocol.c server-protocol.h, \
- $(dir)/$$(basename $$(notdir $(1)))-$(type))
+${dir}/${proto_base}-server-protocol.h: ${ext}
+ ${Q_GEN}${WAYLAND_SCANNER} server-header ${ext} ${.TARGET}
-endef
+${dir}/${proto_base}-client-protocol.h: ${ext}
+ ${Q_GEN}${WAYLAND_SCANNER} client-header ${ext} ${.TARGET}
-$(eval $(foreach extension,$(PROTOCOL_EXTENSIONS),$(call protocol_rules,$(extension))))
+CLEAN_FILES += ${dir}/${proto_base}-protocol.c \
+ ${dir}/${proto_base}-server-protocol.h \
+ ${dir}/${proto_base}-client-protocol.h
+.endfor
install-$(dir): | $(DESTDIR)$(DATADIR)/swc
install -m 644 protocol/swc.xml $(DESTDIR)$(DATADIR)/swc