From d68838f92434377957968b43b5fe85916ae4e987 Mon Sep 17 00:00:00 2001 From: Timothy Gu Date: Mon, 5 May 2014 20:28:16 -0700 Subject: [PATCH] Check all requirements before exiting on error Signed-off-by: Timothy Gu --- Makefile | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/Makefile b/Makefile index 5d6c2752..dadbf71e 100644 --- a/Makefile +++ b/Makefile @@ -183,25 +183,15 @@ all: all-filtered .PHONY: check-requirements define CHECK_REQUIREMENT @if ! $(1) --help &>/dev/null; then \ - echo; \ echo 'Missing requirement: $(1)'; \ - echo; \ - echo 'Please have a look at "index.html" to ensure'; \ - echo 'that your system meets all requirements.'; \ - echo; \ - exit 1; \ + touch check-requirements-failed; \ fi endef define CHECK_REQUIREMENT_VERSION @if ! $(1) --version | head -1 | grep ' \($(2)\)$$' >/dev/null; then \ - echo; \ echo 'Wrong version of requirement: $(1)'; \ - echo; \ - echo 'Please have a look at "index.html" to ensure'; \ - echo 'that your system meets all requirements.'; \ - echo; \ - exit 1; \ + touch check-requirements-failed; \ fi endef @@ -213,6 +203,14 @@ $(PREFIX)/installed/check-requirements: $(MAKEFILE) $(foreach REQUIREMENT,$(REQUIREMENTS),$(call CHECK_REQUIREMENT,$(REQUIREMENT))) $(call CHECK_REQUIREMENT_VERSION,autoconf,2\.6[4-9]\|2\.[7-9][0-9]) $(call CHECK_REQUIREMENT_VERSION,automake,1\.11\.[3-9]\|1\.[1-9][2-9]\(\.[0-9]\+\)\?) + @if [ -e check-requirements-failed ]; then \ + echo; \ + echo 'Please have a look at "index.html" to ensure'; \ + echo 'that your system meets all requirements.'; \ + echo; \ + rm check-requirements-failed; \ + exit 1; \ + fi @touch '$@' include $(patsubst %,$(TOP_DIR)/src/%.mk,$(PKGS))