2 PUB_HEADERS = pub/libvex_basictypes.h \
5 pub/libvex_trc_values.h \
7 pub/libvex_guest_x86.h \
8 pub/libvex_guest_amd64.h \
9 pub/libvex_guest_arm.h \
10 pub/libvex_guest_ppc32.h \
11 pub/libvex_guest_ppc64.h \
12 pub/libvex_guest_s390x.h \
13 pub/libvex_s390x_common.h \
14 pub/libvex_guest_mips32.h \
15 pub/libvex_guest_offsets.h
17 PRIV_HEADERS = priv/host_x86_defs.h \
18 priv/host_amd64_defs.h \
19 priv/host_arm_defs.h \
20 priv/host_ppc_defs.h \
21 priv/host_s390_defs.h \
22 priv/host_mips_defs.h \
23 priv/host_generic_maddf.h \
24 priv/host_generic_regs.h \
25 priv/host_generic_simd64.h \
26 priv/host_generic_simd128.h \
27 priv/host_generic_simd256.h \
30 priv/guest_generic_x87.h \
31 priv/guest_generic_bb_to_IR.h \
32 priv/guest_x86_defs.h \
33 priv/guest_amd64_defs.h \
34 priv/guest_arm_defs.h \
35 priv/guest_ppc_defs.h \
36 priv/guest_mips_defs.h \
42 LIB_OBJS = priv/ir_defs.o \
50 priv/host_x86_defs.o \
51 priv/host_amd64_defs.o \
52 priv/host_arm_defs.o \
53 priv/host_arm64_defs.o \
54 priv/host_ppc_defs.o \
55 priv/host_s390_defs.o \
56 priv/host_mips_defs.o \
57 priv/host_x86_isel.o \
58 priv/host_amd64_isel.o \
59 priv/host_arm_isel.o \
60 priv/host_arm64_isel.o \
61 priv/host_ppc_isel.o \
62 priv/host_s390_isel.o \
63 priv/host_mips_isel.o \
64 priv/host_generic_maddf.o \
65 priv/host_generic_regs.o \
66 priv/host_generic_simd64.o \
67 priv/host_generic_simd128.o \
68 priv/host_generic_simd256.o \
69 priv/host_generic_reg_alloc2.o \
70 priv/guest_generic_x87.o \
71 priv/guest_generic_bb_to_IR.o \
72 priv/guest_x86_helpers.o \
73 priv/guest_amd64_helpers.o \
74 priv/guest_arm_helpers.o \
75 priv/guest_arm64_helpers.o \
76 priv/guest_ppc_helpers.o \
77 priv/guest_s390_helpers.o \
78 priv/guest_mips_helpers.o \
79 priv/guest_x86_toIR.o \
80 priv/guest_amd64_toIR.o \
81 priv/guest_arm_toIR.o \
82 priv/guest_arm64_toIR.o \
83 priv/guest_ppc_toIR.o \
84 priv/guest_s390_toIR.o \
85 priv/guest_mips_toIR.o
89 # Do not add any priv/host-ARCH or priv/guest-ARCH directories to this
90 # list, as they contain duplicate file names (each host has a hdefs.h,
92 PRIV_INCLUDES = -Ipriv
102 # Put -g -O2 after any flags we inherit from V. -O2 vs -O
103 # makes a significant difference, at least with gcc4.
104 CCFLAGS = -Wall -Wmissing-prototypes -Wstrict-prototypes -Wshadow \
105 -Wpointer-arith -Wbad-function-cast -Wcast-qual \
106 -Wcast-align -Wmissing-declarations \
107 -Wwrite-strings -Wformat -Wformat-security \
108 $(EXTRA_CFLAGS) -g -O2 -fstrict-aliasing
111 #CCFLAGS = -g -Wall -wd981 -wd279 -wd1287 -wd869 -wd111 -wd188 -wd186
112 # 981: operands are evaluated in unspecified order
113 # 279: controlling expression is constant
114 # 1287: invalid attribute for parameter
115 # 869: parameter "..." was never referenced
116 # 111: statement is unreachable
117 # 188: enumerated type mixed with another type
118 # (the above are for icc 8.0 -- 8.0.0.55 I think)
119 # 186: pointless comparison of unsigned integer with zero
121 # kludge: stops V biarch builds screwing up at -j 2 or above
122 # The Right fix is to autoconf/automake-ise vex.
127 # Empty, needed for Valgrind
134 libvex.a: $(LIB_OBJS)
136 $(AR) crus libvex.a $(LIB_OBJS)
139 # The idea with these TAG-s is to mark the flavour of libvex.a
140 # most recently built, so if the same target is re-requested, we
141 # don't rebuild everything, but if a different one is requested
142 # then we scrub everything and start over.
144 libvex-x86-linux.a: TAG-x86-linux libvex.a
145 mv -f libvex.a libvex-x86-linux.a
147 if [ ! -f TAG-x86-linux ] ; then rm -f $(LIB_OBJS) TAG-* libvex.a ; fi
150 libvex-amd64-linux.a: TAG-amd64-linux libvex.a
151 mv -f libvex.a libvex-amd64-linux.a
153 if [ ! -f TAG-amd64-linux ] ; then rm -f $(LIB_OBJS) TAG-* libvex.a ; fi
154 touch TAG-amd64-linux
156 libvex-ppc32-linux.a: TAG-ppc32-linux libvex.a
157 mv -f libvex.a libvex-ppc32-linux.a
159 if [ ! -f TAG-ppc32-linux ] ; then rm -f $(LIB_OBJS) TAG-* libvex.a ; fi
160 touch TAG-ppc32-linux
162 libvex-ppc64-linux.a: TAG-ppc64-linux libvex.a
163 mv -f libvex.a libvex-ppc64-linux.a
165 if [ ! -f TAG-ppc64-linux ] ; then rm -f $(LIB_OBJS) TAG-* libvex.a ; fi
166 touch TAG-ppc64-linux
168 libvex-mips-linux.a: TAG-mips32-linux libvex.a
169 mv -f libvex.a libvex-mips32-linux.a
171 if [ ! -f TAG-mips32-linux ] ; then rm -f $(LIB_OBJS) TAG-* libvex.a ; fi
172 touch TAG-mips32-linux
174 libvex-ppc32-aix5.a: TAG-ppc32-aix5 libvex.a
175 mv -f libvex.a libvex-ppc32-aix5.a
177 if [ ! -f TAG-ppc32-aix5 ] ; then rm -f $(LIB_OBJS) TAG-* libvex.a ; fi
180 libvex-ppc64-aix5.a: TAG-ppc64-aix5 libvex.a
181 mv -f libvex.a libvex-ppc64-aix5.a
183 if [ ! -f TAG-ppc64-aix5 ] ; then rm -f $(LIB_OBJS) TAG-* libvex.a ; fi
186 libvex-x86-darwin.a: TAG-x86-darwin libvex.a
187 mv -f libvex.a libvex-x86-darwin.a
189 if [ ! -f TAG-x86-darwin ] ; then rm -f $(LIB_OBJS) TAG-* libvex.a ; fi
192 libvex-amd64-darwin.a: TAG-amd64-darwin libvex.a
193 mv -f libvex.a libvex-amd64-darwin.a
195 if [ ! -f TAG-amd64-darwin ] ; then rm -f $(LIB_OBJS) TAG-* libvex.a ; fi
196 touch TAG-amd64-darwin
198 libvex-arm64-linux.a: TAG-arm64-linux libvex.a
199 mv -f libvex.a libvex-arm64-linux.a
201 if [ ! -f TAG-arm64-linux ] ; then rm -f $(LIB_OBJS) TAG-* libvex.a ; fi
202 touch TAG-arm64-linux
206 rm -f $(LIB_OBJS) *.a TAG-* \
207 pub/libvex_guest_offsets.h \
208 auxprogs/genoffsets.s
211 rm -f vex--minidist-2005MMDD.tar
212 tar cf vex--minidist-2005MMDD.tar $(PUB_HEADERS) $(PRIV_HEADERS) \
214 `echo $(LIB_OBJS) | sed "s/\.o/\.c/g"`
216 @echo minidist done, size follows:
217 @ls -l vex--minidist-2005MMDD.tar
220 # This is very uggerly. Need to sed out both "xyzzyN" and
221 # "xyzzy$N" since gcc on different targets emits the constants
222 # differently -- with a leading $ on x86/amd64 but none on ppc32/64.
223 # ICC also emits the constants differently with a leading # #define
224 pub/libvex_guest_offsets.h:
225 rm -f auxprogs/genoffsets.s
226 $(CC) $(CCFLAGS) -O -S -o auxprogs/genoffsets.s \
227 auxprogs/genoffsets.c
228 grep xyzzy auxprogs/genoffsets.s | grep "^[# ]*#define" \
229 | sed "s/# #define/#define/g" \
230 | sed "s/xyzzy\\$$//g" \
231 | sed "s/xyzzy#//g" \
233 > pub/libvex_guest_offsets.h
234 rm -f auxprogs/genoffsets.s
237 ALL_HEADERS = $(PUB_HEADERS) $(PRIV_HEADERS)
238 ALL_INCLUDES = $(PUB_INCLUDES) $(PRIV_INCLUDES)
240 priv/ir_defs.o: $(ALL_HEADERS) priv/ir_defs.c
241 $(CC) $(CCFLAGS) $(ALL_INCLUDES) -o priv/ir_defs.o \
244 priv/ir_inject.o: $(ALL_HEADERS) priv/ir_inject.c
245 $(CC) $(CCFLAGS) $(ALL_INCLUDES) -o priv/ir_inject.o \
248 priv/ir_match.o: $(ALL_HEADERS) priv/ir_match.c
249 $(CC) $(CCFLAGS) $(ALL_INCLUDES) -o priv/ir_match.o \
252 priv/ir_opt.o: $(ALL_HEADERS) priv/ir_opt.c
253 $(CC) $(CCFLAGS) $(ALL_INCLUDES) -o priv/ir_opt.o \
256 priv/main_main.o: $(ALL_HEADERS) priv/main_main.c
257 $(CC) $(CCFLAGS) $(ALL_INCLUDES) -o priv/main_main.o \
260 priv/main_globals.o: $(ALL_HEADERS) priv/main_globals.c
261 $(CC) $(CCFLAGS) $(ALL_INCLUDES) -o priv/main_globals.o \
262 -c priv/main_globals.c
264 priv/main_util.o: $(ALL_HEADERS) priv/main_util.c
265 $(CC) $(CCFLAGS) $(ALL_INCLUDES) -o priv/main_util.o \
268 priv/host_x86_defs.o: $(ALL_HEADERS) priv/host_x86_defs.c
269 $(CC) $(CCFLAGS) $(ALL_INCLUDES) -o priv/host_x86_defs.o \
270 -c priv/host_x86_defs.c
272 priv/host_amd64_defs.o: $(ALL_HEADERS) priv/host_amd64_defs.c
273 $(CC) $(CCFLAGS) $(ALL_INCLUDES) -o priv/host_amd64_defs.o \
274 -c priv/host_amd64_defs.c
276 priv/host_arm_defs.o: $(ALL_HEADERS) priv/host_arm_defs.c
277 $(CC) $(CCFLAGS) $(ALL_INCLUDES) -o priv/host_arm_defs.o \
278 -c priv/host_arm_defs.c
280 priv/host_arm64_defs.o: $(ALL_HEADERS) priv/host_arm64_defs.c
281 $(CC) $(CCFLAGS) $(ALL_INCLUDES) -o priv/host_arm64_defs.o \
282 -c priv/host_arm64_defs.c
284 priv/host_ppc_defs.o: $(ALL_HEADERS) priv/host_ppc_defs.c
285 $(CC) $(CCFLAGS) $(ALL_INCLUDES) -o priv/host_ppc_defs.o \
286 -c priv/host_ppc_defs.c
288 priv/host_s390_defs.o: $(ALL_HEADERS) priv/host_s390_defs.c
289 $(CC) $(CCFLAGS) $(ALL_INCLUDES) -o priv/host_s390_defs.o \
290 -c priv/host_s390_defs.c
292 priv/host_mips_defs.o: $(ALL_HEADERS) priv/host_mips_defs.c
293 $(CC) $(CCFLAGS) $(ALL_INCLUDES) -o priv/host_mips_defs.o \
294 -c priv/host_mips_defs.c
296 priv/host_x86_isel.o: $(ALL_HEADERS) priv/host_x86_isel.c
297 $(CC) $(CCFLAGS) $(ALL_INCLUDES) -o priv/host_x86_isel.o \
298 -c priv/host_x86_isel.c
300 priv/host_amd64_isel.o: $(ALL_HEADERS) priv/host_amd64_isel.c
301 $(CC) $(CCFLAGS) $(ALL_INCLUDES) -o priv/host_amd64_isel.o \
302 -c priv/host_amd64_isel.c
304 priv/host_arm_isel.o: $(ALL_HEADERS) priv/host_arm_isel.c
305 $(CC) $(CCFLAGS) $(ALL_INCLUDES) -o priv/host_arm_isel.o \
306 -c priv/host_arm_isel.c
308 priv/host_arm64_isel.o: $(ALL_HEADERS) priv/host_arm64_isel.c
309 $(CC) $(CCFLAGS) $(ALL_INCLUDES) -o priv/host_arm64_isel.o \
310 -c priv/host_arm64_isel.c
312 priv/host_ppc_isel.o: $(ALL_HEADERS) priv/host_ppc_isel.c
313 $(CC) $(CCFLAGS) $(ALL_INCLUDES) -o priv/host_ppc_isel.o \
314 -c priv/host_ppc_isel.c
316 priv/host_s390_isel.o: $(ALL_HEADERS) priv/host_s390_isel.c
317 $(CC) $(CCFLAGS) $(ALL_INCLUDES) -o priv/host_s390_isel.o \
318 -c priv/host_s390_isel.c
320 priv/host_mips_isel.o: $(ALL_HEADERS) priv/host_mips_isel.c
321 $(CC) $(CCFLAGS) $(ALL_INCLUDES) -o priv/host_mips_isel.o \
322 -c priv/host_mips_isel.c
324 priv/host_generic_maddf.o: $(ALL_HEADERS) priv/host_generic_maddf.c
325 $(CC) $(CCFLAGS) $(ALL_INCLUDES) -o priv/host_generic_maddf.o \
326 -c priv/host_generic_maddf.c
328 priv/host_generic_regs.o: $(ALL_HEADERS) priv/host_generic_regs.c
329 $(CC) $(CCFLAGS) $(ALL_INCLUDES) -o priv/host_generic_regs.o \
330 -c priv/host_generic_regs.c
332 priv/host_generic_simd64.o: $(ALL_HEADERS) priv/host_generic_simd64.c
333 $(CC) $(CCFLAGS) $(ALL_INCLUDES) -o priv/host_generic_simd64.o \
334 -c priv/host_generic_simd64.c
336 priv/host_generic_simd128.o: $(ALL_HEADERS) priv/host_generic_simd128.c
337 $(CC) $(CCFLAGS) $(ALL_INCLUDES) -o priv/host_generic_simd128.o \
338 -c priv/host_generic_simd128.c
340 priv/host_generic_simd256.o: $(ALL_HEADERS) priv/host_generic_simd256.c
341 $(CC) $(CCFLAGS) $(ALL_INCLUDES) -o priv/host_generic_simd256.o \
342 -c priv/host_generic_simd256.c
344 priv/host_generic_reg_alloc2.o: $(ALL_HEADERS) priv/host_generic_reg_alloc2.c
345 $(CC) $(CCFLAGS) $(ALL_INCLUDES) -o priv/host_generic_reg_alloc2.o \
346 -c priv/host_generic_reg_alloc2.c
348 priv/guest_x86_toIR.o: $(ALL_HEADERS) priv/guest_x86_toIR.c
349 $(CC) $(CCFLAGS) $(ALL_INCLUDES) -o priv/guest_x86_toIR.o \
350 -c priv/guest_x86_toIR.c
352 priv/guest_generic_x87.o: $(ALL_HEADERS) priv/guest_generic_x87.c
353 $(CC) $(CCFLAGS) $(ALL_INCLUDES) -o priv/guest_generic_x87.o \
354 -c priv/guest_generic_x87.c
356 priv/guest_generic_bb_to_IR.o: $(ALL_HEADERS) priv/guest_generic_bb_to_IR.c
357 $(CC) $(CCFLAGS) $(ALL_INCLUDES) -o priv/guest_generic_bb_to_IR.o \
358 -c priv/guest_generic_bb_to_IR.c
360 priv/guest_x86_helpers.o: $(ALL_HEADERS) priv/guest_x86_helpers.c
361 $(CC) $(CCFLAGS) $(ALL_INCLUDES) -o priv/guest_x86_helpers.o \
362 -c priv/guest_x86_helpers.c
364 priv/guest_amd64_helpers.o: $(ALL_HEADERS) priv/guest_amd64_helpers.c
365 $(CC) $(CCFLAGS) $(ALL_INCLUDES) -o priv/guest_amd64_helpers.o \
366 -c priv/guest_amd64_helpers.c
368 priv/guest_amd64_toIR.o: $(ALL_HEADERS) priv/guest_amd64_toIR.c
369 $(CC) $(CCFLAGS) $(ALL_INCLUDES) -o priv/guest_amd64_toIR.o \
370 -c priv/guest_amd64_toIR.c
372 priv/guest_arm_helpers.o: $(ALL_HEADERS) priv/guest_arm_helpers.c
373 $(CC) $(CCFLAGS) $(ALL_INCLUDES) -o priv/guest_arm_helpers.o \
374 -c priv/guest_arm_helpers.c
376 priv/guest_arm64_helpers.o: $(ALL_HEADERS) priv/guest_arm64_helpers.c
377 $(CC) $(CCFLAGS) $(ALL_INCLUDES) -o priv/guest_arm64_helpers.o \
378 -c priv/guest_arm64_helpers.c
380 priv/guest_arm_toIR.o: $(ALL_HEADERS) priv/guest_arm_toIR.c
381 $(CC) $(CCFLAGS) $(ALL_INCLUDES) -o priv/guest_arm_toIR.o \
382 -c priv/guest_arm_toIR.c
384 priv/guest_arm64_toIR.o: $(ALL_HEADERS) priv/guest_arm64_toIR.c
385 $(CC) $(CCFLAGS) $(ALL_INCLUDES) -o priv/guest_arm64_toIR.o \
386 -c priv/guest_arm64_toIR.c
388 priv/guest_ppc_helpers.o: $(ALL_HEADERS) priv/guest_ppc_helpers.c
389 $(CC) $(CCFLAGS) $(ALL_INCLUDES) -o priv/guest_ppc_helpers.o \
390 -c priv/guest_ppc_helpers.c
392 priv/guest_s390_helpers.o: $(ALL_HEADERS) priv/guest_s390_helpers.c
393 $(CC) $(CCFLAGS) $(ALL_INCLUDES) -o priv/guest_s390_helpers.o \
394 -c priv/guest_s390_helpers.c
396 priv/guest_ppc_toIR.o: $(ALL_HEADERS) priv/guest_ppc_toIR.c
397 $(CC) $(CCFLAGS) $(ALL_INCLUDES) -o priv/guest_ppc_toIR.o \
398 -c priv/guest_ppc_toIR.c
400 priv/guest_s390_toIR.o: $(ALL_HEADERS) priv/guest_s390_toIR.c
401 $(CC) $(CCFLAGS) $(ALL_INCLUDES) -o priv/guest_s390_toIR.o \
402 -c priv/guest_s390_toIR.c
404 priv/s390_disasm.o: $(ALL_HEADERS) priv/s390_disasm.c
405 $(CC) $(CCFLAGS) $(ALL_INCLUDES) -o priv/s390_disasm.o \
406 -c priv/s390_disasm.c
408 priv/guest_mips_helpers.o: $(ALL_HEADERS) priv/guest_mips_helpers.c
409 $(CC) $(CCFLAGS) $(ALL_INCLUDES) -o priv/guest_mips_helpers.o \
410 -c priv/guest_mips_helpers.c
412 priv/guest_mips_toIR.o: $(ALL_HEADERS) priv/guest_mips_toIR.c
413 $(CC) $(CCFLAGS) $(ALL_INCLUDES) -o priv/guest_mips_toIR.o \
414 -c priv/guest_mips_toIR.c