diff --git a/Makefile b/Makefile
index 9c26d65f..08b4041f 100644
--- a/Makefile
+++ b/Makefile
@@ -873,7 +873,8 @@ docs/build-matrix.html: $(foreach 1,$(PKGS),$(PKG_MAKEFILES))
$(eval $(PKG)_BUILD_ONLY := $(false)) \
✓ | , \
✗ | )\n) \
- $(if $(call set_is_member,$(PKG),$($(BUILD)_PKGS)), \
+ $(if $(and $(call set_is_member,$(PKG),$($(BUILD)_PKGS)), \
+ $(value $(call LOOKUP_PKG_RULE,$(PKG),BUILD,$(BUILD)))), \
$(eval $(PKG)_VIRTUAL := $(false)) \
✓ | , \
✗ | )\n \