Skip to content

Commit

Permalink
Makefile.include: warning not error if not curl, wget, unzip, 7z
Browse files Browse the repository at this point in the history
The following tools are not needed for every build, its only needed
for a couple of packages like c25519, since most are fetched with git.
  • Loading branch information
fjmolinas committed Aug 28, 2021
1 parent eace949 commit 0392dff
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions Makefile.include
Expand Up @@ -328,34 +328,34 @@ APPLICATION := $(strip $(APPLICATION))
ifeq (,$(and $(DOWNLOAD_TO_STDOUT),$(DOWNLOAD_TO_FILE)))
ifeq (,$(WGET))
ifeq (0,$(shell which wget 2>&1 > /dev/null ; echo $$?))
WGET := $(shell which wget)
WGET = $(call memoized,WGET,$(shell which wget))
endif
endif
ifeq (,$(CURL))
ifeq (0,$(shell which curl 2>&1 > /dev/null ; echo $$?))
CURL := $(shell which curl)
CURL = $(call memoized,CURL,$(shell which curl))
endif
endif
ifeq (,$(WGET)$(CURL))
$(error Neither wget nor curl is installed!)
$(warning Neither wget nor curl is installed!)
endif

ifeq (,$(DOWNLOAD_TO_STDOUT))
DOWNLOAD_TO_STDOUT := $(if $(CURL),$(CURL) -s,$(WGET) -q -O-)
DOWNLOAD_TO_STDOUT ?= $(if $(CURL),$(CURL) -s,$(WGET) -q -O-)
endif
ifeq (,$(DOWNLOAD_TO_FILE))
DOWNLOAD_TO_FILE := $(if $(WGET),$(WGET) -nv -c -O,$(CURL) -s -o)
DOWNLOAD_TO_FILE ?= $(if $(WGET),$(WGET) -nv -c -O,$(CURL) -s -o)
endif
endif

ifeq (,$(UNZIP_HERE))
ifeq (0,$(shell which unzip 2>&1 > /dev/null ; echo $$?))
UNZIP_HERE := $(shell which unzip) -q
UNZIP_HERE = $(call memoized,UNZIP_HERE,$(shell which unzip) -q)
else
ifeq (0,$(shell which 7z 2>&1 > /dev/null ; echo $$?))
UNZIP_HERE := $(shell which 7z) x -bd
UNZIP_HERE = $(call memoized,UNZIP_HERE,$(shell which 7z) x -bd)
else
$(error Neither unzip nor 7z is installed.)
$(warning Neither unzip nor 7z is installed.)
endif
endif
endif
Expand Down

0 comments on commit 0392dff

Please sign in to comment.