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>
This commit is contained in:
Timothy Gu 2014-04-26 11:09:08 -07:00
parent b7ef1855fc
commit 681921c815
1 changed files with 6 additions and 1 deletions

View File

@ -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))