-
Notifications
You must be signed in to change notification settings - Fork 8
/
Makefile.vex.am
215 lines (197 loc) · 6.62 KB
/
Makefile.vex.am
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
# VEX/Makefile is generated from this file at configure-time.
include $(top_srcdir)/Makefile.all.am
#----------------------------------------------------------------------------
# Headers, etc
#----------------------------------------------------------------------------
EXTRA_DIST = \
HACKING.README \
LICENSE.README \
LICENSE.GPL \
auxprogs/genoffsets.c
pkginclude_HEADERS = \
pub/libvex.h \
pub/libvex_basictypes.h \
pub/libvex_emnote.h \
pub/libvex_guest_offsets.h \
pub/libvex_guest_x86.h \
pub/libvex_guest_amd64.h \
pub/libvex_guest_ppc32.h \
pub/libvex_guest_ppc64.h \
pub/libvex_guest_arm.h \
pub/libvex_guest_arm64.h \
pub/libvex_guest_s390x.h \
pub/libvex_guest_mips32.h \
pub/libvex_guest_mips64.h \
pub/libvex_s390x_common.h \
pub/libvex_ir.h \
pub/libvex_trc_values.h \
pub/libvex_inner.h
# libvex_inner.h is special: it is a public header for valgrind core,
# but should not be used by the end user
noinst_HEADERS = \
priv/main_globals.h \
priv/main_util.h \
priv/ir_match.h \
priv/ir_opt.h \
priv/guest_generic_bb_to_IR.h \
priv/guest_generic_x87.h \
priv/guest_x86_defs.h \
priv/guest_amd64_defs.h \
priv/guest_ppc_defs.h \
priv/guest_arm_defs.h \
priv/guest_arm64_defs.h \
priv/guest_s390_defs.h \
priv/guest_mips_defs.h \
priv/mips_defs.h \
priv/guest_nanomips_defs.h \
priv/host_generic_regs.h \
priv/host_generic_simd64.h \
priv/host_generic_simd128.h \
priv/host_generic_simd256.h \
priv/host_generic_maddf.h \
priv/host_x86_defs.h \
priv/host_amd64_defs.h \
priv/host_ppc_defs.h \
priv/host_arm_defs.h \
priv/host_arm64_defs.h \
priv/host_s390_defs.h \
priv/s390_disasm.h \
priv/s390_defs.h \
priv/host_mips_defs.h \
priv/host_nanomips_defs.h \
priv/common_nanomips_defs.h
BUILT_SOURCES = pub/libvex_guest_offsets.h
CLEANFILES = pub/libvex_guest_offsets.h
if COMPILER_IS_CLANG
CFLAGS_FOR_GENOFFSETS = $(CFLAGS) -no-integrated-as
else
CFLAGS_FOR_GENOFFSETS = $(CFLAGS)
endif
# for VEX building, use the LTO versions, in case they differ from non lto versions
AR = ${LTO_AR}
RANLIB = ${LTO_RANLIB}
# This is very uggerly. Need to sed out both "xyzzyN" and
# "xyzzy$N" since gcc on different targets emits the constants
# differently -- with a leading $ on x86/amd64 but none on ppc32/64.
# ICC also emits the constants differently with a leading # #define
pub/libvex_guest_offsets.h: auxprogs/genoffsets.c \
pub/libvex_basictypes.h \
pub/libvex_guest_x86.h \
pub/libvex_guest_amd64.h \
pub/libvex_guest_ppc32.h \
pub/libvex_guest_ppc64.h \
pub/libvex_guest_arm.h \
pub/libvex_guest_arm64.h \
pub/libvex_guest_s390x.h \
pub/libvex_guest_mips32.h \
pub/libvex_guest_mips64.h
rm -f auxprogs/genoffsets.s
$(mkdir_p) auxprogs pub
$(CC) $(CFLAGS_FOR_GENOFFSETS) \
$(LIBVEX_CFLAGS_NO_LTO) \
$(AM_CFLAGS_@VGCONF_PLATFORM_PRI_CAPS@) \
-O -S -o auxprogs/genoffsets.s \
$(srcdir)/auxprogs/genoffsets.c
grep xyzzy auxprogs/genoffsets.s | grep "^[# ]*#define" \
| sed "s/# #define/#define/g" \
| sed "s/xyzzy\\$$//g" \
| sed "s/xyzzy#//g" \
| sed "s/xyzzy//g" \
> pub/libvex_guest_offsets.h
rm -f auxprogs/genoffsets.s
#----------------------------------------------------------------------------
# libvex-<platform>-<os>.a : containing all VEX objects, including
# a main_main.o compiled in single arch (guest==host).
# libvexmultiarch-<platform>-<os>.a, only containing multiarch_main_main.o,
# which is main_main.c compiled so that any guest/host combination
# can be done at runtime.
#----------------------------------------------------------------------------
pkglib_LIBRARIES = libvex-@VGCONF_ARCH_PRI@-@[email protected] \
libvexmultiarch-@VGCONF_ARCH_PRI@-@[email protected]
if VGCONF_HAVE_PLATFORM_SEC
pkglib_LIBRARIES += libvex-@VGCONF_ARCH_SEC@-@[email protected] \
libvexmultiarch-@VGCONF_ARCH_SEC@-@[email protected]
endif
LIBVEX_SOURCES_COMMON = \
priv/main_globals.c \
priv/main_main.c \
priv/main_util.c \
priv/ir_defs.c \
priv/ir_inject.c \
priv/ir_match.c \
priv/ir_opt.c \
priv/guest_generic_bb_to_IR.c \
priv/guest_generic_x87.c \
priv/guest_x86_helpers.c \
priv/guest_x86_toIR.c \
priv/guest_amd64_helpers.c \
priv/guest_amd64_toIR.c \
priv/guest_ppc_helpers.c \
priv/guest_ppc_toIR.c \
priv/guest_arm_helpers.c \
priv/guest_arm_toIR.c \
priv/guest_arm64_helpers.c \
priv/guest_arm64_toIR.c \
priv/guest_s390_helpers.c \
priv/guest_s390_toIR.c \
priv/guest_mips_helpers.c \
priv/guest_mipsdsp_toIR.c \
priv/guest_mips_toIR.c \
priv/guest_nanomips_helpers.c \
priv/guest_nanomips_toIR.c \
priv/host_generic_regs.c \
priv/host_generic_simd64.c \
priv/host_generic_simd128.c \
priv/host_generic_simd256.c \
priv/host_generic_maddf.c \
priv/host_generic_reg_alloc2.c \
priv/host_generic_reg_alloc3.c \
priv/host_x86_defs.c \
priv/host_x86_isel.c \
priv/host_amd64_defs.c \
priv/host_amd64_isel.c \
priv/host_ppc_defs.c \
priv/host_ppc_isel.c \
priv/host_arm_defs.c \
priv/host_arm_isel.c \
priv/host_arm64_defs.c \
priv/host_arm64_isel.c \
priv/host_s390_defs.c \
priv/host_s390_isel.c \
priv/s390_disasm.c \
priv/host_mips_defs.c \
priv/host_nanomips_defs.c \
priv/host_mips_isel.c \
priv/host_nanomips_isel.c
LIBVEXMULTIARCH_SOURCES = priv/multiarch_main_main.c
LIBVEX_CFLAGS_NO_LTO = \
-Wbad-function-cast \
-fstrict-aliasing
LIBVEX_CFLAGS = ${LTO_CFLAGS} \
${LIBVEX_CFLAGS_NO_LTO}
libvex_@VGCONF_ARCH_PRI@_@VGCONF_OS@_a_SOURCES = $(LIBVEX_SOURCES_COMMON)
libvex_@VGCONF_ARCH_PRI@_@VGCONF_OS@_a_CPPFLAGS = \
$(AM_CPPFLAGS_@VGCONF_PLATFORM_PRI_CAPS@) -Ipriv
libvex_@VGCONF_ARCH_PRI@_@VGCONF_OS@_a_CFLAGS = \
$(AM_CFLAGS_@VGCONF_PLATFORM_PRI_CAPS@) $(LIBVEX_CFLAGS)
if VGCONF_HAVE_PLATFORM_SEC
libvex_@VGCONF_ARCH_SEC@_@VGCONF_OS@_a_SOURCES = $(LIBVEX_SOURCES_COMMON)
libvex_@VGCONF_ARCH_SEC@_@VGCONF_OS@_a_CPPFLAGS = \
$(AM_CPPFLAGS_@VGCONF_PLATFORM_SEC_CAPS@) -Ipriv
libvex_@VGCONF_ARCH_SEC@_@VGCONF_OS@_a_CFLAGS = \
$(AM_CFLAGS_@VGCONF_PLATFORM_SEC_CAPS@) $(LIBVEX_CFLAGS)
endif
libvexmultiarch_@VGCONF_ARCH_PRI@_@VGCONF_OS@_a_SOURCES = \
$(LIBVEXMULTIARCH_SOURCES)
libvexmultiarch_@VGCONF_ARCH_PRI@_@VGCONF_OS@_a_CPPFLAGS = \
$(AM_CPPFLAGS_@VGCONF_PLATFORM_PRI_CAPS@) -Ipriv
libvexmultiarch_@VGCONF_ARCH_PRI@_@VGCONF_OS@_a_CFLAGS = \
$(AM_CFLAGS_@VGCONF_PLATFORM_PRI_CAPS@) $(LIBVEX_CFLAGS)
if VGCONF_HAVE_PLATFORM_SEC
libvexmultiarch_@VGCONF_ARCH_SEC@_@VGCONF_OS@_a_SOURCES = \
$(LIBVEXMULTIARCH_SOURCES)
libvexmultiarch_@VGCONF_ARCH_SEC@_@VGCONF_OS@_a_CPPFLAGS = \
$(AM_CPPFLAGS_@VGCONF_PLATFORM_SEC_CAPS@) -Ipriv
libvexmultiarch_@VGCONF_ARCH_SEC@_@VGCONF_OS@_a_CFLAGS = \
$(AM_CFLAGS_@VGCONF_PLATFORM_SEC_CAPS@) $(LIBVEX_CFLAGS)
endif