Perform OS detection in makefile
This commit is contained in:
parent
9d8ef5c2e8
commit
0269681ac3
14
make.mk
14
make.mk
@ -9,7 +9,21 @@ endif
|
|||||||
##############################################################################
|
##############################################################################
|
||||||
.PHONY: all directory clean size
|
.PHONY: all directory clean size
|
||||||
|
|
||||||
|
# OS detection, adapted from https://gist.github.com/sighingnow/deee806603ec9274fd47
|
||||||
|
DETECTED_OS :=
|
||||||
ifeq ($(OS),Windows_NT)
|
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
|
MKDIR = gmkdir
|
||||||
else
|
else
|
||||||
MKDIR = mkdir
|
MKDIR = mkdir
|
||||||
|
Loading…
x
Reference in New Issue
Block a user