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