Fixed bug in calculation of use/def classes. Still not tested.
[jitcs.git] / makefile
blob6428aef2e5eea85a428f408ccc23ba07dc615dcd
1 CC = g++.bat
2 CFLAGS = -I ./include
3 CFLAGS_DBG32 = -D_DEBUG
4 CFLAGS_REL32 = -D_NDEBUG -O3
5 CFLAGS_DBG64 = -D_DEBUG -m64
6 CFLAGS_REL64 = -D_NDEBUG -O3 -m64
7 LUA = luax51.bat
8 NASM = nasm.bat
9 RM = del
10 SEP = $(subst A,\,A)
11 SRC_SRC = cpu.cpp dumper.cpp tmpalloc.cpp memmgr.cpp \
12 bblock.cpp bblock_impl.cpp function.cpp function_impl.cpp \
13 callingconvention.cpp callingconvention_impl.cpp \
14 host.cpp machine.cpp virtualregister.cpp spillslotinfo.cpp \
15 cfg_analysis.cpp codegenerator.cpp dfg_analysis.cpp
16 SRC_X86 = x86_32_callingconvention.cpp x86_64_callingconvention.cpp \
17 x86_32_machine.cpp x86_64_machine.cpp x86_32_regs.cpp x86_64_regs.cpp \
18 x86_32_insinfo.cpp x86_64_insinfo.cpp x86_32_dumper.cpp x86_64_dumper.cpp \
19 x86_32_codegen.cpp x86_64_codegen.cpp x86_32_ins2reg.cpp x86_64_ins2reg.cpp
20 SRC_UNITTEST = test_unittest.cpp test_main.cpp test_fnctypeinfo.cpp \
21 test_adt_range.cpp test_adt_slice.cpp test_callingconvention.cpp \
22 test_simplefunction.cpp test_adt_bitmap.cpp test_adt_tmpvector.cpp \
23 test_bitfuncs.cpp test_power2funcs.cpp test_cfg_analysis.cpp \
24 test_simplecodegen.cpp test_asm.cpp \
25 test_asm_x86_32_ins.cpp test_asm_x86_32_reg.cpp test_asm_x86_32_ext.cpp \
26 test_asm_x86_64_ins.cpp test_asm_x86_64_reg.cpp test_asm_x86_64_ext.cpp \
27 test_allinstructions.cpp test_dfg_analysis.cpp
28 X86_INS = x86_arith.ins x86_mov_set.ins x86_other.ins x86_other_vex.ins \
29 x86_simd_arith.ins x86_simd_blend.ins x86_simd_cvt.ins \
30 x86_simd_insext.ins x86_simd_mov.ins x86_simd_shuffle.ins\
31 x86_simd_arith_vex.ins x86_simd_blend_vex.ins x86_simd_cvt_vex.ins \
32 x86_simd_insext_vex.ins x86_simd_mov_vex.ins x86_simd_shuffle_vex.ins \
33 x86_cf.ins x86_addrmode.ins
34 PREFIXES_LIBSRC = dbg32_ rel32_ dbg64_ rel64_
35 PREFIXES_TESTSRC = test32_ test64_ testd32_ testd64_
36 OBJDIR = _objs
37 LIBDIR = _lib
38 BINDIR = _bin
39 BINDATADIR = _bin/data
40 TEST_NAMES = $(patsubst %.cpp,%.o,$(SRC_SRC))
41 LIBOBJ_NAMES = $(addprefix src_,$(patsubst %.cpp,%.o,$(SRC_SRC))) \
42 $(addprefix x86_,$(patsubst %.cpp,%.o,$(SRC_X86)))
43 LIBOBJS_DEBUG32 = $(addprefix $(OBJDIR)/dbg32_,$(LIBOBJ_NAMES))
44 LIBOBJS_RELEASE32 = $(addprefix $(OBJDIR)/rel32_,$(LIBOBJ_NAMES))
45 LIBOBJS_DEBUG64 = $(addprefix $(OBJDIR)/dbg64_,$(LIBOBJ_NAMES))
46 LIBOBJS_RELEASE64 = $(addprefix $(OBJDIR)/rel64_,$(LIBOBJ_NAMES))
47 UNITTESTOBJS_DEBUG32 = $(addprefix $(OBJDIR)/testd32_,$(patsubst test_%.cpp,%.o,$(SRC_UNITTEST)))
48 UNITTESTOBJS_DEBUG64 = $(addprefix $(OBJDIR)/testd64_,$(patsubst test_%.cpp,%.o,$(SRC_UNITTEST)))
49 UNITTESTOBJS_RELEASE32 = $(addprefix $(OBJDIR)/test32_,$(patsubst test_%.cpp,%.o,$(SRC_UNITTEST)))
50 UNITTESTOBJS_RELEASE64 = $(addprefix $(OBJDIR)/test64_,$(patsubst test_%.cpp,%.o,$(SRC_UNITTEST)))
51 OBJPREFIX_SRC = $(addprefix $(OBJDIR)/,$(addsuffix src_,$(PREFIXES_LIBSRC)))
52 OBJPREFIX_X86 = $(addprefix $(OBJDIR)/,$(addsuffix x86_,$(PREFIXES_LIBSRC)))
53 OBJPREFIX_TEST = $(addprefix $(OBJDIR)/,$(PREFIXES_TESTSRC))
54 AS32_FILES = $(addprefix $(BINDATADIR)/,$(patsubst x86_%.ins,x86_32_%.as,$(X86_INS)))
55 AS64_FILES = $(addprefix $(BINDATADIR)/,$(patsubst x86_%.ins,x86_64_%.as,$(X86_INS)))
57 #all : debug release tests
58 all : lua debug tests
59 clean:
60 $(RM) $(subst /,$(SEP),_objs/*)
61 $(RM) $(subst /,$(SEP),_lib/*)
62 $(RM) $(subst /,$(SEP),_bin/*)
63 info:
64 rem info
65 debug : $(LIBDIR)/jitcs_debug32.a $(LIBDIR)/jitcs_debug64.a
67 release : $(LIBDIR)/jitcs_release32.a $(LIBDIR)/jitcs_release64.a
68 tests : $(BINDIR)/test_cpuinfo32.exe $(BINDIR)/test_cpuinfo64.exe \
69 $(AS32_FILES) $(AS64_FILES) \
70 $(BINDIR)/unittestsd32.exe $(BINDIR)/unittestsd64.exe \
71 $(BINDIR)/unittests32.exe $(BINDIR)/unittests64.exe
73 lua : include/jitcs_x86_32_cons.h include/jitcs_x86_64_cons.h \
74 include/jitcs_x86_32_insids.h include/jitcs_x86_64_insids.h \
75 include/jitcs_x86_32_regs.h include/jitcs_x86_64_regs.h \
76 include/jitcs_x86_32_machine.h include/jitcs_x86_64_machine.h \
77 src/x86/jitcs_int_x86_32_machine.h src/x86/jitcs_int_x86_64_machine.h \
78 src/x86/jitcs_int_x86_32_dumper.h src/x86/jitcs_int_x86_64_dumper.h \
79 src/x86/jitcs_int_x86_32_regs.h src/x86/jitcs_int_x86_64_regs.h \
80 src/x86/src/x86_32_callingconvention.cpp src/x86/src/x86_64_callingconvention.cpp \
81 src/x86/src/x86_32_codegen.cpp src/x86/src/x86_64_codegen.cpp \
82 src/x86/src/x86_32_dumper.cpp src/x86/src/x86_64_dumper.cpp \
83 src/x86/src/x86_32_ins2reg.cpp src/x86/src/x86_64_ins2reg.cpp \
84 src/x86/src/x86_32_insinfo.cpp src/x86/src/x86_64_insinfo.cpp \
85 src/x86/src/x86_32_machine.cpp src/x86/src/x86_64_machine.cpp \
86 src/x86/src/x86_32_regs.cpp src/x86/src/x86_64_regs.cpp
88 include/jitcs_x86_32_cons.h : include/jitcs_x86_xx_cons.lh \
89 src/data/x86_inslist.dat src/data/x86_insalias.dat \
90 tools/template2source.lua
91 $(LUA) tools/template2source.lua $< 32 $@
92 include/jitcs_x86_64_cons.h : include/jitcs_x86_xx_cons.lh \
93 src/data/x86_inslist.dat src/data/x86_insalias.dat \
94 tools/template2source.lua
95 $(LUA) tools/template2source.lua $< 64 $@
96 include/jitcs_x86_32_insids.h : include/jitcs_x86_xx_insids.lh \
97 src/data/x86_inslist.dat src/data/x86_insalias.dat \
98 tools/template2source.lua
99 $(LUA) tools/template2source.lua $< 32 $@
100 include/jitcs_x86_64_insids.h : include/jitcs_x86_xx_insids.lh \
101 src/data/x86_inslist.dat src/data/x86_insalias.dat \
102 tools/template2source.lua
103 $(LUA) tools/template2source.lua $< 64 $@
104 include/jitcs_x86_32_regs.h : include/jitcs_x86_xx_regs.lh src/data/x86_reglist.dat \
105 tools/template2source.lua
106 $(LUA) tools/template2source.lua $< 32 $@
107 include/jitcs_x86_64_regs.h : include/jitcs_x86_xx_regs.lh src/data/x86_reglist.dat \
108 tools/template2source.lua
109 $(LUA) tools/template2source.lua $< 64 $@
110 include/jitcs_x86_32_machine.h : include/jitcs_x86_xx_machine.lh \
111 tools/template2source.lua
112 $(LUA) tools/template2source.lua $< 32 $@
113 include/jitcs_x86_64_machine.h : include/jitcs_x86_xx_machine.lh \
114 tools/template2source.lua
115 $(LUA) tools/template2source.lua $< 64 $@
116 src/x86/jitcs_int_x86_32_machine.h : src/x86/jitcs_int_x86_xx_machine.lh \
117 tools/template2source.lua
118 $(LUA) tools/template2source.lua $< 32 $@
119 src/x86/jitcs_int_x86_64_machine.h : src/x86/jitcs_int_x86_xx_machine.lh \
120 tools/template2source.lua
121 $(LUA) tools/template2source.lua $< 64 $@
122 src/x86/jitcs_int_x86_32_regs.h : src/x86/jitcs_int_x86_xx_regs.lh src/data/x86_reglist.dat \
123 tools/template2source.lua
124 $(LUA) tools/template2source.lua $< 32 $@
125 src/x86/jitcs_int_x86_64_regs.h : src/x86/jitcs_int_x86_xx_regs.lh src/data/x86_reglist.dat \
126 tools/template2source.lua
127 $(LUA) tools/template2source.lua $< 64 $@
128 src/x86/jitcs_int_x86_32_dumper.h : src/x86/jitcs_int_x86_xx_dumper.lh \
129 tools/template2source.lua
130 $(LUA) tools/template2source.lua $< 32 $@
131 src/x86/jitcs_int_x86_64_dumper.h : src/x86/jitcs_int_x86_xx_dumper.lh \
132 tools/template2source.lua
133 $(LUA) tools/template2source.lua $< 64 $@
134 src/x86/src/x86_32_callingconvention.cpp : src/x86/src/x86_xx_callingconvention.lcpp \
135 src/data/x86_reglist.dat \
136 tools/template2source.lua
137 $(LUA) tools/template2source.lua $< 32 $@
138 src/x86/src/x86_64_callingconvention.cpp : src/x86/src/x86_xx_callingconvention.lcpp \
139 src/data/x86_reglist.dat \
140 tools/template2source.lua
141 $(LUA) tools/template2source.lua $< 64 $@
142 src/x86/src/x86_32_machine.cpp : src/x86/src/x86_xx_machine.lcpp src/data/x86_reglist.dat \
143 tools/template2source.lua
144 $(LUA) tools/template2source.lua $< 32 $@
145 src/x86/src/x86_64_machine.cpp : src/x86/src/x86_xx_machine.lcpp src/data/x86_reglist.dat \
146 tools/template2source.lua
147 $(LUA) tools/template2source.lua $< 64 $@
148 src/x86/src/x86_32_regs.cpp : src/x86/src/x86_xx_regs.lcpp src/data/x86_reglist.dat \
149 tools/template2source.lua
150 $(LUA) tools/template2source.lua $< 32 $@
151 src/x86/src/x86_64_regs.cpp : src/x86/src/x86_xx_regs.lcpp src/data/x86_reglist.dat \
152 tools/template2source.lua
153 $(LUA) tools/template2source.lua $< 64 $@
154 src/x86/src/x86_32_insinfo.cpp : src/x86/src/x86_xx_insinfo.lcpp src/data/x86_reglist.dat \
155 tools/template2source.lua src/data/x86_inslist.dat
156 $(LUA) tools/template2source.lua $< 32 $@
157 src/x86/src/x86_64_insinfo.cpp : src/x86/src/x86_xx_insinfo.lcpp src/data/x86_reglist.dat \
158 tools/template2source.lua src/data/x86_inslist.dat
159 $(LUA) tools/template2source.lua $< 64 $@
160 src/x86/src/x86_32_dumper.cpp : src/x86/src/x86_xx_dumper.lcpp src/data/x86_reglist.dat \
161 tools/template2source.lua src/data/x86_inslist.dat
162 $(LUA) tools/template2source.lua $< 32 $@
163 src/x86/src/x86_64_dumper.cpp : src/x86/src/x86_xx_dumper.lcpp src/data/x86_reglist.dat \
164 tools/template2source.lua src/data/x86_inslist.dat
165 $(LUA) tools/template2source.lua $< 64 $@
166 src/x86/src/x86_32_codegen.cpp : src/x86/src/x86_xx_codegen.lcpp src/data/x86_inslist.dat \
167 tools/template2source.lua
168 $(LUA) tools/template2source.lua $< 32 $@
169 src/x86/src/x86_64_codegen.cpp : src/x86/src/x86_xx_codegen.lcpp src/data/x86_inslist.dat \
170 tools/template2source.lua
171 $(LUA) tools/template2source.lua $< 64 $@
172 src/x86/src/x86_32_ins2reg.cpp : src/x86/src/x86_xx_ins2reg.lcpp src/data/x86_reglist.dat \
173 tools/template2source.lua src/data/x86_inslist.dat
174 $(LUA) tools/template2source.lua $< 32 $@
175 src/x86/src/x86_64_ins2reg.cpp : src/x86/src/x86_xx_ins2reg.lcpp src/data/x86_reglist.dat \
176 tools/template2source.lua src/data/x86_inslist.dat
177 $(LUA) tools/template2source.lua $< 64 $@
179 tests/test_asm_x86_32.h : tests/test_asm_x86_xx.lh \
180 tools/template2source.lua
181 $(LUA) tools/template2source.lua $< 32 $@
182 tests/test_asm_x86_64.h : tests/test_asm_x86_xx.lh \
183 tools/template2source.lua
184 $(LUA) tools/template2source.lua $< 64 $@
185 tests/test_asm_x86_32_reg.cpp : tests/test_asm_x86_xx_reg.lcpp \
186 src/data/x86_reglist.dat \
187 tools/template2source.lua
188 $(LUA) tools/template2source.lua $< 32 $@
189 tests/test_asm_x86_64_reg.cpp : tests/test_asm_x86_xx_reg.lcpp \
190 src/data/x86_reglist.dat \
191 tools/template2source.lua
192 $(LUA) tools/template2source.lua $< 64 $@
193 tests/test_asm_x86_32_ins.cpp : tests/test_asm_x86_xx_ins.lcpp \
194 src/data/x86_inslist.dat src/data/x86_reglist.dat \
195 src/data/x86_insalias.dat \
196 tools/template2source.lua
197 $(LUA) tools/template2source.lua $< 32 $@
198 tests/test_asm_x86_64_ins.cpp : tests/test_asm_x86_xx_ins.lcpp \
199 src/data/x86_inslist.dat src/data/x86_reglist.dat \
200 src/data/x86_insalias.dat \
201 tools/template2source.lua
202 $(LUA) tools/template2source.lua $< 64 $@
203 tests/test_asm_x86_32_ext.cpp : tests/test_asm_x86_xx_ext.lcpp \
204 tools/template2source.lua
205 $(LUA) tools/template2source.lua $< 32 $@
206 tests/test_asm_x86_64_ext.cpp : tests/test_asm_x86_xx_ext.lcpp \
207 tools/template2source.lua
208 $(LUA) tools/template2source.lua $< 64 $@
211 src/data/x86_inslist.dat : src/data/x86_inslist.ltxt tools/x86_inslist2data.lua
212 $(LUA) tools/x86_inslist2data.lua $< $@
213 src/data/x86_insalias.dat : src/data/x86_insalias.ltxt tools/x86_insalias2data.lua
214 $(LUA) tools/x86_insalias2data.lua $< $@
216 $(LIBDIR)/jitcs_debug32.a : $(LIBOBJS_DEBUG32) | $(LIBDIR)
217 ar r $@ $?
218 $(LIBDIR)/jitcs_release32.a : $(LIBOBJS_RELEASE32) | $(LIBDIR)
219 ar r $@ $?
220 $(LIBDIR)/jitcs_debug64.a : | $(LIBDIR)
221 rem --
222 $(LIBDIR)/jitcs_release64.a : | $(LIBDIR)
223 rem --
225 $(BINDIR)/test_cpuinfo32.exe : tests/cpuinfo.cpp $(LIBDIR)/jitcs_release32.a \
226 include/jitcs_cpu.h \
227 | $(BINDIR)
228 $(CC) -o $@ $(CFLAGS) $(CFLAGS_REL32) $< $(LIBDIR)/jitcs_release32.a
229 $(BINDIR)/test_cpuinfo64.exe : | $(BINDIR)
230 rem --
231 $(BINDIR)/unittests32.exe : $(UNITTESTOBJS_RELEASE32) $(LIBDIR)/jitcs_release32.a \
232 | $(BINDIR) $(BINDATADIR)
233 $(CC) -o $@ $(CFLAGS) $(CFLAGS_REL32) $(UNITTESTOBJS_RELEASE32) $(LIBDIR)/jitcs_release32.a
234 $(BINDIR)/unittestsd32.exe : $(UNITTESTOBJS_DEBUG32) $(LIBDIR)/jitcs_debug32.a \
235 | $(BINDIR) $(BINDATADIR)
236 $(CC) -o $@ $(CFLAGS) $(CFLAGS_DBG32) $(UNITTESTOBJS_DEBUG32) $(LIBDIR)/jitcs_debug32.a
237 $(BINDIR)/unittests64.exe : | $(BINDIR) $(BINDATADIR)
238 rem --
239 $(BINDIR)/unittestsd64.exe : | $(BINDIR) $(BINDATADIR)
240 rem --
242 $(addsuffix cpu.o, $(OBJPREFIX_SRC)): \
243 include/jitcs_base.h include/jitcs_cpu.h \
244 include/jitcs_adt_bitstore.h
245 $(OBJDIR)/dbg32_src_bblock.o $(OBJDIR)/rel32_src_bblock.o \
246 $(OBJDIR)/dbg64_src_bblock.o $(OBJDIR)/rel64_src_bblock.o: \
247 include/jitcs_base.h include/jitcs_bblock.h \
248 src/jitcs_int_bblock_impl.h
249 $(OBJDIR)/dbg32_src_bblock_impl.o $(OBJDIR)/rel32_src_bblock_impl.o \
250 $(OBJDIR)/dbg64_src_bblock_impl.o $(OBJDIR)/rel64_src_bblock_impl.o: \
251 include/jitcs_base.h include/jitcs_dumper.h \
252 src/jitcs_int_bblock_impl.h src/jitcs_int_function_impl.h
253 $(OBJDIR)/dbg32_src_function.o $(OBJDIR)/rel32_src_function.o \
254 $(OBJDIR)/dbg64_src_function.o $(OBJDIR)/rel64_src_function.o: \
255 include/jitcs_base.h include/jitcs_function.h \
256 src/jitcs_int_function_impl.h
257 $(OBJDIR)/dbg32_src_function_impl.o $(OBJDIR)/rel32_src_function_impl.o \
258 $(OBJDIR)/dbg64_src_function_impl.o $(OBJDIR)/rel64_src_function_impl.o: \
259 include/jitcs_base.h include/jitcs_dumper.h \
260 src/jitcs_int_function_impl.h src/jitcs_int_bblock_impl.h
261 $(OBJDIR)/dbg32_src_callingconvention.o $(OBJDIR)/rel32_src_callingconvention.o \
262 $(OBJDIR)/dbg64_src_callingconvention.o $(OBJDIR)/rel64_src_callingconvention.o: \
263 include/jitcs_base.h include/jitcs_callingconvention.h \
264 include/jitcs_dumper.h
265 $(OBJDIR)/dbg32_src_callingconvention_impl.o $(OBJDIR)/rel32_src_callingconvention_impl.o \
266 $(OBJDIR)/dbg64_src_callingconvention_impl.o $(OBJDIR)/rel64_src_callingconvention_impl.o: \
267 include/jitcs_base.h \
268 src/jitcs_int_callingconvention_impl.h
269 $(OBJDIR)/dbg32_src_memmgr.o $(OBJDIR)/rel32_src_memmgr.o \
270 $(OBJDIR)/dbg64_src_memmgr.o $(OBJDIR)/rel64_src_memmgr.o: \
271 include/jitcs_base.h \
272 include/jitcs_memmgr.h include/jitcs_cpu.h
273 $(OBJDIR)/dbg32_src_spillslotinfo.o $(OBJDIR)/rel32_src_spillslotinfo.o \
274 $(OBJDIR)/dbg64_src_spillslotinfo.o $(OBJDIR)/rel64_src_spillslotinfo.o: \
275 include/jitcs_base.h \
276 include/jitcs_spillslotinfo.h include/jitcs_dumper.h
277 $(OBJDIR)/dbg32_src_tmpalloc.o $(OBJDIR)/rel32_src_tmpalloc.o \
278 $(OBJDIR)/dbg64_src_tmpalloc.o $(OBJDIR)/rel64_src_tmpalloc.o: \
279 include/jitcs_base.h \
280 include/jitcs_tmpalloc.h
281 $(addsuffix dumper.o, $(OBJPREFIX_SRC)): \
282 include/jitcs_machine.h \
283 src/x86/jitcs_int_x86_32_dumper.h src/x86/jitcs_int_x86_64_dumper.h
284 $(addsuffix virtualregister.o, $(OBJPREFIX_SRC)): \
285 include/jitcs_machine.h src/jitcs_int_virtualregister.h
286 $(addsuffix cfg_analysis.o, $(OBJPREFIX_SRC)): \
287 src/jitcs_int_cfg_analysis.h
288 $(addsuffix x86_32_callingconvention.o, $(OBJPREFIX_X86)): \
289 src/x86/jitcs_int_x86_32_machine.h src/x86/jitcs_int_x86_32_regs.h
290 $(addsuffix x86_64_callingconvention.o, $(OBJPREFIX_X86)): \
291 src/x86/jitcs_int_x86_64_machine.h src/x86/jitcs_int_x86_64_regs.h
292 $(addsuffix x86_32_machine.o, $(OBJPREFIX_X86)): \
293 src/x86/jitcs_int_x86_32_machine.h src/x86/jitcs_int_x86_32_regs.h \
294 include/jitcs_x86_32_machine.h src/jitcs_int_machine.h
295 $(addsuffix x86_64_machine.o, $(OBJPREFIX_X86)): \
296 src/x86/jitcs_int_x86_64_machine.h src/x86/jitcs_int_x86_64_regs.h \
297 include/jitcs_x86_64_machine.h src/jitcs_int_machine.h
298 $(addsuffix x86_32_regs.o, $(OBJPREFIX_X86)): \
299 src/x86/jitcs_int_x86_32_regs.h
300 $(addsuffix x86_64_regs.o, $(OBJPREFIX_X86)): \
301 src/x86/jitcs_int_x86_64_regs.h
302 $(addsuffix x86_32_insinfo.o, $(OBJPREFIX_X86)): \
303 include/jitcs_x86_32_insids.h
304 $(addsuffix x86_64_insinfo.o, $(OBJPREFIX_X86)): \
305 include/jitcs_x86_64_insids.h
306 $(addsuffix x86_32_dumper.o, $(OBJPREFIX_X86)): \
307 src/x86/jitcs_int_x86_32_dumper.h
308 $(addsuffix x86_64_dumper.o, $(OBJPREFIX_X86)): \
309 src/x86/jitcs_int_x86_64_dumper.h
310 $(addsuffix x86_32_ins2reg.o, $(OBJPREFIX_X86)): \
311 include/jitcs_x86_32_machine.h
312 $(addsuffix x86_64_ins2reg.o, $(OBJPREFIX_X86)): \
313 include/jitcs_x86_64_machine.h
316 $(addsuffix main.o, $(OBJPREFIX_TEST)): \
317 include/jitcs_base.h tests/unittest.h
318 $(addsuffix unittest.o, $(OBJPREFIX_TEST)): \
319 include/jitcs_base.h tests/unittest.h
320 $(addsuffix fnctypeinfo.o, $(OBJPREFIX_TEST)): \
321 include/jitcs_base.h include/jitcs_fnctypeinfo.h
322 $(addsuffix adt_range.o, $(OBJPREFIX_TEST)): \
323 include/jitcs_base.h include/jitcs_adt_range.h
324 $(addsuffix adt_slice.o, $(OBJPREFIX_TEST)): \
325 include/jitcs_base.h include/jitcs_adt_slice.h
326 $(addsuffix callingconvention.o, $(OBJPREFIX_TEST)): \
327 include/jitcs_base.h include/jitcs_callingconvention.h \
328 src/x86/jitcs_int_x86_32_machine.h src/x86/jitcs_int_x86_64_machine.h
329 $(addsuffix simplefunction.o, $(OBJPREFIX_TEST)): \
330 include/jitcs_base.h include/jitcs_callingconvention.h \
331 include/jitcs_instructionstream.h include/jitcs.h
332 $(addsuffix adt_array.o, $(OBJPREFIX_TEST)): \
333 include/jitcs_base.h src/jitcs_int_adt_array.h
334 $(addsuffix adt_bitmap.o, $(OBJPREFIX_TEST)): \
335 include/jitcs_base.h src/jitcs_int_adt_bitmap.h
336 $(addsuffix adt_tmpvector.o, $(OBJPREFIX_TEST)): \
337 include/jitcs_base.h src/jitcs_int_adt_tmpvector.h
338 $(addsuffix bitfuncs.o, $(OBJPREFIX_TEST)): \
339 include/jitcs_base.h src/jitcs_int_bitfuncs.h
340 $(addsuffix power2funcs.o, $(OBJPREFIX_TEST)): \
341 include/jitcs_base.h src/jitcs_int_power2funcs.h
342 $(addsuffix asm.o, $(OBJPREFIX_TEST)): \
343 tests/test_asm.h
344 $(addsuffix asm_x86_32.o, $(OBJPREFIX_TEST)): \
345 tests/test_asm.h tests/test_asm_x86_32.h
346 $(addsuffix asm_x86_64.o, $(OBJPREFIX_TEST)): \
347 tests/test_asm.h tests/test_asm_x86_64.h
349 $(OBJDIR)/dbg32_src_%.o : src/src/%.cpp
350 $(CC) -o $@ -c -I ./src $(CFLAGS) $(CFLAGS_DBG32) $<
351 $(OBJDIR)/rel32_src_%.o : src/src/%.cpp
352 $(CC) -o $@ -c -I ./src $(CFLAGS) $(CFLAGS_REL32) $<
353 $(OBJDIR)/dbg64_src_%.o : src/src/%.cpp
354 $(CC) -o $@ -c -I ./src $(CFLAGS) $(CFLAGS_DBG64) $<
355 $(OBJDIR)/rel64_src_%.o : src/src/%.cpp
356 $(CC) -o $@ -c -I ./src $(CFLAGS) $(CFLAGS_REL64) $<
357 $(OBJDIR)/dbg32_x86_%.o : src/x86/src/%.cpp
358 $(CC) -o $@ -c -I ./src $(CFLAGS) $(CFLAGS_DBG32) $<
359 $(OBJDIR)/rel32_x86_%.o : src/x86/src/%.cpp
360 $(CC) -o $@ -c -I ./src $(CFLAGS) $(CFLAGS_REL32) $<
361 $(OBJDIR)/dbg64_x86_%.o : src/x86/src/%.cpp
362 $(CC) -o $@ -c -I ./src $(CFLAGS) $(CFLAGS_DBG64) $<
363 $(OBJDIR)/rel64_x86_%.o : src/x86/src/%.cpp
364 $(CC) -o $@ -c -I ./src $(CFLAGS) $(CFLAGS_REL64) $<
365 $(OBJDIR)/test32_%.o : tests/test_%.cpp
366 $(CC) -o $@ -c -I ./tests -I ./src $(CFLAGS) $(CFLAGS_REL32) $<
367 $(OBJDIR)/testd32_%.o : tests/test_%.cpp
368 $(CC) -o $@ -c -I ./tests -I ./src $(CFLAGS) $(CFLAGS_DBG32) $<
369 $(OBJDIR)/test64_%.o : tests/test_%.cpp
370 $(CC) -o $@ -c -I ./tests -I ./src $(CFLAGS) $(CFLAGS_REL64) $<
371 $(OBJDIR)/testd64_%.o : tests/test_%.cpp
372 $(CC) -o $@ -c -I ./tests -I ./src $(CFLAGS) $(CFLAGS_DBG64) $<
374 $(BINDATADIR)/x86_32_%.as : tests/x86/x86_%.ins tools/x86_instool.lua
375 $(LUA) tools/x86_instool.lua ins2nasm32 $< $(OBJDIR)/n32_$*.nasm
376 $(NASM) -o $(OBJDIR)/n32_$*.bin -l $(OBJDIR)/n32_$*.lst $(OBJDIR)/n32_$*.nasm
377 $(LUA) tools/x86_instool.lua nasm2as32 $< $(OBJDIR)/n32_$*.lst $@
378 $(BINDATADIR)/x86_64_%.as : tests/x86/x86_%.ins tools/x86_instool.lua
379 $(LUA) tools/x86_instool.lua ins2nasm64 $< $(OBJDIR)/n64_$*.nasm
380 $(NASM) -o $(OBJDIR)/n64_$*.bin -l $(OBJDIR)/n64_$*.lst $(OBJDIR)/n64_$*.nasm
381 $(LUA) tools/x86_instool.lua nasm2as64 $< $(OBJDIR)/n64_$*.lst $@
383 $(LIBOBJS_DEBUG32) $(LIBOBJS_RELEASE32) \
384 $(LIBOBJS_DEBUG64) $(LIBOBJS_RELEASE64) \
385 $(UNITTESTOBJS_RELEASE32) : | $(OBJDIR)
386 $(BINDATADIR): | $(BINDIR)
387 $(OBJDIR) $(LIBDIR) $(BINDIR) $(BINDATADIR):
388 mkdir $(subst /,$(SEP),$@)