diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/Makefile | 17 |
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 |
43 | CCOPT_X86= -march=i686 | 43 | CCOPT_X86= -march=i686 |
44 | CCOPT_X64= | 44 | CCOPT_X64= |
45 | CCOPT_PPCSPE= | ||
45 | # | 46 | # |
46 | CCDEBUG= | 47 | CCDEBUG= |
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 |
180 | endif | 181 | endif |
181 | 182 | ||
182 | ifeq (,$(findstring __i386__,$(shell echo __i386__ | $(TARGET_CC) -P -E -))) | 183 | TARGET_TESTARCH=$(shell $(TARGET_CC) $(TARGET_ACFLAGS) -E lj_arch.h -dM) |
184 | ifneq (,$(findstring LJ_TARGET_X64 ,$(TARGET_TESTARCH))) | ||
185 | TARGET_CCARCH= x64 | ||
186 | TARGET_XCFLAGS+= $(CCOPT_X64) | ||
187 | else | ||
188 | ifneq (,$(findstring LJ_TARGET_X86 ,$(TARGET_TESTARCH))) | ||
183 | TARGET_CCARCH= x86 | 189 | TARGET_CCARCH= x86 |
184 | TARGET_XCFLAGS+= $(CCOPT_X86) | 190 | TARGET_XCFLAGS+= $(CCOPT_X86) |
185 | else | 191 | else |
186 | TARGET_CCARCH= x64 | 192 | ifneq (,$(findstring LJ_TARGET_PPCSPE ,$(TARGET_TESTARCH))) |
187 | TARGET_XCFLAGS+= $(CCOPT_X64) | 193 | TARGET_CCARCH= ppcspe |
194 | TARGET_XCFLAGS+= $(CCOPT_PPCSPE) | ||
195 | else | ||
196 | $(error Unsupported target architecture) | ||
197 | endif | ||
198 | endif | ||
188 | endif | 199 | endif |
189 | 200 | ||
190 | ifneq (,$(PREFIX)) | 201 | ifneq (,$(PREFIX)) |