Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 1 addition & 22 deletions Makefile.include
Original file line number Diff line number Diff line change
Expand Up @@ -333,28 +333,7 @@ APPLICATION := $(strip $(APPLICATION))

# provide common external programs for `Makefile.include`s

ifeq (,$(and $(DOWNLOAD_TO_STDOUT),$(DOWNLOAD_TO_FILE)))
ifeq (,$(WGET))
ifeq (0,$(shell which wget > /dev/null 2>&1 ; echo $$?))
WGET = $(call memoized,WGET,$(shell which wget))
endif
endif
ifeq (,$(CURL))
ifeq (0,$(shell which curl > /dev/null 2>&1 ; echo $$?))
CURL = $(call memoized,CURL,$(shell which curl))
endif
endif
ifeq (,$(WGET)$(CURL))
$(warning Neither wget nor curl is installed!)
endif

ifeq (,$(DOWNLOAD_TO_STDOUT))
DOWNLOAD_TO_STDOUT ?= $(if $(CURL),$(CURL) -s,$(WGET) -q -O-)
endif
ifeq (,$(DOWNLOAD_TO_FILE))
DOWNLOAD_TO_FILE ?= $(DLCACHE)
endif
endif
DOWNLOAD_TO_FILE ?= $(DLCACHE)

ifeq (,$(UNZIP_HERE))
ifeq (0,$(shell which unzip > /dev/null 2>&1 ; echo $$?))
Expand Down
3 changes: 2 additions & 1 deletion makefiles/info.inc.mk
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,9 @@ info-build:
@echo 'DEBUGGER: $(DEBUGGER)'
@echo 'DEBUGGER_FLAGS: $(DEBUGGER_FLAGS)'
@echo
@echo 'DLCACHE: $(DLCACHE)'
@echo 'DLCACHE_DIR: $(DLCACHE_DIR)'
@echo 'DOWNLOAD_TO_FILE: $(DOWNLOAD_TO_FILE)'
@echo 'DOWNLOAD_TO_STDOUT: $(DOWNLOAD_TO_STDOUT)'
@echo 'UNZIP_HERE: $(UNZIP_HERE)'
@echo ''
@echo 'DEBUGSERVER: $(DEBUGSERVER)'
Expand Down
12 changes: 8 additions & 4 deletions makefiles/vars.inc.mk
Original file line number Diff line number Diff line change
Expand Up @@ -128,10 +128,14 @@ export DEVELHELP # Set to 1 to spend ROM, RAM and CPU time for help
# USE_PROGRAMMER_WRAPPER_SCRIPT # Use the programmer wrapper Python script. Default is 0 (wrapper not used).


export DLCACHE # directory used to cache http downloads
export DOWNLOAD_TO_FILE # Use `$(DOWNLOAD_TO_FILE) $(DESTINATION) $(URL)` to download `$(URL)` to `$(DESTINATION)`.
export DOWNLOAD_TO_STDOUT # Use `$(DOWNLOAD_TO_STDOUT) $(URL)` to download `$(URL)` output `$(URL)` to stdout, e.g. to be piped into `tar xz`.
export UNZIP_HERE # Use `cd $(SOME_FOLDER) && $(UNZIP_HERE) $(SOME_FILE)` to extract the contents of the zip file `$(SOME_FILE)` into `$(SOME_FOLDER)`.
export DLCACHE # Use `$(DLCACHE) $(DESTINATION) $(URL) [$(SHA512)]` to
# download `$(URL)` to `$(DESTINATION)` but keep a copy in cache
# with an `$(SHA512)` checksum. If no checksum is given, the
# URL will just be downloaded, not cached.
export DOWNLOAD_TO_FILE # Use `$(DOWNLOAD_TO_FILE) $(DESTINATION) $(URL) [$(SHA512)]` to
# download `$(URL)` to `$(DESTINATION)`. Alias for $(DLCACHE).
export UNZIP_HERE # Use `cd $(SOME_FOLDER) && $(UNZIP_HERE) $(SOME_FILE)` to extract
# the contents of the zip file `$(SOME_FILE)` into `$(SOME_FOLDER)`.

export LAZYSPONGE # Command saving stdin to a file only on content update.
export LAZYSPONGE_FLAGS # Parameters supplied to LAZYSPONGE.
Expand Down