From b7ef1855fc73e0cf5ddaba9606b641edc8004435 Mon Sep 17 00:00:00 2001 From: Timothy Gu Date: Sat, 26 Apr 2014 11:08:12 -0700 Subject: [PATCH 1/3] Move up LOOKUP_PKG_RULE Signed-off-by: Timothy Gu --- Makefile | 50 +++++++++++++++++++++++++------------------------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/Makefile b/Makefile index 01bb9ad0..3c8a034f 100644 --- a/Makefile +++ b/Makefile @@ -153,6 +153,31 @@ else } >'$(PWD)/settings.mk') endif +# cache some target string manipulation functions +# `memoize` and `uc` from gmsl +_CHOP_TARGET = $(call merge,.,$(call chop,$(call split,.,$(1)))) +CHOP_TARGET = $(call memoize,_CHOP_TARGET,$(1)) +_UC_LIB_TYPE = $(call uc,$(word 2,$(subst ., ,$(1)))) +UC_LIB_TYPE = $(call memoize,_UC_LIB_TYPE,$(1)) + +# finds a package build rule or deps by truncating the target elements +# $(call LOOKUP_PKG_RULE, package, rule type ie. BUILD|DEPS|FILE, target,[lib type, original target to cache]) +# returns variable name for use with $(value) +# +# caches result with gmsl associative arrays (`get` and `set` functions) +# since `memoize` only works with single argument +LOOKUP_PKG_RULE = $(strip \ + $(or $(call get,LOOKUP_PKG_RULE_,$(1)_$(2)_$(or $(5),$(3))),\ + $(if $(findstring undefined, $(flavor $(1)_$(2)_$(3))),\ + $(if $(3),\ + $(call LOOKUP_PKG_RULE,$(1),$(2),$(call CHOP_TARGET,$(3)),$(or $(4),$(call UC_LIB_TYPE,$(3))),$(or $(5),$(3))),\ + $(if $(4),\ + $(call LOOKUP_PKG_RULE,$(1),$(2),$(4),,$(5)),\ + $(call set,LOOKUP_PKG_RULE_,$(1)_$(2)_$(5),$(1)_$(2))\ + $(1)_$(2))),\ + $(call set,LOOKUP_PKG_RULE_,$(1)_$(2)_$(or $(5),$(3)),$(1)_$(2)_$(3))\ + $(1)_$(2)_$(3)))) + .PHONY: all all: all-filtered @@ -237,31 +262,6 @@ $(1): | $(if $(value $(1)_DEPS), \ endef $(foreach TARGET,$(MXE_TARGETS),$(eval $(call TARGET_RULE,$(TARGET)))) -# cache some target string manipulation functions -# `memoize` and `uc` from gmsl -_CHOP_TARGET = $(call merge,.,$(call chop,$(call split,.,$(1)))) -CHOP_TARGET = $(call memoize,_CHOP_TARGET,$(1)) -_UC_LIB_TYPE = $(call uc,$(word 2,$(subst ., ,$(1)))) -UC_LIB_TYPE = $(call memoize,_UC_LIB_TYPE,$(1)) - -# finds a package build rule or deps by truncating the target elements -# $(call LOOKUP_PKG_RULE, package, rule type ie. BUILD|DEPS|FILE, target,[lib type, original target to cache]) -# returns variable name for use with $(value) -# -# caches result with gmsl associative arrays (`get` and `set` functions) -# since `memoize` only works with single argument -LOOKUP_PKG_RULE = $(strip \ - $(or $(call get,LOOKUP_PKG_RULE_,$(1)_$(2)_$(or $(5),$(3))),\ - $(if $(findstring undefined, $(flavor $(1)_$(2)_$(3))),\ - $(if $(3),\ - $(call LOOKUP_PKG_RULE,$(1),$(2),$(call CHOP_TARGET,$(3)),$(or $(4),$(call UC_LIB_TYPE,$(3))),$(or $(5),$(3))),\ - $(if $(4),\ - $(call LOOKUP_PKG_RULE,$(1),$(2),$(4),,$(5)),\ - $(call set,LOOKUP_PKG_RULE_,$(1)_$(2)_$(5),$(1)_$(2))\ - $(1)_$(2))),\ - $(call set,LOOKUP_PKG_RULE_,$(1)_$(2)_$(or $(5),$(3)),$(1)_$(2)_$(3))\ - $(1)_$(2)_$(3)))) - define PKG_RULE .PHONY: download-$(1) download-$(1):: $(addprefix download-,$(value $(call LOOKUP_PKG_RULE,$(1),DEPS,$(3)))) From 681921c8152bb75fc2e170c04170ad2dc361b99c Mon Sep 17 00:00:00 2001 From: Timothy Gu Date: Sat, 26 Apr 2014 11:09:08 -0700 Subject: [PATCH 2/3] Increase $(BUILD_PKG) accuracy by checking build rules This eliminates false-positive with packages with explicit empty build rules like binutils. gcc is another false-positive, but it is another matter and is harder to fix. Also use set_create function from GMSL to make the list sorted and uniq'd. Signed-off-by: Timothy Gu --- Makefile | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 3c8a034f..5943565b 100644 --- a/Makefile +++ b/Makefile @@ -48,7 +48,6 @@ PKG_DIR := $(PWD)/pkg TMP_DIR = $(PWD)/tmp-$(1) PKGS := $(shell $(SED) -n 's/^.* class="package">\([^<]*\)<.*$$/\1/p' '$(TOP_DIR)/index.html') BUILD := $(shell '$(EXT_DIR)/config.guess') -BUILD_PKGS := $(shell grep -l 'BUILD_$$(BUILD)' '$(TOP_DIR)/src/'*.mk | $(SED) -n 's,.*src/\(.*\)\.mk,\1,p') PATH := $(PREFIX)/$(BUILD)/bin:$(PREFIX)/bin:$(PATH) # define some whitespace variables @@ -218,6 +217,12 @@ $(PREFIX)/installed/check-requirements: $(MAKEFILE) include $(patsubst %,$(TOP_DIR)/src/%.mk,$(PKGS)) +BUILD_PKGS := $(call set_create, \ + $(foreach PKG, \ + $(shell grep -l 'BUILD_$$(BUILD)' '$(TOP_DIR)/src/'*.mk | \ + $(SED) -n 's,.*src/\(.*\)\.mk,\1,p'), \ + $(if $(value $(call LOOKUP_PKG_RULE,$(PKG),BUILD,$(BUILD))), $(PKG)))) + .PHONY: download download: $(addprefix download-,$(PKGS)) From 2b02ee7a9087e205d36c82a0e5f6bfb9985c25d9 Mon Sep 17 00:00:00 2001 From: Timothy Gu Date: Sat, 26 Apr 2014 11:09:09 -0700 Subject: [PATCH 3/3] Add build matrix generation target Based on a patch by Tobias Gruetzmacher (@TobiX). Fixes #346. Signed-off-by: Timothy Gu --- .gitignore | 1 + Makefile | 54 ++++++++++++++++++++++++++++++++++++++++- assets/build-matrix.css | 15 ++++++++++++ index.html | 7 ++++++ 4 files changed, 76 insertions(+), 1 deletion(-) create mode 100644 assets/build-matrix.css diff --git a/.gitignore b/.gitignore index 6bc75487..4309bcfa 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ /settings.mk +/build-matrix.html /usr/ /gits/ /log*/ diff --git a/Makefile b/Makefile index 5943565b..b60fd0c7 100644 --- a/Makefile +++ b/Makefile @@ -430,7 +430,7 @@ show-upstream-deps-%: .PHONY: clean clean: - rm -rf $(call TMP_DIR,*) $(PREFIX)/* + rm -rf $(call TMP_DIR,*) $(PREFIX)/* build-matrix.html .PHONY: clean-pkg clean-pkg: @@ -491,3 +491,55 @@ cleanup-style: rm -f $(TOP_DIR)/tmp-cleanup-style; \ ) +build-matrix.html: $(foreach PKG,$(PKGS), $(TOP_DIR)/src/$(PKG).mk) + @echo '' > $@ + @echo '' >> $@ + @echo '' >> $@ + @echo '' >> $@ + @echo 'MXE Build Matrix' >> $@ + @echo '' >> $@ + @echo '' >> $@ + @echo '' >> $@ + @echo '' >> $@ + @echo '

