aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/Makefile46
1 files changed, 28 insertions, 18 deletions
diff --git a/src/Makefile b/src/Makefile
index 532da6e9..9845f6a0 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -24,11 +24,13 @@ NODOTABIVER= 51
24# removing the '#' in front of them. Make sure you force a full recompile 24# removing the '#' in front of them. Make sure you force a full recompile
25# with "make clean", followed by "make" if you change any options. 25# with "make clean", followed by "make" if you change any options.
26# 26#
27DEFAULT_CC = gcc
28#
27# LuaJIT builds as a native 32 or 64 bit binary by default. 29# LuaJIT builds as a native 32 or 64 bit binary by default.
28CC= gcc 30CC= $(DEFAULT_CC)
29# 31#
30# Use this if you want to force a 32 bit build on a 64 bit multilib OS. 32# Use this if you want to force a 32 bit build on a 64 bit multilib OS.
31#CC= gcc -m32 33#CC= $(DEFAULT_CC) -m32
32# 34#
33# Since the assembler part does NOT maintain a frame pointer, it's pointless 35# Since the assembler part does NOT maintain a frame pointer, it's pointless
34# to slow down the C part by not omitting it. Debugging, tracebacks and 36# to slow down the C part by not omitting it. Debugging, tracebacks and
@@ -148,6 +150,29 @@ XCFLAGS=
148############################################################################## 150##############################################################################
149 151
150############################################################################## 152##############################################################################
153# Host system detection.
154##############################################################################
155
156ifeq (Windows,$(findstring Windows,$(OS))$(MSYSTEM)$(TERM))
157 HOST_SYS= Windows
158 HOST_RM= del
159else
160 HOST_SYS:= $(shell uname -s)
161 ifneq (,$(findstring MINGW,$(HOST_SYS)))
162 HOST_SYS= Windows
163 HOST_MSYS= mingw
164 endif
165 ifneq (,$(findstring CYGWIN,$(HOST_SYS)))
166 HOST_SYS= Windows
167 HOST_MSYS= cygwin
168 endif
169 # Use Clang for OSX host.
170 ifeq (Darwin,$(HOST_SYS))
171 DEFAULT_CC= clang
172 endif
173endif
174
175##############################################################################
151# Flags and options for host and target. 176# Flags and options for host and target.
152############################################################################## 177##############################################################################
153 178
@@ -268,24 +293,9 @@ ifneq (,$(LMULTILIB))
268endif 293endif
269 294
270############################################################################## 295##############################################################################
271# System detection. 296# Target system detection.
272############################################################################## 297##############################################################################
273 298
274ifeq (Windows,$(findstring Windows,$(OS))$(MSYSTEM)$(TERM))
275 HOST_SYS= Windows
276 HOST_RM= del
277else
278 HOST_SYS:= $(shell uname -s)
279 ifneq (,$(findstring MINGW,$(HOST_SYS)))
280 HOST_SYS= Windows
281 HOST_MSYS= mingw
282 endif
283 ifneq (,$(findstring CYGWIN,$(HOST_SYS)))
284 HOST_SYS= Windows
285 HOST_MSYS= cygwin
286 endif
287endif
288
289TARGET_SYS?= $(HOST_SYS) 299TARGET_SYS?= $(HOST_SYS)
290ifeq (Windows,$(TARGET_SYS)) 300ifeq (Windows,$(TARGET_SYS))
291 TARGET_STRIP+= --strip-unneeded 301 TARGET_STRIP+= --strip-unneeded