regtest: add check for -Wl,--no-warn-execstack
[valgrind.git] / VEX / Makefile-gcc
blob0b94e13c5f72397f8d9d63efa46455c54c33dd8c
2 PUB_HEADERS =   pub/libvex_basictypes.h                 \
3                 pub/libvex_ir.h                         \
4                 pub/libvex.h                            \
5                 pub/libvex_trc_values.h                 \
6                 pub/libvex_emnote.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             \
28                 priv/main_globals.h                     \
29                 priv/main_util.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                  \
37                 priv/mips_defs.h                        \
38                 priv/s390_disasm.h                      \
39                 priv/s390_defs.h                        \
40                 priv/ir_match.h                         \
41                 priv/ir_opt.h
43 LIB_OBJS =      priv/ir_defs.o                          \
44                 priv/ir_match.o                         \
45                 priv/ir_opt.o                           \
46                 priv/ir_inject.o                        \
47                 priv/main_main.o                        \
48                 priv/main_globals.o                     \
49                 priv/main_util.o                        \
50                 priv/s390_disasm.o                      \
51                 priv/host_x86_defs.o                    \
52                 priv/host_amd64_defs.o                  \
53                 priv/host_arm_defs.o                    \
54                 priv/host_arm64_defs.o                  \
55                 priv/host_ppc_defs.o                    \
56                 priv/host_s390_defs.o                   \
57                 priv/host_mips_defs.o                   \
58                 priv/host_x86_isel.o                    \
59                 priv/host_amd64_isel.o                  \
60                 priv/host_arm_isel.o                    \
61                 priv/host_arm64_isel.o                  \
62                 priv/host_ppc_isel.o                    \
63                 priv/host_s390_isel.o                   \
64                 priv/host_mips_isel.o                   \
65                 priv/host_generic_maddf.o               \
66                 priv/host_generic_regs.o                \
67                 priv/host_generic_simd64.o              \
68                 priv/host_generic_simd128.o             \
69                 priv/host_generic_simd256.o             \
70                 priv/host_generic_reg_alloc2.o          \
71                 priv/guest_generic_x87.o                \
72                 priv/guest_generic_bb_to_IR.o           \
73                 priv/guest_x86_helpers.o                \
74                 priv/guest_amd64_helpers.o              \
75                 priv/guest_arm_helpers.o                \
76                 priv/guest_arm64_helpers.o              \
77                 priv/guest_ppc_helpers.o                \
78                 priv/guest_s390_helpers.o               \
79                 priv/guest_mips_helpers.o               \
80                 priv/guest_x86_toIR.o                   \
81                 priv/guest_amd64_toIR.o                 \
82                 priv/guest_arm_toIR.o                   \
83                 priv/guest_arm64_toIR.o                 \
84                 priv/guest_ppc_toIR.o                   \
85                 priv/guest_s390_toIR.o                  \
86                 priv/guest_mipsdsp_toIR.o               \
87                 priv/guest_mips_toIR.o
89 PUB_INCLUDES = -Ipub
91 # Do not add any priv/host-ARCH or priv/guest-ARCH directories to this
92 # list, as they contain duplicate file names (each host has a hdefs.h,
93 # for example).
94 PRIV_INCLUDES = -Ipriv
97 ifndef CC
98    CC = gcc 
99 endif 
100 ifndef AR
101    AR = ar 
102 endif
104 # Put -g -O2 after any flags we inherit from V.  -O2 vs -O
105 # makes a significant difference, at least with gcc4.
106 CCFLAGS = -Wall -Wmissing-prototypes -Wstrict-prototypes -Wshadow \
107                 -Wpointer-arith -Wbad-function-cast -Wcast-qual \
108                 -Wcast-align -Wmissing-declarations \
109                 -Wwrite-strings -Wformat -Wformat-security \
110                 $(EXTRA_CFLAGS) -g -O2 -fstrict-aliasing
112 #CC = icc
113 #CCFLAGS = -g -Wall -wd981 -wd279 -wd1287 -wd869 -wd111 -wd188 -wd186
114 # 981: operands are evaluated in unspecified order
115 # 279: controlling expression is constant
116 # 1287: invalid attribute for parameter
117 # 869: parameter "..." was never referenced
118 # 111: statement is unreachable
119 # 188: enumerated type mixed with another type
120 # (the above are for icc 8.0 -- 8.0.0.55 I think)
121 # 186: pointless comparison of unsigned integer with zero
123 # kludge: stops V biarch builds screwing up at -j 2 or above
124 # The Right fix is to autoconf/automake-ise vex.
125 .NOTPARALLEL:
127 all: vex
129 # Empty, needed for Valgrind
130 install:
132 scratch: clean all
134 vex: libvex.a
136 libvex.a: $(LIB_OBJS)
137         rm -f libvex.a
138         $(AR) crus libvex.a $(LIB_OBJS)
141 # The idea with these TAG-s is to mark the flavour of libvex.a 
142 # most recently built, so if the same target is re-requested, we
143 # don't rebuild everything, but if a different one is requested
144 # then we scrub everything and start over.
146 libvex-x86-linux.a: TAG-x86-linux libvex.a
147         mv -f libvex.a libvex-x86-linux.a
148 TAG-x86-linux:
149         if [ ! -f TAG-x86-linux ] ; then rm -f $(LIB_OBJS) TAG-* libvex.a ; fi
150         touch TAG-x86-linux
152 libvex-amd64-linux.a: TAG-amd64-linux libvex.a
153         mv -f libvex.a libvex-amd64-linux.a
154 TAG-amd64-linux:
155         if [ ! -f TAG-amd64-linux ] ; then rm -f $(LIB_OBJS) TAG-* libvex.a ; fi
156         touch TAG-amd64-linux
158 libvex-ppc32-linux.a: TAG-ppc32-linux libvex.a
159         mv -f libvex.a libvex-ppc32-linux.a
160 TAG-ppc32-linux:
161         if [ ! -f TAG-ppc32-linux ] ; then rm -f $(LIB_OBJS) TAG-* libvex.a ; fi
162         touch TAG-ppc32-linux
164 libvex-ppc64-linux.a: TAG-ppc64-linux libvex.a
165         mv -f libvex.a libvex-ppc64-linux.a
166 TAG-ppc64-linux:
167         if [ ! -f TAG-ppc64-linux ] ; then rm -f $(LIB_OBJS) TAG-* libvex.a ; fi
168         touch TAG-ppc64-linux
170 libvex-mips-linux.a: TAG-mips32-linux libvex.a
171         mv -f libvex.a libvex-mips32-linux.a
172 TAG-mips-linux:
173         if [ ! -f TAG-mips32-linux ] ; then rm -f $(LIB_OBJS) TAG-* libvex.a ; fi
174         touch TAG-mips32-linux
176 libvex-ppc32-aix5.a: TAG-ppc32-aix5 libvex.a
177         mv -f libvex.a libvex-ppc32-aix5.a
178 TAG-ppc32-aix5:
179         if [ ! -f TAG-ppc32-aix5 ] ; then rm -f $(LIB_OBJS) TAG-* libvex.a ; fi
180         touch TAG-ppc32-aix5
182 libvex-ppc64-aix5.a: TAG-ppc64-aix5 libvex.a
183         mv -f libvex.a libvex-ppc64-aix5.a
184 TAG-ppc64-aix5:
185         if [ ! -f TAG-ppc64-aix5 ] ; then rm -f $(LIB_OBJS) TAG-* libvex.a ; fi
186         touch TAG-ppc64-aix5
188 libvex-x86-darwin.a: TAG-x86-darwin libvex.a
189         mv -f libvex.a libvex-x86-darwin.a
190 TAG-x86-darwin:
191         if [ ! -f TAG-x86-darwin ] ; then rm -f $(LIB_OBJS) TAG-* libvex.a ; fi
192         touch TAG-x86-darwin
194 libvex-amd64-darwin.a: TAG-amd64-darwin libvex.a
195         mv -f libvex.a libvex-amd64-darwin.a
196 TAG-amd64-darwin:
197         if [ ! -f TAG-amd64-darwin ] ; then rm -f $(LIB_OBJS) TAG-* libvex.a ; fi
198         touch TAG-amd64-darwin
200 libvex-arm64-linux.a: TAG-arm64-linux libvex.a
201         mv -f libvex.a libvex-arm64-linux.a
202 TAG-arm64-linux:
203         if [ ! -f TAG-arm64-linux ] ; then rm -f $(LIB_OBJS) TAG-* libvex.a ; fi
204         touch TAG-arm64-linux
207 clean:
208         rm -f $(LIB_OBJS) *.a TAG-* \
209                 pub/libvex_guest_offsets.h \
210                 auxprogs/genoffsets.s
212 minidist:
213         rm -f vex--minidist-2005MMDD.tar
214         tar cf vex--minidist-2005MMDD.tar $(PUB_HEADERS) $(PRIV_HEADERS) \
215                 Makefile-gcc                                    \
216                 `echo $(LIB_OBJS) | sed "s/\.o/\.c/g"`
217         @echo 
218         @echo minidist done, size follows:
219         @ls -l vex--minidist-2005MMDD.tar
220         @echo
222 # This is very uggerly.  Need to sed out both "xyzzyN" and
223 # "xyzzy$N" since gcc on different targets emits the constants
224 # differently -- with a leading $ on x86/amd64 but none on ppc32/64.
225 # ICC also emits the constants differently with a leading # #define
226 pub/libvex_guest_offsets.h:
227         rm -f auxprogs/genoffsets.s
228         $(CC) $(CCFLAGS) -O -S -o auxprogs/genoffsets.s \
229                                 auxprogs/genoffsets.c
230         grep xyzzy auxprogs/genoffsets.s | grep "^[# ]*#define" \
231            | sed "s/# #define/#define/g" \
232            | sed "s/xyzzy\\$$//g" \
233            | sed "s/xyzzy#//g" \
234            | sed "s/xyzzy//g" \
235            > pub/libvex_guest_offsets.h
236         rm -f auxprogs/genoffsets.s
239 ALL_HEADERS  = $(PUB_HEADERS) $(PRIV_HEADERS)
240 ALL_INCLUDES = $(PUB_INCLUDES) $(PRIV_INCLUDES)
242 priv/ir_defs.o: $(ALL_HEADERS) priv/ir_defs.c
243         $(CC) $(CCFLAGS) $(ALL_INCLUDES) -o priv/ir_defs.o \
244                                          -c priv/ir_defs.c
246 priv/ir_inject.o: $(ALL_HEADERS) priv/ir_inject.c
247         $(CC) $(CCFLAGS) $(ALL_INCLUDES) -o priv/ir_inject.o \
248                                          -c priv/ir_inject.c
250 priv/ir_match.o: $(ALL_HEADERS) priv/ir_match.c
251         $(CC) $(CCFLAGS) $(ALL_INCLUDES) -o priv/ir_match.o \
252                                          -c priv/ir_match.c
254 priv/ir_opt.o: $(ALL_HEADERS) priv/ir_opt.c
255         $(CC) $(CCFLAGS) $(ALL_INCLUDES) -o priv/ir_opt.o \
256                                          -c priv/ir_opt.c
258 priv/main_main.o: $(ALL_HEADERS) priv/main_main.c
259         $(CC) $(CCFLAGS) $(ALL_INCLUDES) -o priv/main_main.o \
260                                          -c priv/main_main.c
262 priv/main_globals.o: $(ALL_HEADERS) priv/main_globals.c
263         $(CC) $(CCFLAGS) $(ALL_INCLUDES) -o priv/main_globals.o \
264                                          -c priv/main_globals.c
266 priv/main_util.o: $(ALL_HEADERS) priv/main_util.c
267         $(CC) $(CCFLAGS) $(ALL_INCLUDES) -o priv/main_util.o \
268                                          -c priv/main_util.c
270 priv/host_x86_defs.o: $(ALL_HEADERS) priv/host_x86_defs.c
271         $(CC) $(CCFLAGS) $(ALL_INCLUDES) -o priv/host_x86_defs.o \
272                                          -c priv/host_x86_defs.c
274 priv/host_amd64_defs.o: $(ALL_HEADERS) priv/host_amd64_defs.c
275         $(CC) $(CCFLAGS) $(ALL_INCLUDES) -o priv/host_amd64_defs.o \
276                                          -c priv/host_amd64_defs.c
278 priv/host_arm_defs.o: $(ALL_HEADERS) priv/host_arm_defs.c
279         $(CC) $(CCFLAGS) $(ALL_INCLUDES) -o priv/host_arm_defs.o \
280                                          -c priv/host_arm_defs.c
282 priv/host_arm64_defs.o: $(ALL_HEADERS) priv/host_arm64_defs.c
283         $(CC) $(CCFLAGS) $(ALL_INCLUDES) -o priv/host_arm64_defs.o \
284                                          -c priv/host_arm64_defs.c
286 priv/host_ppc_defs.o: $(ALL_HEADERS) priv/host_ppc_defs.c
287         $(CC) $(CCFLAGS) $(ALL_INCLUDES) -o priv/host_ppc_defs.o \
288                                          -c priv/host_ppc_defs.c
290 priv/host_s390_defs.o: $(ALL_HEADERS) priv/host_s390_defs.c
291         $(CC) $(CCFLAGS) $(ALL_INCLUDES) -o priv/host_s390_defs.o \
292                                          -c priv/host_s390_defs.c
294 priv/host_mips_defs.o: $(ALL_HEADERS) priv/host_mips_defs.c
295         $(CC) $(CCFLAGS) $(ALL_INCLUDES) -o priv/host_mips_defs.o \
296                                          -c priv/host_mips_defs.c
298 priv/host_x86_isel.o: $(ALL_HEADERS) priv/host_x86_isel.c
299         $(CC) $(CCFLAGS) $(ALL_INCLUDES) -o priv/host_x86_isel.o \
300                                          -c priv/host_x86_isel.c
302 priv/host_amd64_isel.o: $(ALL_HEADERS) priv/host_amd64_isel.c
303         $(CC) $(CCFLAGS) $(ALL_INCLUDES) -o priv/host_amd64_isel.o \
304                                          -c priv/host_amd64_isel.c
306 priv/host_arm_isel.o: $(ALL_HEADERS) priv/host_arm_isel.c
307         $(CC) $(CCFLAGS) $(ALL_INCLUDES) -o priv/host_arm_isel.o \
308                                          -c priv/host_arm_isel.c
310 priv/host_arm64_isel.o: $(ALL_HEADERS) priv/host_arm64_isel.c
311         $(CC) $(CCFLAGS) $(ALL_INCLUDES) -o priv/host_arm64_isel.o \
312                                          -c priv/host_arm64_isel.c
314 priv/host_ppc_isel.o: $(ALL_HEADERS) priv/host_ppc_isel.c
315         $(CC) $(CCFLAGS) $(ALL_INCLUDES) -o priv/host_ppc_isel.o \
316                                          -c priv/host_ppc_isel.c
318 priv/host_s390_isel.o: $(ALL_HEADERS) priv/host_s390_isel.c
319         $(CC) $(CCFLAGS) $(ALL_INCLUDES) -o priv/host_s390_isel.o \
320                                          -c priv/host_s390_isel.c
322 priv/host_mips_isel.o: $(ALL_HEADERS) priv/host_mips_isel.c
323         $(CC) $(CCFLAGS) $(ALL_INCLUDES) -o priv/host_mips_isel.o \
324                                          -c priv/host_mips_isel.c
326 priv/host_generic_maddf.o: $(ALL_HEADERS) priv/host_generic_maddf.c
327         $(CC) $(CCFLAGS) $(ALL_INCLUDES) -o priv/host_generic_maddf.o \
328                                          -c priv/host_generic_maddf.c
330 priv/host_generic_regs.o: $(ALL_HEADERS) priv/host_generic_regs.c
331         $(CC) $(CCFLAGS) $(ALL_INCLUDES) -o priv/host_generic_regs.o \
332                                          -c priv/host_generic_regs.c
334 priv/host_generic_simd64.o: $(ALL_HEADERS) priv/host_generic_simd64.c
335         $(CC) $(CCFLAGS) $(ALL_INCLUDES) -o priv/host_generic_simd64.o \
336                                          -c priv/host_generic_simd64.c
338 priv/host_generic_simd128.o: $(ALL_HEADERS) priv/host_generic_simd128.c
339         $(CC) $(CCFLAGS) $(ALL_INCLUDES) -o priv/host_generic_simd128.o \
340                                          -c priv/host_generic_simd128.c
342 priv/host_generic_simd256.o: $(ALL_HEADERS) priv/host_generic_simd256.c
343         $(CC) $(CCFLAGS) $(ALL_INCLUDES) -o priv/host_generic_simd256.o \
344                                          -c priv/host_generic_simd256.c
346 priv/host_generic_reg_alloc2.o: $(ALL_HEADERS) priv/host_generic_reg_alloc2.c
347         $(CC) $(CCFLAGS) $(ALL_INCLUDES) -o priv/host_generic_reg_alloc2.o \
348                                          -c priv/host_generic_reg_alloc2.c
350 priv/guest_x86_toIR.o: $(ALL_HEADERS) priv/guest_x86_toIR.c
351         $(CC) $(CCFLAGS) $(ALL_INCLUDES) -o priv/guest_x86_toIR.o \
352                                          -c priv/guest_x86_toIR.c
354 priv/guest_generic_x87.o: $(ALL_HEADERS) priv/guest_generic_x87.c
355         $(CC) $(CCFLAGS) $(ALL_INCLUDES) -o priv/guest_generic_x87.o \
356                                          -c priv/guest_generic_x87.c
358 priv/guest_generic_bb_to_IR.o: $(ALL_HEADERS) priv/guest_generic_bb_to_IR.c
359         $(CC) $(CCFLAGS) $(ALL_INCLUDES) -o priv/guest_generic_bb_to_IR.o \
360                                          -c priv/guest_generic_bb_to_IR.c
362 priv/guest_x86_helpers.o: $(ALL_HEADERS) priv/guest_x86_helpers.c
363         $(CC) $(CCFLAGS) $(ALL_INCLUDES) -o priv/guest_x86_helpers.o \
364                                          -c priv/guest_x86_helpers.c
366 priv/guest_amd64_helpers.o: $(ALL_HEADERS) priv/guest_amd64_helpers.c
367         $(CC) $(CCFLAGS) $(ALL_INCLUDES) -o priv/guest_amd64_helpers.o \
368                                          -c priv/guest_amd64_helpers.c
370 priv/guest_amd64_toIR.o: $(ALL_HEADERS) priv/guest_amd64_toIR.c
371         $(CC) $(CCFLAGS) $(ALL_INCLUDES) -o priv/guest_amd64_toIR.o \
372                                          -c priv/guest_amd64_toIR.c
374 priv/guest_arm_helpers.o: $(ALL_HEADERS) priv/guest_arm_helpers.c
375         $(CC) $(CCFLAGS) $(ALL_INCLUDES) -o priv/guest_arm_helpers.o \
376                                          -c priv/guest_arm_helpers.c
378 priv/guest_arm64_helpers.o: $(ALL_HEADERS) priv/guest_arm64_helpers.c
379         $(CC) $(CCFLAGS) $(ALL_INCLUDES) -o priv/guest_arm64_helpers.o \
380                                          -c priv/guest_arm64_helpers.c
382 priv/guest_arm_toIR.o: $(ALL_HEADERS) priv/guest_arm_toIR.c
383         $(CC) $(CCFLAGS) $(ALL_INCLUDES) -o priv/guest_arm_toIR.o \
384                                          -c priv/guest_arm_toIR.c
386 priv/guest_arm64_toIR.o: $(ALL_HEADERS) priv/guest_arm64_toIR.c
387         $(CC) $(CCFLAGS) $(ALL_INCLUDES) -o priv/guest_arm64_toIR.o \
388                                          -c priv/guest_arm64_toIR.c
390 priv/guest_ppc_helpers.o: $(ALL_HEADERS) priv/guest_ppc_helpers.c
391         $(CC) $(CCFLAGS) $(ALL_INCLUDES) -o priv/guest_ppc_helpers.o \
392                                          -c priv/guest_ppc_helpers.c
394 priv/guest_s390_helpers.o: $(ALL_HEADERS) priv/guest_s390_helpers.c
395         $(CC) $(CCFLAGS) $(ALL_INCLUDES) -o priv/guest_s390_helpers.o \
396                                          -c priv/guest_s390_helpers.c
398 priv/guest_ppc_toIR.o: $(ALL_HEADERS) priv/guest_ppc_toIR.c
399         $(CC) $(CCFLAGS) $(ALL_INCLUDES) -o priv/guest_ppc_toIR.o \
400                                          -c priv/guest_ppc_toIR.c
402 priv/guest_s390_toIR.o: $(ALL_HEADERS) priv/guest_s390_toIR.c
403         $(CC) $(CCFLAGS) $(ALL_INCLUDES) -o priv/guest_s390_toIR.o \
404                                          -c priv/guest_s390_toIR.c
406 priv/s390_disasm.o: $(ALL_HEADERS) priv/s390_disasm.c
407         $(CC) $(CCFLAGS) $(ALL_INCLUDES) -o priv/s390_disasm.o \
408                                          -c priv/s390_disasm.c
410 priv/guest_mips_helpers.o: $(ALL_HEADERS) priv/guest_mips_helpers.c
411         $(CC) $(CCFLAGS) $(ALL_INCLUDES) -o priv/guest_mips_helpers.o \
412                                          -c priv/guest_mips_helpers.c
414 priv/guest_mipsdsp_toIR.o: $(ALL_HEADERS) priv/guest_mipsdsp_toIR.c
415         $(CC) $(CCFLAGS) $(ALL_INCLUDES) -o priv/guest_mipsdsp_toIR.o \
416                                          -c priv/guest_mipsdsp_toIR.c
418 priv/guest_mips_toIR.o: $(ALL_HEADERS) priv/guest_mips_toIR.c
419         $(CC) $(CCFLAGS) $(ALL_INCLUDES) -o priv/guest_mips_toIR.o \
420                                          -c priv/guest_mips_toIR.c