Debian Codegraph @

bindings/ocaml/Makefile

raw symbols SCIP
1 # Capstone Disassembler Engine
2 # By Nguyen Anh Quynh <[email protected]>, 2013-2015
3
4 LIB = capstone
5 FLAGS = '-Wall -Wextra -Wwrite-strings'
6 PYTHON2 ?= python
7
8 all: arm_const.cmxa arm64_const.cmxa m680x_const.cmxa mips_const.cmxa ppc_const.cmxa sparc_const.cmxa sysz_const.cmxa x86_const.cmxa xcore_const.cmxa arm.cmxa arm64.cmxa m680x.cmxa mips.cmxa ppc.cmxa x86.cmxa sparc.cmxa systemz.cmxa xcore.cmxa capstone.cmxa test_basic.cmx test_detail.cmx test_x86.cmx test_arm.cmx test_arm64.cmx test_mips.cmx test_ppc.cmx test_sparc.cmx test_systemz.cmx test_xcore.cmx test_m680x.cmx ocaml.o
9 ocamlopt -o test_basic -ccopt $(FLAGS) ocaml.o capstone.cmx test_basic.cmx -cclib -l$(LIB)
10 ocamlopt -o test_detail -ccopt $(FLAGS) capstone.cmx ocaml.o test_detail.cmx -cclib -l$(LIB)
11 ocamlopt -o test_x86 -ccopt $(FLAGS) capstone.cmx ocaml.o x86.cmx x86_const.cmx test_x86.cmx -cclib -l$(LIB)
12 ocamlopt -o test_arm -ccopt $(FLAGS) capstone.cmx ocaml.o arm.cmx arm_const.cmx test_arm.cmx -cclib -l$(LIB)
13 ocamlopt -o test_arm64 -ccopt $(FLAGS) capstone.cmx ocaml.o arm64.cmx arm64_const.cmx test_arm64.cmx -cclib -l$(LIB)
14 ocamlopt -o test_mips -ccopt $(FLAGS) capstone.cmx ocaml.o mips.cmx mips_const.cmx test_mips.cmx -cclib -l$(LIB)
15 ocamlopt -o test_ppc -ccopt $(FLAGS) capstone.cmx ocaml.o ppc.cmx ppc_const.cmx test_ppc.cmx -cclib -l$(LIB)
16 ocamlopt -o test_sparc -ccopt $(FLAGS) capstone.cmx ocaml.o sparc.cmx sparc_const.cmx test_sparc.cmx -cclib -l$(LIB)
17 ocamlopt -o test_systemz -ccopt $(FLAGS) capstone.cmx ocaml.o systemz.cmx sysz_const.cmx test_systemz.cmx -cclib -l$(LIB)
18 ocamlopt -o test_xcore -ccopt $(FLAGS) capstone.cmx ocaml.o xcore.cmx xcore_const.cmx test_xcore.cmx -cclib -l$(LIB)
19 ocamlopt -o test_m680x -ccopt $(FLAGS) capstone.cmx ocaml.o m680x.cmx m680x_const.cmx test_m680x.cmx -cclib -l$(LIB)
20
21
22 test_basic.cmx: test_basic.ml
23 ocamlopt -ccopt $(FLAGS) -c $< -cclib -l$(LIB)
24
25 test_detail.cmx: test_detail.ml
26 ocamlopt -ccopt $(FLAGS) -c $< -cclib -l$(LIB)
27
28 test_x86.cmx: test_x86.ml
29 ocamlopt -ccopt $(FLAGS) -c $< -cclib -l$(LIB)
30
31 test_arm.cmx: test_arm.ml
32 ocamlopt -ccopt $(FLAGS) -c $< -cclib -l$(LIB)
33
34 test_arm64.cmx: test_arm64.ml
35 ocamlopt -ccopt $(FLAGS) -c $< -cclib -l$(LIB)
36
37 test_mips.cmx: test_mips.ml
38 ocamlopt -ccopt $(FLAGS) -c $< -cclib -l$(LIB)
39
40 test_ppc.cmx: test_ppc.ml
41 ocamlopt -ccopt $(FLAGS) -c $< -cclib -l$(LIB)
42
43 test_sparc.cmx: test_sparc.ml
44 ocamlopt -ccopt $(FLAGS) -c $< -cclib -l$(LIB)
45
46 test_systemz.cmx: test_systemz.ml
47 ocamlopt -ccopt $(FLAGS) -c $< -cclib -l$(LIB)
48
49 test_xcore.cmx: test_xcore.ml
50 ocamlopt -ccopt $(FLAGS) -c $< -cclib -l$(LIB)
51
52 test_m680x.cmx: test_m680x.ml
53 ocamlopt -ccopt $(FLAGS) -c $< -cclib -l$(LIB)
54
55 ocaml.o: ocaml.c
56 ocamlc -ccopt $(FLAGS) -c $<
57
58 capstone.mli: capstone.ml
59 ocamlc -ccopt $(FLAGS) -i $< > $@
60
61 capstone.cmi: capstone.mli
62 ocamlc -ccopt $(FLAGS) -c $<
63
64 capstone.cmx: capstone.ml capstone.cmi
65 ocamlopt -ccopt $(FLAGS) -c $< -cclib -l$(LIB)
66
67 capstone.cmxa: capstone.cmx
68 ocamlopt -ccopt $(FLAGS) -a -o $@ $< -cclib -lsb_ocaml -cclib -l$(LIB)
69
70 x86.mli: x86.ml
71 ocamlc -ccopt $(FLAGS) -i $< > $@
72
73 x86.cmi: x86.mli
74 ocamlc -ccopt $(FLAGS) -c $<
75
76 x86.cmx: x86.ml x86.cmi
77 ocamlopt -ccopt $(FLAGS) -c $<
78
79 x86.cmxa: x86.cmx
80 ocamlopt -ccopt $(FLAGS) -a -o $@ $<
81
82 x86_const.mli: x86_const.ml
83 ocamlc -ccopt $(FLAGS) -i $< > $@
84
85 x86_const.cmi: x86_const.mli
86 ocamlc -ccopt $(FLAGS) -c $<
87
88 x86_const.cmx: x86_const.ml x86_const.cmi
89 ocamlopt -ccopt $(FLAGS) -c $<
90
91 x86_const.cmxa: x86_const.cmx
92 ocamlopt -ccopt $(FLAGS) -a -o $@ $<
93
94 arm.mli: arm.ml
95 ocamlc -ccopt $(FLAGS) -i $< > $@
96
97 arm.cmi: arm.mli
98 ocamlc -ccopt $(FLAGS) -c $<
99
100 arm.cmx: arm.ml arm.cmi
101 ocamlopt -ccopt $(FLAGS) -c $<
102
103 arm.cmxa: arm.cmx
104 ocamlopt -ccopt $(FLAGS) -a -o $@ $<
105
106 arm_const.mli: arm_const.ml
107 ocamlc -ccopt $(FLAGS) -i $< > $@
108
109 arm_const.cmi: arm_const.mli
110 ocamlc -ccopt $(FLAGS) -c $<
111
112 arm_const.cmx: arm_const.ml arm_const.cmi
113 ocamlopt -ccopt $(FLAGS) -c $<
114
115 arm_const.cmxa: arm_const.cmx
116 ocamlopt -ccopt $(FLAGS) -a -o $@ $<
117
118 arm64.mli: arm64.ml
119 ocamlc -ccopt $(FLAGS) -i $< > $@
120
121 arm64.cmi: arm64.mli
122 ocamlc -ccopt $(FLAGS) -c $<
123
124 arm64.cmx: arm64.ml arm64.cmi
125 ocamlopt -ccopt $(FLAGS) -c $<
126
127 arm64.cmxa: arm64.cmx
128 ocamlopt -ccopt $(FLAGS) -a -o $@ $<
129
130 arm64_const.mli: arm64_const.ml
131 ocamlc -ccopt $(FLAGS) -i $< > $@
132
133 arm64_const.cmi: arm64_const.mli
134 ocamlc -ccopt $(FLAGS) -c $<
135
136 arm64_const.cmx: arm64_const.ml arm64_const.cmi
137 ocamlopt -ccopt $(FLAGS) -c $<
138
139 arm64_const.cmxa: arm64_const.cmx
140 ocamlopt -ccopt $(FLAGS) -a -o $@ $<
141
142 m680x.mli: m680x.ml
143 ocamlc -ccopt $(FLAGS) -i $< > $@
144
145 m680x.cmi: m680x.mli
146 ocamlc -ccopt $(FLAGS) -c $<
147
148 m680x.cmx: m680x.ml m680x.cmi
149 ocamlopt -ccopt $(FLAGS) -c $<
150
151 m680x.cmxa: m680x.cmx
152 ocamlopt -ccopt $(FLAGS) -a -o $@ $<
153
154 m680x_const.mli: m680x_const.ml
155 ocamlc -ccopt $(FLAGS) -i $< > $@
156
157 m680x_const.cmi: m680x_const.mli
158 ocamlc -ccopt $(FLAGS) -c $<
159
160 m680x_const.cmx: m680x_const.ml m680x_const.cmi
161 ocamlopt -ccopt $(FLAGS) -c $<
162
163 m680x_const.cmxa: m680x_const.cmx
164 ocamlopt -ccopt $(FLAGS) -a -o $@ $<
165
166 mips.mli: mips.ml
167 ocamlc -ccopt $(FLAGS) -i $< > $@
168
169 mips.cmi: mips.mli
170 ocamlc -ccopt $(FLAGS) -c $<
171
172 mips.cmx: mips.ml mips.cmi
173 ocamlopt -ccopt $(FLAGS) -c $<
174
175 mips.cmxa: mips.cmx
176 ocamlopt -ccopt $(FLAGS) -a -o $@ $<
177
178 mips_const.mli: mips_const.ml
179 ocamlc -ccopt $(FLAGS) -i $< > $@
180
181 mips_const.cmi: mips_const.mli
182 ocamlc -ccopt $(FLAGS) -c $<
183
184 mips_const.cmx: mips_const.ml mips_const.cmi
185 ocamlopt -ccopt $(FLAGS) -c $<
186
187 mips_const.cmxa: mips_const.cmx
188 ocamlopt -ccopt $(FLAGS) -a -o $@ $<
189
190 ppc.mli: ppc.ml
191 ocamlc -ccopt $(FLAGS) -i $< > $@
192
193 ppc.cmi: ppc.mli
194 ocamlc -ccopt $(FLAGS) -c $<
195
196 ppc.cmx: ppc.ml ppc.cmi
197 ocamlopt -ccopt $(FLAGS) -c $<
198
199 ppc.cmxa: ppc.cmx
200 ocamlopt -ccopt $(FLAGS) -a -o $@ $<
201
202 ppc_const.mli: ppc_const.ml
203 ocamlc -ccopt $(FLAGS) -i $< > $@
204
205 ppc_const.cmi: ppc_const.mli
206 ocamlc -ccopt $(FLAGS) -c $<
207
208 ppc_const.cmx: ppc_const.ml ppc_const.cmi
209 ocamlopt -ccopt $(FLAGS) -c $<
210
211 ppc_const.cmxa: ppc_const.cmx
212 ocamlopt -ccopt $(FLAGS) -a -o $@ $<
213
214 sparc.mli: sparc.ml
215 ocamlc -ccopt $(FLAGS) -i $< > $@
216
217 sparc.cmi: sparc.mli
218 ocamlc -ccopt $(FLAGS) -c $<
219
220 sparc.cmx: sparc.ml sparc.cmi
221 ocamlopt -ccopt $(FLAGS) -c $<
222
223 sparc.cmxa: sparc.cmx
224 ocamlopt -ccopt $(FLAGS) -a -o $@ $<
225
226 sparc_const.mli: sparc_const.ml
227 ocamlc -ccopt $(FLAGS) -i $< > $@
228
229 sparc_const.cmi: sparc_const.mli
230 ocamlc -ccopt $(FLAGS) -c $<
231
232 sparc_const.cmx: sparc_const.ml sparc_const.cmi
233 ocamlopt -ccopt $(FLAGS) -c $<
234
235 sparc_const.cmxa: sparc_const.cmx
236 ocamlopt -ccopt $(FLAGS) -a -o $@ $<
237
238 systemz.mli: systemz.ml
239 ocamlc -ccopt $(FLAGS) -i $< > $@
240
241 systemz.cmi: systemz.mli
242 ocamlc -ccopt $(FLAGS) -c $<
243
244 systemz.cmx: systemz.ml systemz.cmi
245 ocamlopt -ccopt $(FLAGS) -c $<
246
247 systemz.cmxa: systemz.cmx
248 ocamlopt -ccopt $(FLAGS) -a -o $@ $<
249
250 sysz_const.mli: sysz_const.ml
251 ocamlc -ccopt $(FLAGS) -i $< > $@
252
253 sysz_const.cmi: sysz_const.mli
254 ocamlc -ccopt $(FLAGS) -c $<
255
256 sysz_const.cmx: sysz_const.ml sysz_const.cmi
257 ocamlopt -ccopt $(FLAGS) -c $<
258
259 sysz_const.cmxa: sysz_const.cmx
260 ocamlopt -ccopt $(FLAGS) -a -o $@ $<
261
262 xcore.mli: xcore.ml
263 ocamlc -ccopt $(FLAGS) -i $< > $@
264
265 xcore.cmi: xcore.mli
266 ocamlc -ccopt $(FLAGS) -c $<
267
268 xcore.cmx: xcore.ml xcore.cmi
269 ocamlopt -ccopt $(FLAGS) -c $<
270
271 xcore.cmxa: xcore.cmx
272 ocamlopt -ccopt $(FLAGS) -a -o $@ $<
273
274 xcore_const.mli: xcore_const.ml
275 ocamlc -ccopt $(FLAGS) -i $< > $@
276
277 xcore_const.cmi: xcore_const.mli
278 ocamlc -ccopt $(FLAGS) -c $<
279
280 xcore_const.cmx: xcore_const.ml xcore_const.cmi
281 ocamlopt -ccopt $(FLAGS) -c $<
282
283 xcore_const.cmxa: xcore_const.cmx
284 ocamlopt -ccopt $(FLAGS) -a -o $@ $<
285
286 clean:
287 rm -f *.[oa] *.so *.cm[ixoa] *.cmxa *.mli test_basic test_detail test_x86 test_arm test_arm64 test_mips test_ppc test_sparc test_systemz test_xcore test_m680x
288
289 gen_const:
290 cd .. && $(PYTHON2) const_generator.py ocaml
291
292 TESTS = test_basic test_detail test_arm test_arm64 test_m680x test_mips test_ppc
293 TESTS += test_sparc test_systemz test_x86 test_xcore
294 check:
295 @for t in $(TESTS); do \
296 echo Check $$t ... ; \
297 ./$$t > /dev/null && echo OK || echo FAILED; \
298 done
299