You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
55 lines
985 B
55 lines
985 B
19 years ago
|
#
|
||
|
# Copyright (C) 2006 OpenWrt.org
|
||
|
#
|
||
|
# This is free software, licensed under the GNU General Public License v2.
|
||
|
# See /LICENSE for more information.
|
||
|
#
|
||
|
|
||
|
$(TMP_DIR):
|
||
|
mkdir -p $@
|
||
|
|
||
|
prereq:
|
||
19 years ago
|
if [ -f $(TMP_DIR)/.prereq-error ]; then \
|
||
19 years ago
|
echo; \
|
||
19 years ago
|
cat $(TMP_DIR)/.prereq-error; \
|
||
|
echo; \
|
||
|
rm -rf $(TMP_DIR); \
|
||
|
false; \
|
||
|
fi
|
||
19 years ago
|
rm -rf $(TMP_DIR)
|
||
|
mkdir -p $(TMP_DIR)
|
||
|
|
||
|
.SILENT: $(TMP_DIR) prereq
|
||
19 years ago
|
|
||
|
define Require
|
||
18 years ago
|
export PREREQ_CHECK=1
|
||
19 years ago
|
ifeq ($$(CHECK_$(1)),)
|
||
|
prereq: prereq-$(1)
|
||
|
|
||
|
prereq-$(1): $(TMP_DIR) FORCE
|
||
19 years ago
|
echo -n "Checking '$(1)'... "
|
||
19 years ago
|
if $(NO_TRACE_MAKE) -f $(firstword $(MAKEFILE_LIST)) check-$(1) >/dev/null 2>/dev/null; then \
|
||
19 years ago
|
echo 'ok.'; \
|
||
|
else \
|
||
|
echo 'failed.'; \
|
||
|
echo -e "$(strip $(2))" >> $(TMP_DIR)/.prereq-error; \
|
||
|
fi
|
||
|
|
||
|
check-$(1): FORCE
|
||
|
$(call Require/$(1))
|
||
|
CHECK_$(1):=1
|
||
19 years ago
|
|
||
|
.SILENT: prereq-$(1) check-$(1)
|
||
19 years ago
|
endif
|
||
|
endef
|
||
|
|
||
|
|
||
|
define RequireCommand
|
||
|
define Require/$(1)
|
||
|
which $(1)
|
||
|
endef
|
||
|
|
||
|
$$(eval $$(call Require,$(1),$(2)))
|
||
|
endef
|
||
|
|