mirror of
https://git.do.srb2.org/KartKrew/Kart-Public.git
synced 2024-12-27 12:50:44 +00:00
Makefile: automatically detect system to compile for, if no system was specified
This should work for mingw and linux so far. (cherry picked from commit f92026f98b168f4556d50d3dde403ab6bfd97ff3)
This commit is contained in:
parent
00ff94caa2
commit
1dca1a3f47
1 changed files with 51 additions and 0 deletions
51
src/Makefile
51
src/Makefile
|
@ -81,6 +81,57 @@
|
|||
#
|
||||
#############################################################################
|
||||
|
||||
ALL_SYSTEMS=\
|
||||
PANDORA\
|
||||
LINUX64\
|
||||
MINGW64\
|
||||
HAIKU\
|
||||
DUMMY\
|
||||
DJGPPDOS\
|
||||
MINGW\
|
||||
UNIX\
|
||||
LINUX\
|
||||
SOLARIS\
|
||||
FREEBSD\
|
||||
MACOSX\
|
||||
SDL\
|
||||
|
||||
# check for user specified system
|
||||
ifeq (,$(filter $(ALL_SYSTEMS),$(.VARIABLES)))
|
||||
ifeq ($(OS),Windows_NT) # all windows are Windows_NT...
|
||||
|
||||
$(info Detected a Windows system, compiling for 32-bit MinGW SDL2...)
|
||||
|
||||
# go for a 32-bit sdl mingw exe by default
|
||||
MINGW=1
|
||||
SDL=1
|
||||
|
||||
else # if you on the *nix
|
||||
|
||||
system:=$(shell uname -s)
|
||||
|
||||
ifeq ($(system),Linux)
|
||||
new_system=LINUX
|
||||
else
|
||||
|
||||
$(error \
|
||||
Could not automatically detect your system,\
|
||||
try specifying a system manually)
|
||||
|
||||
endif
|
||||
|
||||
ifeq ($(shell getconf LONG_BIT),64)
|
||||
system+=64-bit
|
||||
new_system:=$(new_system)64
|
||||
endif
|
||||
|
||||
$(info Detected $(system) ($(new_system))...)
|
||||
$(new_system)=1
|
||||
|
||||
endif
|
||||
endif
|
||||
|
||||
|
||||
# SRB2 data files
|
||||
D_DIR?=../bin/Resources
|
||||
D_FILES=$(D_DIR)/srb2.srb \
|
||||
|
|
Loading…
Reference in a new issue