diff options
author | Mike Pall <mike> | 2010-11-30 16:19:20 +0100 |
---|---|---|
committer | Mike Pall <mike> | 2010-11-30 16:19:20 +0100 |
commit | cd1901370d6e20379fe0fb57176182c7e9044bb8 (patch) | |
tree | df5684235c90bee5154a3ca6bf0c6f42e1657bd3 | |
parent | b3ef6040fa265cb94e3f1f331990e4ee52f33293 (diff) | |
download | luajit-cd1901370d6e20379fe0fb57176182c7e9044bb8.tar.gz luajit-cd1901370d6e20379fe0fb57176182c7e9044bb8.tar.bz2 luajit-cd1901370d6e20379fe0fb57176182c7e9044bb8.zip |
Rearrange src/Makefile. Split features and debugging support.
-rw-r--r-- | src/Makefile | 92 |
1 files changed, 56 insertions, 36 deletions
diff --git a/src/Makefile b/src/Makefile index 0417b1cb..87fddbad 100644 --- a/src/Makefile +++ b/src/Makefile | |||
@@ -17,10 +17,12 @@ ABIVER= 5.1 | |||
17 | NODOTABIVER= 51 | 17 | NODOTABIVER= 51 |
18 | 18 | ||
19 | ############################################################################## | 19 | ############################################################################## |
20 | # Compiler options: change them as needed. This mainly affects the speed of | 20 | ############################# COMPILER OPTIONS ############################# |
21 | # the JIT compiler itself, not the speed of the JIT compiled code. | 21 | ############################################################################## |
22 | # Turn any of the optional settings on by removing the '#' in front of them. | 22 | # These options mainly affect the speed of the JIT compiler itself, not the |
23 | # You need to 'make clean' and 'make' again, if you change any options. | 23 | # speed of the JIT-compiled code. Turn any of the optional settings on by |
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. | ||
24 | # | 26 | # |
25 | # LuaJIT builds as a native 32 or 64 bit binary by default. | 27 | # LuaJIT builds as a native 32 or 64 bit binary by default. |
26 | CC= gcc | 28 | CC= gcc |
@@ -38,10 +40,15 @@ CCOPT= -O2 -fomit-frame-pointer | |||
38 | # Note: it's no longer recommended to use -O3 with GCC 4.x. | 40 | # Note: it's no longer recommended to use -O3 with GCC 4.x. |
39 | # The I-Cache bloat usually outweighs the benefits from aggressive inlining. | 41 | # The I-Cache bloat usually outweighs the benefits from aggressive inlining. |
40 | # | 42 | # |
41 | # It's recommended to compile at least for i686. By default the assembler part | 43 | # Target-specific compiler options: |
42 | # of the interpreter makes use of CMOV/FCOMI*/FUCOMI* instructions, anyway. | 44 | # |
43 | # For GCC 4.2 or higher and if you don't intend to distribute the | 45 | # x86 only: it's recommended to compile at least for i686. By default the |
44 | # binaries to a different machine you could also use: -march=native | 46 | # assembler part of the interpreter makes use of CMOV/FCOMI*/FUCOMI* |
47 | # instructions, anyway. | ||
48 | # | ||
49 | # x86/x64 only: For GCC 4.2 or higher and if you don't intend to distribute | ||
50 | # the binaries to a different machine you could also use: -march=native | ||
51 | # | ||
45 | CCOPT_X86= -march=i686 | 52 | CCOPT_X86= -march=i686 |
46 | CCOPT_X64= | 53 | CCOPT_X64= |
47 | CCOPT_PPCSPE= | 54 | CCOPT_PPCSPE= |
@@ -57,9 +64,28 @@ CCWARN= -Wall | |||
57 | ############################################################################## | 64 | ############################################################################## |
58 | 65 | ||
59 | ############################################################################## | 66 | ############################################################################## |
60 | # Compile time definitions: change them as needed, but make sure you force | 67 | ################################ BUILD MODE ################################ |
61 | # a full recompile with "make clean", followed by "make". | 68 | ############################################################################## |
62 | # Note that most of these are NOT suitable for benchmarking or release mode! | 69 | # The default build mode is mixed mode on POSIX. On Windows this is the same |
70 | # as dynamic mode. | ||
71 | # | ||
72 | # Mixed mode creates a static + dynamic library and a statically linked luajit. | ||
73 | BUILDMODE= mixed | ||
74 | # | ||
75 | # Static mode creates a static library and a statically linked luajit. | ||
76 | #BUILDMODE= static | ||
77 | # | ||
78 | # Dynamic mode creates a dynamic library and a dynamically linked luajit. | ||
79 | # Note: this executable will only run when the library is installed! | ||
80 | #BUILDMODE= dynamic | ||
81 | # | ||
82 | ############################################################################## | ||
83 | |||
84 | ############################################################################## | ||
85 | ################################# FEATURES ################################# | ||
86 | ############################################################################## | ||
87 | # Enable/disable these features as needed, but make sure you force a full | ||
88 | # recompile with "make clean", followed by "make". | ||
63 | XCFLAGS= | 89 | XCFLAGS= |
64 | # | 90 | # |
65 | # Enable some upwards-compatible features from Lua 5.2 that are unlikely | 91 | # Enable some upwards-compatible features from Lua 5.2 that are unlikely |
@@ -67,13 +93,10 @@ XCFLAGS= | |||
67 | # full compatibility with Lua 5.2 at this time. | 93 | # full compatibility with Lua 5.2 at this time. |
68 | #XCFLAGS+= -DLUAJIT_ENABLE_LUA52COMPAT | 94 | #XCFLAGS+= -DLUAJIT_ENABLE_LUA52COMPAT |
69 | # | 95 | # |
70 | # Disable the use of CMOV and FCOMI*/FUCOMI* instructions in the interpreter. | 96 | # Disable the JIT compiler, i.e. turn LuaJIT into a pure interpreter. |
71 | # This is only necessary if you intend to run the code on REALLY ANCIENT CPUs | 97 | #XCFLAGS+= -DLUAJIT_DISABLE_JIT |
72 | # (before Pentium Pro, or on the VIA C3). This generally slows down the | ||
73 | # interpreter. Don't bother if your OS wouldn't run on them, anyway. | ||
74 | #XCFLAGS+= -DLUAJIT_CPU_NOCMOV | ||
75 | # | 98 | # |
76 | # Use SSE2 instructions instead of x87 instructions in the x86 interpreter | 99 | # x86 only: use SSE2 instead of x87 instructions in the interpreter |
77 | # (always enabled for x64). A pure interpreter built with this flag won't | 100 | # (always enabled for x64). A pure interpreter built with this flag won't |
78 | # run on older CPUs (before P4 or K8). There isn't much of a speed | 101 | # run on older CPUs (before P4 or K8). There isn't much of a speed |
79 | # difference, so this is not enabled by default. | 102 | # difference, so this is not enabled by default. |
@@ -81,8 +104,20 @@ XCFLAGS= | |||
81 | # CPU feature detection before emitting code for SSE2 up to SSE4.1. | 104 | # CPU feature detection before emitting code for SSE2 up to SSE4.1. |
82 | #XCFLAGS+= -DLUAJIT_CPU_SSE2 | 105 | #XCFLAGS+= -DLUAJIT_CPU_SSE2 |
83 | # | 106 | # |
84 | # Disable the JIT compiler, i.e. turn LuaJIT into a pure interpreter: | 107 | # x86 only: Disable the use of CMOV and FCOMI*/FUCOMI* instructions in the |
85 | #XCFLAGS+= -DLUAJIT_DISABLE_JIT | 108 | # interpreter. Do this only if you intend to use REALLY ANCIENT CPUs |
109 | # (before Pentium Pro, or on the VIA C3). This generally slows down the | ||
110 | # interpreter. Don't bother if your OS wouldn't run on them, anyway. | ||
111 | #XCFLAGS+= -DLUAJIT_CPU_NOCMOV | ||
112 | # | ||
113 | ############################################################################## | ||
114 | |||
115 | ############################################################################## | ||
116 | ############################ DEBUGGING SUPPORT ############################# | ||
117 | ############################################################################## | ||
118 | # Enable these options as needed, but make sure you force a full recompile | ||
119 | # with "make clean", followed by "make". | ||
120 | # Note that most of these are NOT suitable for benchmarking or release mode! | ||
86 | # | 121 | # |
87 | # Use the system provided memory allocator (realloc) instead of the | 122 | # Use the system provided memory allocator (realloc) instead of the |
88 | # bundled memory allocator. This is slower, but sometimes helpful for | 123 | # bundled memory allocator. This is slower, but sometimes helpful for |
@@ -108,29 +143,14 @@ XCFLAGS= | |||
108 | #XCFLAGS+= -DLUA_USE_ASSERT | 143 | #XCFLAGS+= -DLUA_USE_ASSERT |
109 | # | 144 | # |
110 | ############################################################################## | 145 | ############################################################################## |
111 | 146 | # You probably don't need to change anything below this line! | |
112 | ############################################################################## | ||
113 | # Build mode: override the mode as needed. Default is mixed mode on POSIX. | ||
114 | # On Windows this is the same as dynamic mode. | ||
115 | # | ||
116 | # Mixed mode creates a static + dynamic library and a statically linked luajit. | ||
117 | BUILDMODE= mixed | ||
118 | # | ||
119 | # Static mode creates a static library and a statically linked luajit. | ||
120 | #BUILDMODE= static | ||
121 | # | ||
122 | # Dynamic mode creates a dynamic library and a dynamically linked luajit. | ||
123 | # Note: this executable will only run when the library is installed! | ||
124 | #BUILDMODE= dynamic | ||
125 | ############################################################################## | ||
126 | # You probably don't need to change anything below this line. | ||
127 | ############################################################################## | 147 | ############################################################################## |
128 | 148 | ||
129 | ############################################################################## | 149 | ############################################################################## |
130 | # Flags and options for host and target. | 150 | # Flags and options for host and target. |
131 | ############################################################################## | 151 | ############################################################################## |
132 | 152 | ||
133 | # You may also override the following variables at the make command line: | 153 | # You can override the following variables at the make command line: |
134 | # CC HOST_CC STATIC_CC DYNAMIC_CC | 154 | # CC HOST_CC STATIC_CC DYNAMIC_CC |
135 | # CFLAGS HOST_CFLAGS TARGET_CFLAGS | 155 | # CFLAGS HOST_CFLAGS TARGET_CFLAGS |
136 | # LDFLAGS HOST_LDFLAGS TARGET_LDFLAGS TARGET_SHLDFLAGS | 156 | # LDFLAGS HOST_LDFLAGS TARGET_LDFLAGS TARGET_SHLDFLAGS |