diff world/Makefile @ 2388:e845f54be995

Autodetect curl or wget.
author Matti Hamalainen <ccr@tnsp.org>
date Sat, 06 Nov 2021 18:11:40 +0200
parents 53c34aaf4515
children 42ee2079a69d
line wrap: on
line diff
--- a/world/Makefile	Sat Nov 06 18:01:23 2021 +0200
+++ b/world/Makefile	Sat Nov 06 18:11:40 2021 +0200
@@ -2,6 +2,25 @@
 include config.mak
 
 ###
+### Detect curl or wget
+###
+HAVE_CURL ?= $(shell curl --version > /dev/null && echo "yes")
+HAVE_WGET ?= $(shell wget --version > /dev/null && echo "yes")
+
+ifeq ($(HAVE_CURL),yes)
+HTTPGET ?= curl -o
+else
+ifeq ($(HAVE_WGET),yes)
+HTTPGET ?= wget -O
+else
+ifeq ($(HTTPGET),)
+$(error Required utility 'curl' or 'wget' not found in PATH. You can configure HTTPGET variable in config.mak.)
+endif
+endif
+endif
+
+
+###
 ### Main targets
 ###
 TARGETS=$(addsuffix .html,$(WORLD_MAPS)) \