1 ##############################################################################
2 # LuaJIT Makefile. Requires GNU Make.
4 # Please read doc/install.html before changing any variables!
6 # Suitable for POSIX platforms (Linux, *BSD, OSX etc.).
7 # Also works with MinGW and Cygwin on Windows.
8 # Please check msvcbuild.bat for building with MSVC on Windows.
10 # Copyright (C) 2005-2011 Mike Pall. See Copyright Notice in luajit.h
11 ##############################################################################
19 ##############################################################################
20 ############################# COMPILER OPTIONS #############################
21 ##############################################################################
22 # These options mainly affect the speed of the JIT compiler itself, not the
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.
27 # LuaJIT builds as a native 32 or 64 bit binary by default.
30 # Use this if you want to force a 32 bit build on a 64 bit multilib OS.
33 # 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
35 # unwinding are not affected -- the assembler part has frame unwind
36 # information and GCC emits it where needed (x64) or with -g (see CCDEBUG).
37 CCOPT
= -O2
-fomit-frame-pointer
38 # Use this if you want to generate a smaller binary (but it's slower):
39 #CCOPT= -Os -fomit-frame-pointer
40 # Note: it's no longer recommended to use -O3 with GCC 4.x.
41 # The I-Cache bloat usually outweighs the benefits from aggressive inlining.
43 # Target-specific compiler options:
45 # x86 only: it's recommended to compile at least for i686. By default the
46 # assembler part of the interpreter makes use of CMOV/FCOMI*/FUCOMI*
47 # instructions, anyway.
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
52 CCOPT_X86
= -march
=i686
59 # Uncomment the next line to generate debug information:
63 # Uncomment the next line to enable more warnings:
64 #CCWARN+= -Wextra -Wdeclaration-after-statement -Wredundant-decls -Wshadow -Wpointer-arith
66 ##############################################################################
68 ##############################################################################
69 ################################ BUILD MODE ################################
70 ##############################################################################
71 # The default build mode is mixed mode on POSIX. On Windows this is the same
74 # Mixed mode creates a static + dynamic library and a statically linked luajit.
77 # Static mode creates a static library and a statically linked luajit.
80 # Dynamic mode creates a dynamic library and a dynamically linked luajit.
81 # Note: this executable will only run when the library is installed!
84 ##############################################################################
86 ##############################################################################
87 ################################# FEATURES #################################
88 ##############################################################################
89 # Enable/disable these features as needed, but make sure you force a full
90 # recompile with "make clean", followed by "make".
93 # Permanently disable the FFI extension to reduce the size of the LuaJIT
94 # executable. But please consider that the FFI library is compiled-in,
95 # but NOT loaded by default. It only allocates any memory, if you actually
97 #XCFLAGS+= -DLUAJIT_DISABLE_FFI
99 # Enable some upwards-compatible features from Lua 5.2 that are unlikely
100 # to break existing code (e.g. __pairs). Note that this does not provide
101 # full compatibility with Lua 5.2 at this time.
102 #XCFLAGS+= -DLUAJIT_ENABLE_LUA52COMPAT
104 # Disable the JIT compiler, i.e. turn LuaJIT into a pure interpreter.
105 #XCFLAGS+= -DLUAJIT_DISABLE_JIT
107 # x86 only: use SSE2 instead of x87 instructions in the interpreter
108 # (always enabled for x64). A pure interpreter built with this flag won't
109 # run on older CPUs (before P4 or K8). There isn't much of a speed
110 # difference, so this is not enabled by default.
111 # The JIT compiler is not affected by this flag. It always uses runtime
112 # CPU feature detection before emitting code for SSE2 up to SSE4.1.
113 #XCFLAGS+= -DLUAJIT_CPU_SSE2
115 # x86 only: Disable the use of CMOV and FCOMI*/FUCOMI* instructions in the
116 # interpreter. Do this only if you intend to use REALLY ANCIENT CPUs
117 # (before Pentium Pro, or on the VIA C3). This generally slows down the
118 # interpreter. Don't bother if your OS wouldn't run on them, anyway.
119 #XCFLAGS+= -DLUAJIT_CPU_NOCMOV
121 # Some architectures (e.g. PPC) can use either single-number (1) or
122 # dual-number (2) mode. Uncomment one of these lines to override the
123 # default mode. Please see LJ_ARCH_NUMMODE in lj_arch.h for details.
124 #XCFLAGS+= -DLUAJIT_NUMMODE=1
125 #XCFLAGS+= -DLUAJIT_NUMMODE=2
127 ##############################################################################
129 ##############################################################################
130 ############################ DEBUGGING SUPPORT #############################
131 ##############################################################################
132 # Enable these options as needed, but make sure you force a full recompile
133 # with "make clean", followed by "make".
134 # Note that most of these are NOT suitable for benchmarking or release mode!
136 # Use the system provided memory allocator (realloc) instead of the
137 # bundled memory allocator. This is slower, but sometimes helpful for
138 # debugging. It's helpful for Valgrind's memcheck tool, too. This option
139 # cannot be enabled on x64, since the built-in allocator is mandatory.
140 #XCFLAGS+= -DLUAJIT_USE_SYSMALLOC
142 # This define is required to run LuaJIT under Valgrind. The Valgrind
143 # header files must be installed. You should enable debug information, too.
144 #XCFLAGS+= -DLUAJIT_USE_VALGRIND
146 # This is the client for the GDB JIT API. GDB 7.0 or higher is required
147 # to make use of it. See lj_gdbjit.c for details. Enabling this causes
148 # a non-negligible overhead, even when not running under GDB.
149 #XCFLAGS+= -DLUAJIT_USE_GDBJIT
151 # Turn on assertions for the Lua/C API to debug problems with lua_* calls.
152 # This is rather slow -- use only while developing C libraries/embeddings.
153 #XCFLAGS+= -DLUA_USE_APICHECK
155 # Turn on assertions for the whole LuaJIT VM. This significantly slows down
156 # everything. Use only if you suspect a problem with LuaJIT itself.
157 #XCFLAGS+= -DLUA_USE_ASSERT
159 ##############################################################################
160 # You probably don't need to change anything below this line!
161 ##############################################################################
163 ##############################################################################
164 # Flags and options for host and target.
165 ##############################################################################
167 # You can override the following variables at the make command line:
168 # CC HOST_CC STATIC_CC DYNAMIC_CC
169 # CFLAGS HOST_CFLAGS TARGET_CFLAGS
170 # LDFLAGS HOST_LDFLAGS TARGET_LDFLAGS TARGET_SHLDFLAGS
171 # LIBS HOST_LIBS TARGET_LIBS
172 # CROSS HOST_SYS TARGET_SYS TARGET_FLAGS
174 # Cross-compilation examples:
175 # make HOST_CC="gcc -m32" CROSS=i586-mingw32msvc- TARGET_SYS=Windows
176 # make HOST_CC="gcc -m32" CROSS=powerpc-e500v2-linux-gnuspe- TARGET=ppcspe
178 CCOPTIONS
= $(CCDEBUG
) $(CCOPT
) $(CCWARN
) $(XCFLAGS
) $(CFLAGS
)
179 LDOPTIONS
= $(CCDEBUG
) $(LDFLAGS
)
181 TARGET_ARCH
= $(patsubst %,-DLUAJIT_TARGET
=LUAJIT_ARCH_
%,$(TARGET
))
185 # NOTE: The LuaJIT distribution comes with pre-generated buildvm_*.h files.
186 # You DO NOT NEED an installed copy of (plain) Lua 5.1 to run DynASM unless
187 # you want to MODIFY the corresponding *.dasc file. You can also use LuaJIT
188 # itself (bootstrapped from a pre-generated file) to run DynASM of course.
194 HOST_ACFLAGS
= $(CCOPTIONS
) $(HOST_XCFLAGS
) $(TARGET_ARCH
) $(HOST_CFLAGS
)
195 HOST_ALDFLAGS
= $(LDOPTIONS
) $(HOST_XLDFLAGS
) $(HOST_LDFLAGS
)
196 HOST_ALIBS
= $(HOST_XLIBS
) $(LIBS
) $(HOST_LIBS
)
198 STATIC_CC
= $(CROSS
)$(CC
)
199 DYNAMIC_CC
= $(CROSS
)$(CC
) -fPIC
200 TARGET_CC
= $(STATIC_CC
)
201 TARGET_STCC
= $(STATIC_CC
)
202 TARGET_DYNCC
= $(DYNAMIC_CC
)
203 TARGET_LD
= $(CROSS
)$(CC
)
204 TARGET_AR
= $(CROSS
)ar rcus
205 TARGET_STRIP
= $(CROSS
)strip
207 TARGET_SONAME
= libluajit-
$(ABIVER
).so.
$(MAJVER
)
208 TARGET_DYLIBNAME
= libluajit-
$(NODOTABIVER
).
$(MAJVER
).dylib
209 TARGET_DYLIBPATH
= $(or
$(PREFIX
),/usr
/local
)/lib
/$(TARGET_DYLIBNAME
)
210 TARGET_DLLNAME
= lua
$(NODOTABIVER
).dll
211 TARGET_XSHLDFLAGS
= -shared
-fPIC
-Wl
,-soname
,$(TARGET_SONAME
)
214 TARGET_XCFLAGS
= -D_FILE_OFFSET_BITS
=64 -D_LARGEFILE_SOURCE
-U_FORTIFY_SOURCE
217 TARGET_ACFLAGS
= $(CCOPTIONS
) $(TARGET_XCFLAGS
) $(TARGET_ARCH
) $(TARGET_FLAGS
) $(TARGET_CFLAGS
)
218 TARGET_ALDFLAGS
= $(LDOPTIONS
) $(TARGET_XLDFLAGS
) $(TARGET_FLAGS
) $(TARGET_LDFLAGS
)
219 TARGET_ASHLDFLAGS
= $(LDOPTIONS
) $(TARGET_XSHLDFLAGS
) $(TARGET_FLAGS
) $(TARGET_SHLDFLAGS
)
220 TARGET_ALIBS
= $(TARGET_XLIBS
) $(LIBS
) $(TARGET_LIBS
)
222 ifneq (,$(findstring stack-protector
,$(shell $(TARGET_CC
) -dumpspecs
)))
223 TARGET_XCFLAGS
+= -fno-stack-protector
226 TARGET_TESTARCH
=$(shell $(TARGET_CC
) $(TARGET_ACFLAGS
) -E lj_arch.h
-dM
)
227 ifneq (,$(findstring LJ_TARGET_X64
,$(TARGET_TESTARCH
)))
229 TARGET_XCFLAGS
+= $(CCOPT_X64
)
231 ifneq (,$(findstring LJ_TARGET_X86
,$(TARGET_TESTARCH
)))
233 TARGET_XCFLAGS
+= $(CCOPT_X86
)
235 ifneq (,$(findstring LJ_TARGET_ARM
,$(TARGET_TESTARCH
)))
237 TARGET_XCFLAGS
+= $(CCOPT_ARM
)
239 ifneq (,$(findstring LJ_TARGET_PPC
,$(TARGET_TESTARCH
)))
241 TARGET_XCFLAGS
+= $(CCOPT_PPC
)
243 ifneq (,$(findstring LJ_TARGET_PPCSPE
,$(TARGET_TESTARCH
)))
244 TARGET_CCARCH
= ppcspe
245 TARGET_XCFLAGS
+= $(CCOPT_PPCSPE
)
247 $(error Unsupported target architecture
)
255 ifneq (/usr
/local
,$(PREFIX
))
256 TARGET_XCFLAGS
+= -DLUA_XROOT
=\"$(PREFIX
)/\"
257 ifneq (/usr
,$(PREFIX
))
258 TARGET_DYNXLDOPTS
= -Wl
,-rpath
,$(PREFIX
)/lib
263 ##############################################################################
265 ##############################################################################
267 ifneq (,$(findstring Windows
,$(OS
)))
270 HOST_SYS
:= $(shell uname
-s
)
271 ifneq (,$(findstring CYGWIN
,$(TARGET_SYS
)))
275 ifeq (Windows
,$(HOST_SYS
))
279 TARGET_SYS
= $(HOST_SYS
)
280 ifeq (Windows
,$(TARGET_SYS
))
281 TARGET_STRIP
+= --strip-unneeded
282 TARGET_XSHLDFLAGS
= -shared
285 ifeq (Darwin
,$(TARGET_SYS
))
286 export MACOSX_DEPLOYMENT_TARGET
=10.4
288 TARGET_AR
+= 2>/dev
/null
289 TARGET_XSHLDFLAGS
= -dynamiclib
-single_module
-undefined dynamic_lookup
-fPIC
291 TARGET_XSHLDFLAGS
+= -install_name
$(TARGET_DYLIBPATH
) -compatibility_version
$(MAJVER
).
$(MINVER
) -current_version
$(MAJVER
).
$(MINVER
).
$(RELVER
)
292 ifeq (x64
,$(TARGET_CCARCH
))
293 TARGET_XLDFLAGS
+= -pagezero_size
10000 -image_base
100000000
294 TARGET_XSHLDFLAGS
+= -image_base
7fff04c4a000
297 ifeq (iOS
,$(TARGET_SYS
))
299 TARGET_AR
+= 2>/dev
/null
300 TARGET_XSHLDFLAGS
= -dynamiclib
-single_module
-undefined dynamic_lookup
-fPIC
302 TARGET_XSHLDFLAGS
+= -install_name
$(TARGET_DYLIBPATH
) -compatibility_version
$(MAJVER
).
$(MINVER
) -current_version
$(MAJVER
).
$(MINVER
).
$(RELVER
)
304 ifneq (SunOS
,$(TARGET_SYS
))
305 TARGET_XLDFLAGS
+= -Wl
,-E
307 ifeq (Linux
,$(TARGET_SYS
))
310 ifeq (GNU
/kFreeBSD
,$(TARGET_SYS
))
317 ifneq ($(HOST_SYS
),$(TARGET_SYS
))
318 ifeq (Windows
,$(TARGET_SYS
))
319 HOST_XCFLAGS
+= -malign-double
-DLUAJIT_OS
=LUAJIT_OS_WINDOWS
321 ifeq (Linux
,$(TARGET_SYS
))
322 HOST_XCFLAGS
+= -DLUAJIT_OS
=LUAJIT_OS_LINUX
324 ifeq (Darwin
,$(TARGET_SYS
))
325 HOST_XCFLAGS
+= -DLUAJIT_OS
=LUAJIT_OS_OSX
327 ifeq (iOS
,$(TARGET_SYS
))
328 HOST_XCFLAGS
+= -DLUAJIT_OS
=LUAJIT_OS_OSX
330 HOST_XCFLAGS
+= -DLUAJIT_OS
=LUAJIT_OS_OTHER
341 ##############################################################################
342 # Files and pathnames.
343 ##############################################################################
346 DASM
= $(HOST_LUA
) $(DASM_DIR
)/dynasm.lua
350 DASM_FLAGS_X64
= -D X64
351 DASM_FLAGS_X64WIN
= -D X64
-D X64WIN
356 BUILDVM_O
= buildvm.o buildvm_asm.o buildvm_peobj.o buildvm_lib.o buildvm_fold.o
358 BUILDVM_X
= .
/$(BUILDVM_T
)
368 LJLIB_O
= lib_base.o lib_math.o lib_bit.o lib_string.o lib_table.o \
369 lib_io.o lib_os.o lib_package.o lib_debug.o lib_jit.o lib_ffi.o
370 LJLIB_C
= $(LJLIB_O
:.o
=.c
)
372 LJCORE_O
= lj_gc.o lj_err.o lj_char.o lj_bc.o lj_obj.o \
373 lj_str.o lj_tab.o lj_func.o lj_udata.o lj_meta.o lj_debug.o \
374 lj_state.o lj_dispatch.o lj_vmevent.o lj_vmmath.o lj_api.o \
375 lj_lex.o lj_parse.o lj_bcread.o lj_bcwrite.o \
376 lj_ir.o lj_opt_mem.o lj_opt_fold.o lj_opt_narrow.o \
377 lj_opt_dce.o lj_opt_loop.o lj_opt_split.o \
378 lj_mcode.o lj_snap.o lj_record.o lj_crecord.o lj_ffrecord.o \
379 lj_asm.o lj_trace.o lj_gdbjit.o \
380 lj_ctype.o lj_cdata.o lj_cconv.o lj_ccall.o lj_carith.o lj_clib.o \
382 lj_lib.o lj_alloc.o lib_aux.o \
383 $(LJLIB_O
) lib_init.o
385 LJVMCORE_O
= $(LJVM_O
) $(LJCORE_O
)
386 LJVMCORE_DYNO
= $(LJVMCORE_O
:.o
=_dyn.o
)
388 LIB_VMDEF
= ..
/lib
/vmdef.lua
389 LIB_VMDEFP
= $(LIB_VMDEF
)
392 LUAJIT_A
= libluajit.a
393 LUAJIT_SO
= libluajit.so
396 ALL_T
= $(LUAJIT_T
) $(LUAJIT_A
) $(LUAJIT_SO
) $(BUILDVM_T
)
397 ALL_HDRGEN
= lj_bcdef.h lj_ffdef.h lj_libdef.h lj_recdef.h lj_folddef.h
398 ALL_GEN
= $(LJVM_S
) $(ALL_HDRGEN
) $(LIB_VMDEFP
)
399 ALL_DYNGEN
= buildvm_x86.h buildvm_x64.h buildvm_x64win.h buildvm_arm.h \
400 buildvm_ppc.h buildvm_ppcspe.h
401 WIN_RM
= *.obj
*.lib
*.exp
*.dll
*.exe
*.manifest
*.pdb
*.ilk
402 ALL_RM
= $(ALL_T
) $(ALL_GEN
) *.o
$(WIN_RM
)
404 ##############################################################################
405 # Build mode handling.
406 ##############################################################################
408 # Mixed mode defaults.
409 TARGET_O
= $(LUAJIT_A
)
410 TARGET_T
= $(LUAJIT_T
) $(LUAJIT_SO
)
411 TARGET_DEP
= $(LIB_VMDEF
) $(LUAJIT_SO
)
413 ifeq (Windows
,$(HOST_SYS
))
414 BUILDVM_T
= buildvm.exe
415 LIB_VMDEFP
= $(subst /,\\,$(LIB_VMDEF
))
417 ifeq (Windows
,$(TARGET_SYS
))
418 TARGET_DYNCC
= $(STATIC_CC
)
420 LUAJIT_SO
= $(TARGET_DLLNAME
)
422 # Mixed mode is not supported on Windows. And static mode doesn't work well.
423 # C modules cannot be loaded, because they bind to lua51.dll.
424 ifneq (static
,$(BUILDMODE
))
426 TARGET_XCFLAGS
+= -DLUA_BUILD_AS_DLL
429 ifeq (Darwin
,$(TARGET_SYS
))
432 ifeq (iOS
,$(TARGET_SYS
))
435 ifeq (SunOS
,$(TARGET_SYS
))
439 ifeq (static
,$(BUILDMODE
))
441 TARGET_T
= $(LUAJIT_T
)
442 TARGET_DEP
= $(LIB_VMDEF
)
444 ifeq (dynamic
,$(BUILDMODE
))
445 ifneq (Windows
,$(TARGET_SYS
))
446 TARGET_CC
= $(DYNAMIC_CC
)
449 LJVMCORE_DYNO
= $(LJVMCORE_O
)
450 TARGET_O
= $(LUAJIT_SO
)
451 TARGET_XLDFLAGS
+= $(TARGET_DYNXLDOPTS
)
453 ifeq (Darwin
,$(TARGET_SYS
))
455 LJVMCORE_DYNO
= $(LJVMCORE_O
)
457 ifeq (iOS
,$(TARGET_SYS
))
459 LJVMCORE_DYNO
= $(LJVMCORE_O
)
469 ##############################################################################
471 ##############################################################################
473 default
all: $(TARGET_T
)
476 @grep
"^[+|]" ljamalg.c
477 $(MAKE
) all "LJCORE_O=ljamalg.o"
483 $(HOST_RM
) $(ALL_RM
) $(ALL_DYNGEN
)
487 $(Q
)$(DASM
) $(DASM_DISTFLAGS
) $(DASM_FLAGS_X86
) -o buildvm_x86.h buildvm_x86.dasc
488 $(Q
)$(DASM
) $(DASM_DISTFLAGS
) $(DASM_FLAGS_X64
) -o buildvm_x64.h buildvm_x86.dasc
489 $(Q
)$(DASM
) $(DASM_DISTFLAGS
) $(DASM_FLAGS_X64WIN
) -o buildvm_x64win.h buildvm_x86.dasc
490 $(Q
)$(DASM
) $(DASM_DISTFLAGS
) $(DASM_FLAGS_ARM
) -o buildvm_arm.h buildvm_arm.dasc
491 $(Q
)$(DASM
) $(DASM_DISTFLAGS
) $(DASM_FLAGS_PPC
) -o buildvm_ppc.h buildvm_ppc.dasc
492 $(Q
)$(DASM
) $(DASM_DISTFLAGS
) $(DASM_FLAGS_PPCSPE
) -o buildvm_ppcspe.h buildvm_ppcspe.dasc
495 @for file in
$(ALL_HDRGEN
) $(ALL_DYNGEN
); do \
496 test -f
$$file || touch
$$file; \
498 @
$(HOST_CC
) $(HOST_ACFLAGS
) -MM
*.c | \
499 sed
-e
"s| [^ ]*/dasm_\S*\.h||g" \
500 -e
"s| buildvm_\S*\.h||g" \
501 -e
"s| lj_target_\S*\.h| lj_target_*.h|g" \
502 -e
"s| lj_emit_\S*\.h| lj_emit_*.h|g" \
503 -e
"s| lj_asm_\S*\.h| lj_asm_*.h|g" >Makefile.dep
504 @for file in
$(ALL_HDRGEN
) $(ALL_DYNGEN
); do \
505 test -s
$$file ||
$(HOST_RM
) $$file; \
508 .PHONY
: default
all amalg
clean cleaner
distclean depend
510 ##############################################################################
511 # Rules for generated files.
512 ##############################################################################
514 buildvm_x86.h
: buildvm_x86.dasc
516 $(Q
)$(DASM
) $(DASM_FLAGS
) $(DASM_FLAGS_X86
) -o
$@ buildvm_x86.dasc
518 buildvm_x64.h
: buildvm_x86.dasc
520 $(Q
)$(DASM
) $(DASM_FLAGS
) $(DASM_FLAGS_X64
) -o
$@ buildvm_x86.dasc
522 buildvm_x64win.h
: buildvm_x86.dasc
524 $(Q
)$(DASM
) $(DASM_FLAGS
) $(DASM_FLAGS_X64WIN
) -o
$@ buildvm_x86.dasc
526 buildvm_arm.h
: buildvm_arm.dasc
528 $(Q
)$(DASM
) $(DASM_FLAGS
) $(DASM_FLAGS_ARM
) -o
$@ buildvm_arm.dasc
530 buildvm_ppc.h
: buildvm_ppc.dasc
532 $(Q
)$(DASM
) $(DASM_FLAGS
) $(DASM_FLAGS_PPC
) -o
$@ buildvm_ppc.dasc
534 buildvm_ppcspe.h
: buildvm_ppcspe.dasc
536 $(Q
)$(DASM
) $(DASM_FLAGS
) $(DASM_FLAGS_PPCSPE
) -o
$@ buildvm_ppcspe.dasc
538 buildvm.o
: $(ALL_DYNGEN
) $(DASM_DIR
)/dasm_
*.h
540 $(BUILDVM_T
): $(BUILDVM_O
)
542 $(Q
)$(HOST_CC
) $(HOST_ALDFLAGS
) -o
$@
$(BUILDVM_O
) $(HOST_ALIBS
)
544 $(LJVM_BOUT
): $(BUILDVM_T
)
546 $(Q
)$(BUILDVM_X
) -m
$(LJVM_MODE
) -o
$@
548 lj_bcdef.h
: $(BUILDVM_T
) $(LJLIB_C
)
550 $(Q
)$(BUILDVM_X
) -m bcdef
-o
$@
$(LJLIB_C
)
552 lj_ffdef.h
: $(BUILDVM_T
) $(LJLIB_C
)
554 $(Q
)$(BUILDVM_X
) -m ffdef
-o
$@
$(LJLIB_C
)
556 lj_libdef.h
: $(BUILDVM_T
) $(LJLIB_C
)
558 $(Q
)$(BUILDVM_X
) -m libdef
-o
$@
$(LJLIB_C
)
560 lj_recdef.h
: $(BUILDVM_T
) $(LJLIB_C
)
562 $(Q
)$(BUILDVM_X
) -m recdef
-o
$@
$(LJLIB_C
)
564 $(LIB_VMDEF
): $(BUILDVM_T
) $(LJLIB_C
)
566 $(Q
)$(BUILDVM_X
) -m vmdef
-o
$(LIB_VMDEFP
) $(LJLIB_C
)
568 lj_folddef.h
: $(BUILDVM_T
) lj_opt_fold.c
570 $(Q
)$(BUILDVM_X
) -m folddef
-o
$@ lj_opt_fold.c
572 ##############################################################################
574 ##############################################################################
578 $(Q
)$(TARGET_DYNCC
) $(TARGET_ACFLAGS
) -c
-o
$(@
:.o
=_dyn.o
) $<
579 $(Q
)$(TARGET_CC
) $(TARGET_ACFLAGS
) -c
-o
$@
$<
583 $(Q
)$(TARGET_DYNCC
) $(TARGET_ACFLAGS
) -c
-o
$(@
:.o
=_dyn.o
) $<
584 $(Q
)$(TARGET_CC
) $(TARGET_ACFLAGS
) -c
-o
$@
$<
588 $(Q
)$(TARGET_STCC
) $(TARGET_ACFLAGS
) -c
-o
$@
$<
592 $(Q
)$(HOST_CC
) $(HOST_ACFLAGS
) -c
-o
$@
$<
596 ##############################################################################
598 ##############################################################################
600 $(LUAJIT_A
): $(LJVMCORE_O
)
602 $(Q
)$(TARGET_AR
) $@
$(LJVMCORE_O
)
604 # The dependency on _O, but linking with _DYNO is intentional.
605 $(LUAJIT_SO
): $(LJVMCORE_O
)
607 $(Q
)$(TARGET_LD
) $(TARGET_ASHLDFLAGS
) -o
$@
$(LJVMCORE_DYNO
) $(TARGET_ALIBS
)
608 $(Q
)$(TARGET_STRIP
) $@
610 $(LUAJIT_T
): $(TARGET_O
) $(LUAJIT_O
) $(TARGET_DEP
)
612 $(Q
)$(TARGET_LD
) $(TARGET_ALDFLAGS
) -o
$@
$(LUAJIT_O
) $(TARGET_O
) $(TARGET_ALIBS
)
613 $(Q
)$(TARGET_STRIP
) $@
614 $(E
) "OK Successfully built LuaJIT"
616 ##############################################################################