aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Makefile17
1 files changed, 14 insertions, 3 deletions
diff --git a/src/Makefile b/src/Makefile
index 24d32656..ed1be4ba 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -42,6 +42,7 @@ CCOPT= -O2 -fomit-frame-pointer
42# binaries to a different machine you could also use: -march=native 42# binaries to a different machine you could also use: -march=native
43CCOPT_X86= -march=i686 43CCOPT_X86= -march=i686
44CCOPT_X64= 44CCOPT_X64=
45CCOPT_PPCSPE=
45# 46#
46CCDEBUG= 47CCDEBUG=
47# Uncomment the next line to generate debug information: 48# Uncomment the next line to generate debug information:
@@ -179,12 +180,22 @@ ifneq (,$(findstring stack-protector,$(shell $(TARGET_CC) -dumpspecs)))
179 TARGET_XCFLAGS+= -fno-stack-protector 180 TARGET_XCFLAGS+= -fno-stack-protector
180endif 181endif
181 182
182ifeq (,$(findstring __i386__,$(shell echo __i386__ | $(TARGET_CC) -P -E -))) 183TARGET_TESTARCH=$(shell $(TARGET_CC) $(TARGET_ACFLAGS) -E lj_arch.h -dM)
184ifneq (,$(findstring LJ_TARGET_X64 ,$(TARGET_TESTARCH)))
185 TARGET_CCARCH= x64
186 TARGET_XCFLAGS+= $(CCOPT_X64)
187else
188ifneq (,$(findstring LJ_TARGET_X86 ,$(TARGET_TESTARCH)))
183 TARGET_CCARCH= x86 189 TARGET_CCARCH= x86
184 TARGET_XCFLAGS+= $(CCOPT_X86) 190 TARGET_XCFLAGS+= $(CCOPT_X86)
185else 191else
186 TARGET_CCARCH= x64 192ifneq (,$(findstring LJ_TARGET_PPCSPE ,$(TARGET_TESTARCH)))
187 TARGET_XCFLAGS+= $(CCOPT_X64) 193 TARGET_CCARCH= ppcspe
194 TARGET_XCFLAGS+= $(CCOPT_PPCSPE)
195else
196 $(error Unsupported target architecture)
197endif
198endif
188endif 199endif
189 200
190ifneq (,$(PREFIX)) 201ifneq (,$(PREFIX))