[vlc-commits] contrib: only use implicit variables for known implicit variables

Steve Lhomme git at videolan.org
Thu Mar 19 17:04:42 CET 2020


vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Wed Mar 18 09:23:34 2020 +0100| [78e0c7e3ef6308c1d10e32b10bb958527ce16279] | committer: Steve Lhomme

contrib: only use implicit variables for known implicit variables

At least widl/windres are Windows tools that are not defined in GNU Make on
msys or Linux.

Neither ranlib or strip have implicit values either when I tested with make -p.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=78e0c7e3ef6308c1d10e32b10bb958527ce16279
---

 contrib/src/main.mak | 32 ++++++++------------------------
 1 file changed, 8 insertions(+), 24 deletions(-)

diff --git a/contrib/src/main.mak b/contrib/src/main.mak
index 849b69ffba..85e4dbb878 100644
--- a/contrib/src/main.mak
+++ b/contrib/src/main.mak
@@ -78,18 +78,10 @@ endif
 ifneq ($(findstring $(origin AR),undefined default),)
 AR := ar
 endif
-ifneq ($(findstring $(origin RANLIB),undefined default),)
-RANLIB := ranlib
-endif
-ifneq ($(findstring $(origin STRIP),undefined default),)
-STRIP := strip
-endif
-ifneq ($(findstring $(origin WIDL),undefined default),)
-WIDL := widl
-endif
-ifneq ($(findstring $(origin WINDRES),undefined default),)
-WINDRES := windres
-endif
+RANLIB ?= ranlib
+STRIP ?= strip
+WIDL ?= widl
+WINDRES ?= windres
 else
 ifneq ($(findstring $(origin CC),undefined default),)
 CC := $(HOST)-gcc
@@ -103,18 +95,10 @@ endif
 ifneq ($(findstring $(origin AR),undefined default),)
 AR := $(HOST)-ar
 endif
-ifneq ($(findstring $(origin RANLIB),undefined default),)
-RANLIB := $(HOST)-ranlib
-endif
-ifneq ($(findstring $(origin STRIP),undefined default),)
-STRIP := $(HOST)-strip
-endif
-ifneq ($(findstring $(origin WIDL),undefined default),)
-WIDL := $(HOST)-widl
-endif
-ifneq ($(findstring $(origin WINDRES),undefined default),)
-WINDRES := $(HOST)-windres
-endif
+RANLIB ?= $(HOST)-ranlib
+STRIP ?= $(HOST)-strip
+WIDL ?= $(HOST)-widl
+WINDRES ?= $(HOST)-windres
 endif
 
 ifdef HAVE_ANDROID



More information about the vlc-commits mailing list