From 861535a86e8a0e11a1379a1bbb8b2d92e678718c Mon Sep 17 00:00:00 2001 From: Erik Westrup Date: Sat, 5 Feb 2022 14:48:38 +0100 Subject: [PATCH] Check properly for GNU install --- Makefile | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/Makefile b/Makefile index 40c5d6b..2429d74 100644 --- a/Makefile +++ b/Makefile @@ -16,18 +16,12 @@ ### Macros ### NOW := $(shell date +%Y-%m-%d_%H:%M:%S) -# Source: https://stackoverflow.com/a/14777895/265508 -ifeq ($(OS),Windows_NT) - CUR_OS := Windows -else - CUR_OS := $(shell uname) -endif - # GNU install and macOS install have incompatible command line arguments. -ifeq ($(CUR_OS),Darwin) - BAK_SUFFIX = -B .$(NOW).bak -else +GNU_INSTALL := $(shell install --version 2>/dev/null | grep -q GNU && echo true || echo false) +ifeq ($(GNU_INSTALL),true) BAK_SUFFIX = --suffix=.$(NOW).bak +else + BAK_SUFFIX = -B .$(NOW).bak endif # Create parent directories of a file, if not existing.