Makefile: Shorten host platform detection code and improve it on Windows to try using $(OS) before invoking uname, and to catch "MSYS" in addition to "MINGW" in uname's output.

git-svn-id: https://svn.eduke32.com/eduke32@5743 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
hendricks266 2016-05-23 04:46:46 +00:00
parent 3f9fb0dd73
commit ad3ff7678f

View file

@ -103,35 +103,33 @@ SYSBITS=32
# CC and giving us PLATFORM specifically.
#
ifndef HOSTPLATFORM
uname:=$(strip $(shell uname -s))
HOSTPLATFORM=UNKNOWN
ifeq ($(findstring Windows,$(OS)),Windows)
HOSTPLATFORM=WINDOWS
else
uname:=$(strip $(shell uname -s))
ifeq ($(findstring Linux,$(uname)),Linux)
HOSTPLATFORM=LINUX
endif
ifeq ($(findstring BSD,$(uname)),BSD)
else ifeq ($(findstring BSD,$(uname)),BSD)
HOSTPLATFORM=BSD
endif
ifeq ($(findstring MINGW,$(uname)),MINGW)
else ifeq ($(findstring MINGW,$(uname)),MINGW)
HOSTPLATFORM=WINDOWS
endif
ifeq ($(findstring Darwin,$(uname)),Darwin)
else ifeq ($(findstring MSYS,$(uname)),MSYS)
HOSTPLATFORM=WINDOWS
else ifeq ($(findstring Darwin,$(uname)),Darwin)
HOSTPLATFORM=DARWIN
endif
ifeq ($(findstring BeOS,$(uname)),BeOS)
else ifeq ($(findstring BeOS,$(uname)),BeOS)
HOSTPLATFORM=BEOS
endif
ifeq ($(findstring skyos,$(uname)),skyos)
else ifeq ($(findstring skyos,$(uname)),skyos)
HOSTPLATFORM=SKYOS
endif
ifeq ($(findstring QNX,$(uname)),QNX)
else ifeq ($(findstring QNX,$(uname)),QNX)
HOSTPLATFORM=QNX
endif
ifeq ($(findstring SunOS,$(uname)),SunOS)
else ifeq ($(findstring SunOS,$(uname)),SunOS)
HOSTPLATFORM=SUNOS
endif
ifeq ($(findstring syllable,$(uname)),syllable)
else ifeq ($(findstring syllable,$(uname)),syllable)
HOSTPLATFORM=SYLLABLE
endif
endif
endif
ifndef PLATFORM
PLATFORM=$(HOSTPLATFORM)