MXE Build Matrix

' >> $@ + @echo '

' >> $@ + @echo 'This is a table of all supported package/target' >> $@ + @echo 'matrix. Being supported means that this specific' >> $@ + @echo 'combination is working to the best of our knowledge,' >> $@ + @echo 'but does not mean that it is tested daily.' >> $@ + @echo '

' >> $@ + @echo '

' >> $@ + @echo 'If you found that some package is not working properly,'>> $@ + @echo 'please file a ticket on GitHub. If you figured out a' >> $@ + @echo 'way to make the package work for unsupported targets,' >> $@ + @echo 'feel free to submit a pull request.' >> $@ + @echo '

' >> $@ + @echo '' >> $@ + @echo '' >> $@ + @echo '' >> $@ + @echo '' >> $@ + @$(foreach TRIPLET,$(MXE_TRIPLETS), \ + echo '' >> $@;) + @echo '' >> $@ + @echo '' >> $@ + @echo '' >> $@ + @$(foreach TRIPLET,$(MXE_TRIPLETS), \ + $(foreach LIB, $(MXE_LIB_TYPES), \ + echo '' >> $@;)) + @echo '' >> $@ + @echo '' >> $@ + @echo '' >> $@ + @$(foreach PKG,$(PKGS), \ + echo '' >> $@; \ + echo '' >> $@; \ + $(foreach TARGET,$(MXE_TARGET_LIST), \ + $(if $(value $(call LOOKUP_PKG_RULE,$(PKG),BUILD,$(TARGET))), \ + echo '' >> $@;, \ + echo '' >> $@;)) \ + $(if $(call set_is_member,$(PKG),$(BUILD_PKGS)), \ + echo '' >> $@;, \ + echo '' >> $@;)) + @echo '' >> $@ + @echo '
Package$(TRIPLET)Native
$(LIB)
$(PKG)YNYN
' >> $@ + @echo '' >> $@ + diff --git a/assets/build-matrix.css b/assets/build-matrix.css new file mode 100644 index 00000000..4d03da17 --- /dev/null +++ b/assets/build-matrix.css @@ -0,0 +1,15 @@ +/* This file is part of MXE. + * See index.html for further information. */ + +table.fullscreen { + width: 100%; +} + +td.supported { + background-color: #98fb98; + text-align: center; +} +td.unsupported { + background-color: #f99; + text-align: center; +} diff --git a/index.html b/index.html index aa8ff072..2ee18960 100644 --- a/index.html +++ b/index.html @@ -999,6 +999,13 @@ local-pkg-list: $(LOCAL_PKG_LIST) suitable for usage in shell scripts +
make build-matrix.html
+ +
+ generate a report of what packages are + supported on what targets to build-matrix.html +
+
make update