summaryrefslogtreecommitdiff
path: root/scripts/scripts.mk
diff options
context:
space:
mode:
authorAlexey Neyman <stilor@att.net>2017-02-14 06:45:45 (GMT)
committerGitHub <noreply@github.com>2017-02-14 06:45:45 (GMT)
commitfbc69323085e2370faeb8b46291cd66cbf9ef649 (patch)
tree10da28cd40b45913f6104c07badbf48971500066 /scripts/scripts.mk
parentc440a13a8231e267827349065a90f98fac3d4cc0 (diff)
parentf9bec4ed7c4540de73c82c94053f975c5c7c29e4 (diff)
Merge pull request #594 from stilor/wget-vs-curl
Select wget vs curl, BSD stat vs GNU stat
Diffstat (limited to 'scripts/scripts.mk')
-rwxr-xr-x[-rw-r--r--]scripts/scripts.mk24
1 files changed, 17 insertions, 7 deletions
diff --git a/scripts/scripts.mk b/scripts/scripts.mk
index 77368a7..42aacab 100644..100755
--- a/scripts/scripts.mk
+++ b/scripts/scripts.mk
@@ -26,9 +26,19 @@ updatetools: $(CONFIG_SUB_DEST) $(CONFIG_GUESS_DEST)
# ----------------------------------------------------------
# How to retrieve the tools
-wget_opt=-o /dev/null
-ifeq ($(strip $(V)),2)
- wget_opt=
+ifneq ($(strip $(V)),2)
+ wget_silent_opt = -o /dev/null
+ curl_silent_opt = --silent
+endif
+
+ifneq (wget,)
+download_cmd = wget --passive-ftp $(wget_silent_opt) -O $@
+else
+ifneq (curl,)
+download_cmd = curl --ftp-pasv $(curl_silent_opt) -o $@
+else
+download_cmd = $(error wget or curl needed for downloads)
+endif
endif
PHONY += scripts
@@ -37,13 +47,13 @@ scripts:
$(SILENT)mkdir -p $@
$(CONFIG_SUB_DEST): scripts FORCE
- @$(CT_ECHO) ' WGET $@'
- $(SILENT)wget $(wget_opt) -O $@ $(CONFIG_SUB_SRC)
+ @$(CT_ECHO) ' DOWNLOAD $@'
+ $(SILENT)$(download_cmd) $(CONFIG_SUB_SRC)
$(SILENT)chmod u+rwx,go+rx-w $@
$(CONFIG_GUESS_DEST): scripts FORCE
- @$(CT_ECHO) ' WGET $@'
- $(SILENT)wget $(wget_opt) -O $@ $(CONFIG_GUESS_SRC)
+ @$(CT_ECHO) ' DOWNLOAD $@'
+ $(SILENT)$(download_cmd) $(CONFIG_GUESS_SRC)
$(SILENT)chmod u+rwx,go+rx-w $@
# ----------------------------------------------------------