summaryrefslogtreecommitdiff
path: root/core/src/luajit/makefile
blob: f2a2563bf9d6d81119cdf6b2d9e44b85ea273afe (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
# prefix
include $(PRO_DIR)/prefix.mak

# module name
NAMES 					= luajit

# module type
luajit_TYPE 			= LIB

# config
luajit_CONFIG 			= n

# core files
luajit_C_FILES 			+= \
						luajit/src/lib_aux \
						luajit/src/lib_base \
						luajit/src/lib_bit \
						luajit/src/lib_debug \
						luajit/src/lib_ffi \
						luajit/src/lib_init \
						luajit/src/lib_io \
						luajit/src/lib_jit \
						luajit/src/lib_math \
						luajit/src/lib_os \
						luajit/src/lib_package \
						luajit/src/lib_string \
						luajit/src/lib_table \
						luajit/src/lj_alloc \
						luajit/src/lj_api \
						luajit/src/lj_asm \
						luajit/src/lj_bc \
						luajit/src/lj_bcread \
						luajit/src/lj_bcwrite \
						luajit/src/lj_carith \
						luajit/src/lj_ccall \
						luajit/src/lj_ccallback \
						luajit/src/lj_cconv \
						luajit/src/lj_cdata \
						luajit/src/lj_char \
						luajit/src/lj_clib \
						luajit/src/lj_cparse \
						luajit/src/lj_crecord \
						luajit/src/lj_ctype \
						luajit/src/lj_debug \
						luajit/src/lj_dispatch \
						luajit/src/lj_err \
						luajit/src/lj_ffrecord \
						luajit/src/lj_func \
						luajit/src/lj_gc \
						luajit/src/lj_gdbjit \
						luajit/src/lj_ir \
						luajit/src/lj_lex \
						luajit/src/lj_lib \
						luajit/src/lj_load \
						luajit/src/lj_mcode \
						luajit/src/lj_meta \
						luajit/src/lj_obj \
						luajit/src/lj_opt_dce \
						luajit/src/lj_opt_fold \
						luajit/src/lj_opt_loop \
						luajit/src/lj_opt_mem \
						luajit/src/lj_opt_narrow \
						luajit/src/lj_opt_sink \
						luajit/src/lj_opt_split \
						luajit/src/lj_parse \
						luajit/src/lj_record \
						luajit/src/lj_snap \
						luajit/src/lj_state \
						luajit/src/lj_str \
						luajit/src/lj_strscan \
						luajit/src/lj_tab \
						luajit/src/lj_trace \
						luajit/src/lj_udata \
						luajit/src/lj_vmevent \
						luajit/src/lj_vmmath \
						luajit/src/lj_buf \
						luajit/src/lj_strfmt \
						luajit/src/lj_strfmt_num \
						luajit/src/lj_profile \
						luajit/src/lj_prng

# is windows?
iswin =
ifeq ($(PLAT),windows)
	iswin = yes
endif
ifeq ($(PLAT),msys)
	iswin = yes
endif
ifeq ($(PLAT),mingw)
	iswin = yes
endif
ifeq ($(PLAT),cygwin)
	iswin = yes
endif

# autogen plat and BUILD_ARCH
GENPLAT := $(PLAT)
GENARCH := $(BUILD_ARCH)

# asm files
ifdef iswin
ifeq ($(BUILD_ARCH),x86_64)
GENARCH := x64
endif
ifeq ($(BUILD_ARCH),i386)
GENARCH := x86
endif
GENPLAT := windows
luajit_OBJ_FILES 		+= \
						autogen/$(GENPLAT)/$(luajit_JIT)/$(GENARCH)/lj_vm
else
luajit_ASM_FILES 		+= \
						autogen/$(GENPLAT)/$(luajit_JIT)/$(GENARCH)/lj_vm
endif

# includes
luajit_INC_DIRS 		+= \
						autogen/$(GENPLAT)/$(luajit_JIT)/$(GENARCH)

# disable jit compiler
ifeq ($(luajit_JIT),nojit)
luajit_CXFLAGS 			+= -DLUAJIT_DISABLE_JIT
endif
luajit_CXFLAGS 			+= -Wno-error=unused-function

# using internal memory management under armv7, gc will cause a crash when free strings in lua_close()
ifeq ($(BUILD_ARCH),arm)
luajit_CXFLAGS 			+= -DLUAJIT_USE_SYSMALLOC
endif

# fix call math.sin/log crash for fedora/i386/lj_vm.S with `LDFLAGS = -specs=/usr/lib/rpm/redhat/redhat-hardened-ld` in xmake.spec/%set_build_flags
ifndef iswin
ifeq ($(BUILD_ARCH),i386)
luajit_ASFLAGS 			+= -fPIE
luajit_CXFLAGS 			+= -fPIE
endif
endif

# use given system library?
luajit_C_FILES 			:= $(if $(findstring luajit,$(base_LIBNAMES)),,$(luajit_C_FILES))
luajit_ASM_FILES 		:= $(if $(findstring luajit,$(base_LIBNAMES)),,$(luajit_ASM_FILES))
luajit_INC_FILES 		:= $(if $(findstring luajit,$(base_LIBNAMES)),,$(luajit_INC_FILES))
luajit_OBJ_FILES 		:= $(if $(findstring luajit,$(base_LIBNAMES)),,$(luajit_OBJ_FILES))


# suffix
include $(PRO_DIR)/suffix.mak