Check all requirements before exiting on error

Signed-off-by: Timothy Gu <timothygu99@gmail.com>
pull/411/head
Timothy Gu 10 years ago
parent 6a88cb2246
commit d68838f924

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

Loading…
Cancel
Save