summaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorTimothy Gu <timothygu99@gmail.com>2014-04-26 18:09:08 (GMT)
committerTimothy Gu <timothygu99@gmail.com>2014-04-30 01:54:05 (GMT)
commit681921c8152bb75fc2e170c04170ad2dc361b99c (patch)
treec81592b3c2f71876aa5342dc0f9acdabb64333eb /Makefile
parentb7ef1855fc73e0cf5ddaba9606b641edc8004435 (diff)
downloadmxe-681921c8152bb75fc2e170c04170ad2dc361b99c.zip
mxe-681921c8152bb75fc2e170c04170ad2dc361b99c.tar.gz
mxe-681921c8152bb75fc2e170c04170ad2dc361b99c.tar.bz2
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 <timothygu99@gmail.com>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile7
1 files changed, 6 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index 3c8a034..5943565 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))