summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGeorge Hahn <george.hahn.vhs@gmail.com>2022-05-10 00:37:02 -0600
committerGeorge Hahn <george.hahn.vhs@gmail.com>2022-05-10 00:37:02 -0600
commit0269681ac323bf09f130132454258d279c92f89f (patch)
tree8fc5740a3a64e99199b4690a924804e7ecc9d2bc
parent9d8ef5c2e8a0aa0b9c27034a1dde0051a385220a (diff)
downloadSensor-Watch-0269681ac323bf09f130132454258d279c92f89f.tar.gz
Sensor-Watch-0269681ac323bf09f130132454258d279c92f89f.tar.bz2
Sensor-Watch-0269681ac323bf09f130132454258d279c92f89f.zip
Perform OS detection in makefile
-rw-r--r--make.mk16
1 files changed, 15 insertions, 1 deletions
diff --git a/make.mk b/make.mk
index ac5be775..d7fecd20 100644
--- a/make.mk
+++ b/make.mk
@@ -9,7 +9,21 @@ endif
##############################################################################
.PHONY: all directory clean size
-ifeq ($(OS), Windows_NT)
+# OS detection, adapted from https://gist.github.com/sighingnow/deee806603ec9274fd47
+DETECTED_OS :=
+ifeq ($(OS),Windows_NT)
+ DETECTED_OS = WINDOWS
+else
+ UNAME_S := $(shell uname -s)
+ ifeq ($(UNAME_S),Linux)
+ DETECTED_OS = LINUX
+ endif
+ ifeq ($(UNAME_S),Darwin)
+ DETECTED_OS = OSX
+ endif
+endif
+$(if ${VERBOSE},$(info OS detected: $(DETECTED_OS)))
+
MKDIR = gmkdir
else
MKDIR = mkdir