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