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