mirror of
https://github.com/yquake2/yquake2remaster.git
synced 2024-11-10 07:12:07 +00:00
Make user overwriteable OSTYPE and ARCH somewhat more saner
In the Makefile we can use whatever variables we want. It's only necessary that we don't leak them into the compiler context.
This commit is contained in:
parent
aa897e3965
commit
e0b1f98f40
1 changed files with 8 additions and 7 deletions
15
Makefile
15
Makefile
|
@ -100,28 +100,28 @@ endif
|
|||
|
||||
# Detect the OS
|
||||
ifdef SystemRoot
|
||||
YQ2OSTYPE ?= Windows
|
||||
OSTYPE ?= Windows
|
||||
else
|
||||
YQ2OSTYPE ?= $(shell uname -s)
|
||||
OSTYPE ?= $(shell uname -s)
|
||||
endif
|
||||
|
||||
# Special case for MinGW
|
||||
ifneq (,$(findstring MINGW,$(OSTYPE)))
|
||||
YQ2OSTYPE ?= Windows
|
||||
OSTYPE ?= Windows
|
||||
endif
|
||||
|
||||
# Detect the architecture
|
||||
ifeq ($(OSTYPE), Windows)
|
||||
ifdef PROCESSOR_ARCHITEW6432
|
||||
# 64 bit Windows
|
||||
YQ2ARCH ?= $(PROCESSOR_ARCHITEW6432)
|
||||
ARCH ?= $(PROCESSOR_ARCHITEW6432)
|
||||
else
|
||||
# 32 bit Windows
|
||||
YQ2ARCH ?= $(PROCESSOR_ARCHITECTURE)
|
||||
ARCH ?= $(PROCESSOR_ARCHITECTURE)
|
||||
endif
|
||||
else
|
||||
# Normalize some abiguous ARCH strings
|
||||
YQ2ARCH ?= $(shell uname -m | sed -e 's/i.86/i386/' -e 's/amd64/x86_64/' -e 's/^arm.*/arm/')
|
||||
ARCH ?= $(shell uname -m | sed -e 's/i.86/i386/' -e 's/amd64/x86_64/' -e 's/^arm.*/arm/')
|
||||
endif
|
||||
|
||||
# Disable CDA for SDL2
|
||||
|
@ -136,6 +136,7 @@ CDA_DISABLED:=yes
|
|||
endif
|
||||
endif
|
||||
|
||||
|
||||
# ----------
|
||||
|
||||
# Base CFLAGS.
|
||||
|
@ -167,7 +168,7 @@ endif
|
|||
# ----------
|
||||
|
||||
# Defines the operating system and architecture
|
||||
CFLAGS += -DYQ2OSTYPE=\"$(YQ2OSTYPE)\" -DYQ2ARCH=\"$(YQ2ARCH)\"
|
||||
CFLAGS += -DYQ2OSTYPE=\"$(OSTYPE)\" -DYQ2ARCH=\"$(ARCH)\"
|
||||
|
||||
# ----------
|
||||
|
||||
|
|
Loading…
Reference in a new issue