diff options
Diffstat (limited to 'src/Makefile')
-rw-r--r-- | src/Makefile | 112 |
1 files changed, 73 insertions, 39 deletions
diff --git a/src/Makefile b/src/Makefile index 384614f1..4650c3e0 100644 --- a/src/Makefile +++ b/src/Makefile | |||
@@ -11,8 +11,8 @@ | |||
11 | ############################################################################## | 11 | ############################################################################## |
12 | 12 | ||
13 | MAJVER= 2 | 13 | MAJVER= 2 |
14 | MINVER= 0 | 14 | MINVER= 1 |
15 | RELVER= 5 | 15 | RELVER= 0 |
16 | ABIVER= 5.1 | 16 | ABIVER= 5.1 |
17 | NODOTABIVER= 51 | 17 | NODOTABIVER= 51 |
18 | 18 | ||
@@ -44,17 +44,14 @@ CCOPT= -O2 -fomit-frame-pointer | |||
44 | # | 44 | # |
45 | # Target-specific compiler options: | 45 | # Target-specific compiler options: |
46 | # | 46 | # |
47 | # x86 only: it's recommended to compile at least for i686. Better yet, | ||
48 | # compile for an architecture that has SSE2, too (-msse -msse2). | ||
49 | # | ||
50 | # x86/x64 only: For GCC 4.2 or higher and if you don't intend to distribute | 47 | # x86/x64 only: For GCC 4.2 or higher and if you don't intend to distribute |
51 | # the binaries to a different machine you could also use: -march=native | 48 | # the binaries to a different machine you could also use: -march=native |
52 | # | 49 | # |
53 | CCOPT_x86= -march=i686 | 50 | CCOPT_x86= -march=i686 -msse -msse2 -mfpmath=sse |
54 | CCOPT_x64= | 51 | CCOPT_x64= |
55 | CCOPT_arm= | 52 | CCOPT_arm= |
53 | CCOPT_arm64= | ||
56 | CCOPT_ppc= | 54 | CCOPT_ppc= |
57 | CCOPT_ppcspe= | ||
58 | CCOPT_mips= | 55 | CCOPT_mips= |
59 | # | 56 | # |
60 | CCDEBUG= | 57 | CCDEBUG= |
@@ -113,6 +110,9 @@ XCFLAGS= | |||
113 | #XCFLAGS+= -DLUAJIT_NUMMODE=1 | 110 | #XCFLAGS+= -DLUAJIT_NUMMODE=1 |
114 | #XCFLAGS+= -DLUAJIT_NUMMODE=2 | 111 | #XCFLAGS+= -DLUAJIT_NUMMODE=2 |
115 | # | 112 | # |
113 | # Disable LJ_GC64 mode for x64. | ||
114 | #XCFLAGS+= -DLUAJIT_DISABLE_GC64 | ||
115 | # | ||
116 | ############################################################################## | 116 | ############################################################################## |
117 | 117 | ||
118 | ############################################################################## | 118 | ############################################################################## |
@@ -124,15 +124,14 @@ XCFLAGS= | |||
124 | # | 124 | # |
125 | # Use the system provided memory allocator (realloc) instead of the | 125 | # Use the system provided memory allocator (realloc) instead of the |
126 | # bundled memory allocator. This is slower, but sometimes helpful for | 126 | # bundled memory allocator. This is slower, but sometimes helpful for |
127 | # debugging. This option cannot be enabled on x64, since realloc usually | 127 | # debugging. This option cannot be enabled on x64 without GC64, since |
128 | # doesn't return addresses in the right address range. | 128 | # realloc usually doesn't return addresses in the right address range. |
129 | # OTOH this option is mandatory for Valgrind's memcheck tool on x64 and | 129 | # OTOH this option is mandatory for Valgrind's memcheck tool on x64 and |
130 | # the only way to get useful results from it for all other architectures. | 130 | # the only way to get useful results from it for all other architectures. |
131 | #XCFLAGS+= -DLUAJIT_USE_SYSMALLOC | 131 | #XCFLAGS+= -DLUAJIT_USE_SYSMALLOC |
132 | # | 132 | # |
133 | # This define is required to run LuaJIT under Valgrind. The Valgrind | 133 | # This define is required to run LuaJIT under Valgrind. The Valgrind |
134 | # header files must be installed. You should enable debug information, too. | 134 | # header files must be installed. You should enable debug information, too. |
135 | # Use --suppressions=lj.supp to avoid some false positives. | ||
136 | #XCFLAGS+= -DLUAJIT_USE_VALGRIND | 135 | #XCFLAGS+= -DLUAJIT_USE_VALGRIND |
137 | # | 136 | # |
138 | # This is the client for the GDB JIT API. GDB 7.0 or higher is required | 137 | # This is the client for the GDB JIT API. GDB 7.0 or higher is required |
@@ -189,7 +188,8 @@ endif | |||
189 | # make HOST_CC="gcc -m32" CROSS=i586-mingw32msvc- TARGET_SYS=Windows | 188 | # make HOST_CC="gcc -m32" CROSS=i586-mingw32msvc- TARGET_SYS=Windows |
190 | # make HOST_CC="gcc -m32" CROSS=powerpc-linux-gnu- | 189 | # make HOST_CC="gcc -m32" CROSS=powerpc-linux-gnu- |
191 | 190 | ||
192 | CCOPTIONS= $(CCDEBUG) $(CCOPT) $(CCWARN) $(XCFLAGS) $(CFLAGS) | 191 | ASOPTIONS= $(CCOPT) $(CCWARN) $(XCFLAGS) $(CFLAGS) |
192 | CCOPTIONS= $(CCDEBUG) $(ASOPTIONS) | ||
193 | LDOPTIONS= $(CCDEBUG) $(LDFLAGS) | 193 | LDOPTIONS= $(CCDEBUG) $(LDFLAGS) |
194 | 194 | ||
195 | HOST_CC= $(CC) | 195 | HOST_CC= $(CC) |
@@ -229,6 +229,7 @@ TARGET_XLDFLAGS= | |||
229 | TARGET_XLIBS= -lm | 229 | TARGET_XLIBS= -lm |
230 | TARGET_TCFLAGS= $(CCOPTIONS) $(TARGET_XCFLAGS) $(TARGET_FLAGS) $(TARGET_CFLAGS) | 230 | TARGET_TCFLAGS= $(CCOPTIONS) $(TARGET_XCFLAGS) $(TARGET_FLAGS) $(TARGET_CFLAGS) |
231 | TARGET_ACFLAGS= $(CCOPTIONS) $(TARGET_XCFLAGS) $(TARGET_FLAGS) $(TARGET_CFLAGS) | 231 | TARGET_ACFLAGS= $(CCOPTIONS) $(TARGET_XCFLAGS) $(TARGET_FLAGS) $(TARGET_CFLAGS) |
232 | TARGET_ASFLAGS= $(ASOPTIONS) $(TARGET_XCFLAGS) $(TARGET_FLAGS) $(TARGET_CFLAGS) | ||
232 | TARGET_ALDFLAGS= $(LDOPTIONS) $(TARGET_XLDFLAGS) $(TARGET_FLAGS) $(TARGET_LDFLAGS) | 233 | TARGET_ALDFLAGS= $(LDOPTIONS) $(TARGET_XLDFLAGS) $(TARGET_FLAGS) $(TARGET_LDFLAGS) |
233 | TARGET_ASHLDFLAGS= $(LDOPTIONS) $(TARGET_XSHLDFLAGS) $(TARGET_FLAGS) $(TARGET_SHLDFLAGS) | 234 | TARGET_ASHLDFLAGS= $(LDOPTIONS) $(TARGET_XSHLDFLAGS) $(TARGET_FLAGS) $(TARGET_SHLDFLAGS) |
234 | TARGET_ALIBS= $(TARGET_XLIBS) $(LIBS) $(TARGET_LIBS) | 235 | TARGET_ALIBS= $(TARGET_XLIBS) $(LIBS) $(TARGET_LIBS) |
@@ -243,17 +244,29 @@ else | |||
243 | ifneq (,$(findstring LJ_TARGET_ARM ,$(TARGET_TESTARCH))) | 244 | ifneq (,$(findstring LJ_TARGET_ARM ,$(TARGET_TESTARCH))) |
244 | TARGET_LJARCH= arm | 245 | TARGET_LJARCH= arm |
245 | else | 246 | else |
247 | ifneq (,$(findstring LJ_TARGET_ARM64 ,$(TARGET_TESTARCH))) | ||
248 | ifneq (,$(findstring __AARCH64EB__ ,$(TARGET_TESTARCH))) | ||
249 | TARGET_ARCH= -D__AARCH64EB__=1 | ||
250 | endif | ||
251 | TARGET_LJARCH= arm64 | ||
252 | else | ||
246 | ifneq (,$(findstring LJ_TARGET_PPC ,$(TARGET_TESTARCH))) | 253 | ifneq (,$(findstring LJ_TARGET_PPC ,$(TARGET_TESTARCH))) |
254 | ifneq (,$(findstring LJ_LE 1,$(TARGET_TESTARCH))) | ||
255 | TARGET_ARCH= -DLJ_ARCH_ENDIAN=LUAJIT_LE | ||
256 | else | ||
257 | TARGET_ARCH= -DLJ_ARCH_ENDIAN=LUAJIT_BE | ||
258 | endif | ||
247 | TARGET_LJARCH= ppc | 259 | TARGET_LJARCH= ppc |
248 | else | 260 | else |
249 | ifneq (,$(findstring LJ_TARGET_PPCSPE ,$(TARGET_TESTARCH))) | ||
250 | TARGET_LJARCH= ppcspe | ||
251 | else | ||
252 | ifneq (,$(findstring LJ_TARGET_MIPS ,$(TARGET_TESTARCH))) | 261 | ifneq (,$(findstring LJ_TARGET_MIPS ,$(TARGET_TESTARCH))) |
253 | ifneq (,$(findstring MIPSEL ,$(TARGET_TESTARCH))) | 262 | ifneq (,$(findstring MIPSEL ,$(TARGET_TESTARCH))) |
254 | TARGET_ARCH= -D__MIPSEL__=1 | 263 | TARGET_ARCH= -D__MIPSEL__=1 |
255 | endif | 264 | endif |
256 | TARGET_LJARCH= mips | 265 | ifneq (,$(findstring LJ_TARGET_MIPS64 ,$(TARGET_TESTARCH))) |
266 | TARGET_LJARCH= mips64 | ||
267 | else | ||
268 | TARGET_LJARCH= mips | ||
269 | endif | ||
257 | else | 270 | else |
258 | $(error Unsupported target architecture) | 271 | $(error Unsupported target architecture) |
259 | endif | 272 | endif |
@@ -267,6 +280,7 @@ ifneq (,$(findstring LJ_TARGET_PS3 1,$(TARGET_TESTARCH))) | |||
267 | TARGET_SYS= PS3 | 280 | TARGET_SYS= PS3 |
268 | TARGET_ARCH+= -D__CELLOS_LV2__ | 281 | TARGET_ARCH+= -D__CELLOS_LV2__ |
269 | TARGET_XCFLAGS+= -DLUAJIT_USE_SYSMALLOC | 282 | TARGET_XCFLAGS+= -DLUAJIT_USE_SYSMALLOC |
283 | TARGET_XLIBS+= -lpthread | ||
270 | endif | 284 | endif |
271 | 285 | ||
272 | TARGET_XCFLAGS+= $(CCOPT_$(TARGET_LJARCH)) | 286 | TARGET_XCFLAGS+= $(CCOPT_$(TARGET_LJARCH)) |
@@ -306,20 +320,30 @@ ifeq (Darwin,$(TARGET_SYS)) | |||
306 | $(error missing: export MACOSX_DEPLOYMENT_TARGET=XX.YY) | 320 | $(error missing: export MACOSX_DEPLOYMENT_TARGET=XX.YY) |
307 | endif | 321 | endif |
308 | TARGET_STRIP+= -x | 322 | TARGET_STRIP+= -x |
323 | # Ext. unwinding is broken on OSX/ARM64 until someone finds a fix. See #698. | ||
324 | ifneq (arm64,$(TARGET_LJARCH)) | ||
325 | TARGET_XCFLAGS+= -DLUAJIT_UNWIND_EXTERNAL | ||
326 | endif | ||
309 | TARGET_XSHLDFLAGS= -dynamiclib -single_module -undefined dynamic_lookup -fPIC | 327 | TARGET_XSHLDFLAGS= -dynamiclib -single_module -undefined dynamic_lookup -fPIC |
310 | TARGET_DYNXLDOPTS= | 328 | TARGET_DYNXLDOPTS= |
311 | TARGET_XSHLDFLAGS+= -install_name $(TARGET_DYLIBPATH) -compatibility_version $(MAJVER).$(MINVER) -current_version $(MAJVER).$(MINVER).$(RELVER) | 329 | TARGET_XSHLDFLAGS+= -install_name $(TARGET_DYLIBPATH) -compatibility_version $(MAJVER).$(MINVER) -current_version $(MAJVER).$(MINVER).$(RELVER) |
312 | ifeq (x64,$(TARGET_LJARCH)) | ||
313 | TARGET_XLDFLAGS+= -pagezero_size 10000 -image_base 100000000 | ||
314 | TARGET_XSHLDFLAGS+= -image_base 7fff04c4a000 | ||
315 | endif | ||
316 | else | 330 | else |
317 | ifeq (iOS,$(TARGET_SYS)) | 331 | ifeq (iOS,$(TARGET_SYS)) |
318 | TARGET_STRIP+= -x | 332 | TARGET_STRIP+= -x |
319 | TARGET_XSHLDFLAGS= -dynamiclib -single_module -undefined dynamic_lookup -fPIC | 333 | TARGET_XSHLDFLAGS= -dynamiclib -single_module -undefined dynamic_lookup -fPIC |
320 | TARGET_DYNXLDOPTS= | 334 | TARGET_DYNXLDOPTS= |
321 | TARGET_XSHLDFLAGS+= -install_name $(TARGET_DYLIBPATH) -compatibility_version $(MAJVER).$(MINVER) -current_version $(MAJVER).$(MINVER).$(RELVER) | 335 | TARGET_XSHLDFLAGS+= -install_name $(TARGET_DYLIBPATH) -compatibility_version $(MAJVER).$(MINVER) -current_version $(MAJVER).$(MINVER).$(RELVER) |
336 | ifeq (arm64,$(TARGET_LJARCH)) | ||
337 | TARGET_XCFLAGS+= -fno-omit-frame-pointer | ||
338 | endif | ||
322 | else | 339 | else |
340 | ifeq (,$(findstring LJ_NO_UNWIND 1,$(TARGET_TESTARCH))) | ||
341 | # Find out whether the target toolchain always generates unwind tables. | ||
342 | TARGET_TESTUNWIND=$(shell exec 2>/dev/null; echo 'extern void b(void);int a(void){b();return 0;}' | $(TARGET_CC) -c -x c - -o tmpunwind.o && { grep -qa -e eh_frame -e __unwind_info tmpunwind.o || grep -qU -e eh_frame -e __unwind_info tmpunwind.o; } && echo E; rm -f tmpunwind.o) | ||
343 | ifneq (,$(findstring E,$(TARGET_TESTUNWIND))) | ||
344 | TARGET_XCFLAGS+= -DLUAJIT_UNWIND_EXTERNAL | ||
345 | endif | ||
346 | endif | ||
323 | ifneq (SunOS,$(TARGET_SYS)) | 347 | ifneq (SunOS,$(TARGET_SYS)) |
324 | ifneq (PS3,$(TARGET_SYS)) | 348 | ifneq (PS3,$(TARGET_SYS)) |
325 | TARGET_XLDFLAGS+= -Wl,-E | 349 | TARGET_XLDFLAGS+= -Wl,-E |
@@ -346,7 +370,7 @@ ifneq ($(HOST_SYS),$(TARGET_SYS)) | |||
346 | HOST_XCFLAGS+= -DLUAJIT_OS=LUAJIT_OS_OSX | 370 | HOST_XCFLAGS+= -DLUAJIT_OS=LUAJIT_OS_OSX |
347 | else | 371 | else |
348 | ifeq (iOS,$(TARGET_SYS)) | 372 | ifeq (iOS,$(TARGET_SYS)) |
349 | HOST_XCFLAGS+= -DLUAJIT_OS=LUAJIT_OS_OSX | 373 | HOST_XCFLAGS+= -DLUAJIT_OS=LUAJIT_OS_OSX -DTARGET_OS_IPHONE=1 |
350 | else | 374 | else |
351 | HOST_XCFLAGS+= -DLUAJIT_OS=LUAJIT_OS_OTHER | 375 | HOST_XCFLAGS+= -DLUAJIT_OS=LUAJIT_OS_OTHER |
352 | endif | 376 | endif |
@@ -379,6 +403,11 @@ DASM_XFLAGS= | |||
379 | DASM_AFLAGS= | 403 | DASM_AFLAGS= |
380 | DASM_ARCH= $(TARGET_LJARCH) | 404 | DASM_ARCH= $(TARGET_LJARCH) |
381 | 405 | ||
406 | ifneq (,$(findstring LJ_LE 1,$(TARGET_TESTARCH))) | ||
407 | DASM_AFLAGS+= -D ENDIAN_LE | ||
408 | else | ||
409 | DASM_AFLAGS+= -D ENDIAN_BE | ||
410 | endif | ||
382 | ifneq (,$(findstring LJ_ARCH_BITS 64,$(TARGET_TESTARCH))) | 411 | ifneq (,$(findstring LJ_ARCH_BITS 64,$(TARGET_TESTARCH))) |
383 | DASM_AFLAGS+= -D P64 | 412 | DASM_AFLAGS+= -D P64 |
384 | endif | 413 | endif |
@@ -411,19 +440,19 @@ DASM_AFLAGS+= -D VER=$(subst LJ_ARCH_VERSION_,,$(filter LJ_ARCH_VERSION_%,$(subs | |||
411 | ifeq (Windows,$(TARGET_SYS)) | 440 | ifeq (Windows,$(TARGET_SYS)) |
412 | DASM_AFLAGS+= -D WIN | 441 | DASM_AFLAGS+= -D WIN |
413 | endif | 442 | endif |
414 | ifeq (x86,$(TARGET_LJARCH)) | ||
415 | ifneq (,$(findstring __SSE2__ 1,$(TARGET_TESTARCH))) | ||
416 | DASM_AFLAGS+= -D SSE | ||
417 | endif | ||
418 | else | ||
419 | ifeq (x64,$(TARGET_LJARCH)) | 443 | ifeq (x64,$(TARGET_LJARCH)) |
420 | DASM_ARCH= x86 | 444 | ifeq (,$(findstring LJ_FR2 1,$(TARGET_TESTARCH))) |
445 | DASM_ARCH= x86 | ||
446 | endif | ||
421 | else | 447 | else |
422 | ifeq (arm,$(TARGET_LJARCH)) | 448 | ifeq (arm,$(TARGET_LJARCH)) |
423 | ifeq (iOS,$(TARGET_SYS)) | 449 | ifeq (iOS,$(TARGET_SYS)) |
424 | DASM_AFLAGS+= -D IOS | 450 | DASM_AFLAGS+= -D IOS |
425 | endif | 451 | endif |
426 | else | 452 | else |
453 | ifneq (,$(findstring LJ_TARGET_MIPSR6 ,$(TARGET_TESTARCH))) | ||
454 | DASM_AFLAGS+= -D MIPSR6 | ||
455 | endif | ||
427 | ifeq (ppc,$(TARGET_LJARCH)) | 456 | ifeq (ppc,$(TARGET_LJARCH)) |
428 | ifneq (,$(findstring LJ_ARCH_SQRT 1,$(TARGET_TESTARCH))) | 457 | ifneq (,$(findstring LJ_ARCH_SQRT 1,$(TARGET_TESTARCH))) |
429 | DASM_AFLAGS+= -D SQRT | 458 | DASM_AFLAGS+= -D SQRT |
@@ -431,7 +460,7 @@ ifeq (ppc,$(TARGET_LJARCH)) | |||
431 | ifneq (,$(findstring LJ_ARCH_ROUND 1,$(TARGET_TESTARCH))) | 460 | ifneq (,$(findstring LJ_ARCH_ROUND 1,$(TARGET_TESTARCH))) |
432 | DASM_AFLAGS+= -D ROUND | 461 | DASM_AFLAGS+= -D ROUND |
433 | endif | 462 | endif |
434 | ifneq (,$(findstring LJ_ARCH_PPC64 1,$(TARGET_TESTARCH))) | 463 | ifneq (,$(findstring LJ_ARCH_PPC32ON64 1,$(TARGET_TESTARCH))) |
435 | DASM_AFLAGS+= -D GPR64 | 464 | DASM_AFLAGS+= -D GPR64 |
436 | endif | 465 | endif |
437 | ifeq (PS3,$(TARGET_SYS)) | 466 | ifeq (PS3,$(TARGET_SYS)) |
@@ -440,7 +469,6 @@ ifeq (ppc,$(TARGET_LJARCH)) | |||
440 | endif | 469 | endif |
441 | endif | 470 | endif |
442 | endif | 471 | endif |
443 | endif | ||
444 | 472 | ||
445 | DASM_FLAGS= $(DASM_XFLAGS) $(DASM_AFLAGS) | 473 | DASM_FLAGS= $(DASM_XFLAGS) $(DASM_AFLAGS) |
446 | DASM_DASC= vm_$(DASM_ARCH).dasc | 474 | DASM_DASC= vm_$(DASM_ARCH).dasc |
@@ -453,19 +481,22 @@ BUILDVM_X= $(BUILDVM_T) | |||
453 | HOST_O= $(MINILUA_O) $(BUILDVM_O) | 481 | HOST_O= $(MINILUA_O) $(BUILDVM_O) |
454 | HOST_T= $(MINILUA_T) $(BUILDVM_T) | 482 | HOST_T= $(MINILUA_T) $(BUILDVM_T) |
455 | 483 | ||
456 | LJVM_S= lj_vm.s | 484 | LJVM_S= lj_vm.S |
457 | LJVM_O= lj_vm.o | 485 | LJVM_O= lj_vm.o |
458 | LJVM_BOUT= $(LJVM_S) | 486 | LJVM_BOUT= $(LJVM_S) |
459 | LJVM_MODE= elfasm | 487 | LJVM_MODE= elfasm |
460 | 488 | ||
461 | LJLIB_O= lib_base.o lib_math.o lib_bit.o lib_string.o lib_table.o \ | 489 | LJLIB_O= lib_base.o lib_math.o lib_bit.o lib_string.o lib_table.o \ |
462 | lib_io.o lib_os.o lib_package.o lib_debug.o lib_jit.o lib_ffi.o | 490 | lib_io.o lib_os.o lib_package.o lib_debug.o lib_jit.o lib_ffi.o \ |
491 | lib_buffer.o | ||
463 | LJLIB_C= $(LJLIB_O:.o=.c) | 492 | LJLIB_C= $(LJLIB_O:.o=.c) |
464 | 493 | ||
465 | LJCORE_O= lj_gc.o lj_err.o lj_char.o lj_bc.o lj_obj.o \ | 494 | LJCORE_O= lj_assert.o lj_gc.o lj_err.o lj_char.o lj_bc.o lj_obj.o lj_buf.o \ |
466 | lj_str.o lj_tab.o lj_func.o lj_udata.o lj_meta.o lj_debug.o \ | 495 | lj_str.o lj_tab.o lj_func.o lj_udata.o lj_meta.o lj_debug.o \ |
467 | lj_state.o lj_dispatch.o lj_vmevent.o lj_vmmath.o lj_strscan.o \ | 496 | lj_prng.o lj_state.o lj_dispatch.o lj_vmevent.o lj_vmmath.o \ |
468 | lj_api.o lj_lex.o lj_parse.o lj_bcread.o lj_bcwrite.o lj_load.o \ | 497 | lj_strscan.o lj_strfmt.o lj_strfmt_num.o lj_serialize.o \ |
498 | lj_api.o lj_profile.o \ | ||
499 | lj_lex.o lj_parse.o lj_bcread.o lj_bcwrite.o lj_load.o \ | ||
469 | lj_ir.o lj_opt_mem.o lj_opt_fold.o lj_opt_narrow.o \ | 500 | lj_ir.o lj_opt_mem.o lj_opt_fold.o lj_opt_narrow.o \ |
470 | lj_opt_dce.o lj_opt_loop.o lj_opt_split.o lj_opt_sink.o \ | 501 | lj_opt_dce.o lj_opt_loop.o lj_opt_split.o lj_opt_sink.o \ |
471 | lj_mcode.o lj_snap.o lj_record.o lj_crecord.o lj_ffrecord.o \ | 502 | lj_mcode.o lj_snap.o lj_record.o lj_crecord.o lj_ffrecord.o \ |
@@ -580,12 +611,15 @@ E= @echo | |||
580 | default all: $(TARGET_T) | 611 | default all: $(TARGET_T) |
581 | 612 | ||
582 | amalg: | 613 | amalg: |
583 | @grep "^[+|]" ljamalg.c | ||
584 | $(MAKE) all "LJCORE_O=ljamalg.o" | 614 | $(MAKE) all "LJCORE_O=ljamalg.o" |
585 | 615 | ||
586 | clean: | 616 | clean: |
587 | $(HOST_RM) $(ALL_RM) | 617 | $(HOST_RM) $(ALL_RM) |
588 | 618 | ||
619 | libbc: | ||
620 | ./$(LUAJIT_T) host/genlibbc.lua -o host/buildvm_libbc.h $(LJLIB_C) | ||
621 | $(MAKE) all | ||
622 | |||
589 | depend: | 623 | depend: |
590 | @for file in $(ALL_HDRGEN); do \ | 624 | @for file in $(ALL_HDRGEN); do \ |
591 | test -f $$file || touch $$file; \ | 625 | test -f $$file || touch $$file; \ |
@@ -600,7 +634,7 @@ depend: | |||
600 | test -s $$file || $(HOST_RM) $$file; \ | 634 | test -s $$file || $(HOST_RM) $$file; \ |
601 | done | 635 | done |
602 | 636 | ||
603 | .PHONY: default all amalg clean depend | 637 | .PHONY: default all amalg clean libbc depend |
604 | 638 | ||
605 | ############################################################################## | 639 | ############################################################################## |
606 | # Rules for generated files. | 640 | # Rules for generated files. |
@@ -610,7 +644,7 @@ $(MINILUA_T): $(MINILUA_O) | |||
610 | $(E) "HOSTLINK $@" | 644 | $(E) "HOSTLINK $@" |
611 | $(Q)$(HOST_CC) $(HOST_ALDFLAGS) -o $@ $(MINILUA_O) $(MINILUA_LIBS) $(HOST_ALIBS) | 645 | $(Q)$(HOST_CC) $(HOST_ALDFLAGS) -o $@ $(MINILUA_O) $(MINILUA_LIBS) $(HOST_ALIBS) |
612 | 646 | ||
613 | host/buildvm_arch.h: $(DASM_DASC) $(DASM_DEP) lj_arch.h lua.h luaconf.h | 647 | host/buildvm_arch.h: $(DASM_DASC) $(DASM_DEP) $(DASM_DIR)/*.lua lj_arch.h lua.h luaconf.h |
614 | $(E) "DYNASM $@" | 648 | $(E) "DYNASM $@" |
615 | $(Q)$(DASM) $(DASM_FLAGS) -o $@ $(DASM_DASC) | 649 | $(Q)$(DASM) $(DASM_FLAGS) -o $@ $(DASM_DASC) |
616 | 650 | ||
@@ -657,10 +691,10 @@ lj_folddef.h: $(BUILDVM_T) lj_opt_fold.c | |||
657 | $(Q)$(TARGET_DYNCC) $(TARGET_ACFLAGS) -c -o $(@:.o=_dyn.o) $< | 691 | $(Q)$(TARGET_DYNCC) $(TARGET_ACFLAGS) -c -o $(@:.o=_dyn.o) $< |
658 | $(Q)$(TARGET_CC) $(TARGET_ACFLAGS) -c -o $@ $< | 692 | $(Q)$(TARGET_CC) $(TARGET_ACFLAGS) -c -o $@ $< |
659 | 693 | ||
660 | %.o: %.s | 694 | %.o: %.S |
661 | $(E) "ASM $@" | 695 | $(E) "ASM $@" |
662 | $(Q)$(TARGET_DYNCC) $(TARGET_ACFLAGS) -c -o $(@:.o=_dyn.o) $< | 696 | $(Q)$(TARGET_DYNCC) $(TARGET_ASFLAGS) -c -o $(@:.o=_dyn.o) $< |
663 | $(Q)$(TARGET_CC) $(TARGET_ACFLAGS) -c -o $@ $< | 697 | $(Q)$(TARGET_CC) $(TARGET_ASFLAGS) -c -o $@ $< |
664 | 698 | ||
665 | $(LUAJIT_O): | 699 | $(LUAJIT_O): |
666 | $(E) "CC $@" | 700 | $(E) "CC $@" |