blob: 862bee8080f622b1ea016b1f5149924b7fe53b20 [file] [log] [blame]
njn8b68b642009-06-24 00:37:09 +00001# VEX/Makefile is generated from this file at configure-time.
2
3include $(top_srcdir)/Makefile.all.am
4
5#----------------------------------------------------------------------------
6# Headers, etc
7#----------------------------------------------------------------------------
8
9EXTRA_DIST = \
10 HACKING.README \
11 LICENSE.README \
12 LICENSE.GPL \
13 quote.txt \
14 newline.txt \
15 auxprogs/genoffsets.c
16
17pkginclude_HEADERS = \
18 pub/libvex.h \
19 pub/libvex_basictypes.h \
20 pub/libvex_emwarn.h \
21 pub/libvex_guest_offsets.h \
22 pub/libvex_guest_x86.h \
23 pub/libvex_guest_amd64.h \
24 pub/libvex_guest_ppc32.h \
25 pub/libvex_guest_ppc64.h \
26 pub/libvex_guest_arm.h \
27 pub/libvex_ir.h \
28 pub/libvex_trc_values.h
29
30noinst_HEADERS = \
31 priv/main/vex_globals.h \
32 priv/main/vex_util.h \
33 priv/ir/irmatch.h \
34 priv/ir/iropt.h \
35 priv/guest-generic/bb_to_IR.h \
36 priv/guest-generic/g_generic_x87.h \
37 priv/guest-x86/gdefs.h \
38 priv/guest-amd64/gdefs.h \
39 priv/guest-ppc/gdefs.h \
40 priv/guest-arm/gdefs.h \
41 priv/host-generic/h_generic_regs.h \
42 priv/host-generic/h_generic_simd64.h \
43 priv/host-x86/hdefs.h \
44 priv/host-amd64/hdefs.h \
45 priv/host-ppc/hdefs.h \
46 priv/host-arm/hdefs.h
47
48BUILT_SOURCES = pub/libvex_guest_offsets.h
49CLEANFILES = pub/libvex_guest_offsets.h
50
51# This is very uggerly. Need to sed out both "xyzzyN" and
52# "xyzzy$N" since gcc on different targets emits the constants
53# differently -- with a leading $ on x86/amd64 but none on ppc32/64.
54pub/libvex_guest_offsets.h:
55 rm -f auxprogs/genoffsets.s
56 $(CC) $(LIBVEX_CFLAGS) -O -S -o auxprogs/genoffsets.s \
57 auxprogs/genoffsets.c
58 grep xyzzy auxprogs/genoffsets.s | grep define \
59 | sed "s/xyzzy\\$$//g" | sed "s/xyzzy//g" \
60 > pub/libvex_guest_offsets.h
61 rm -f auxprogs/genoffsets.s
62
63#----------------------------------------------------------------------------
64# vex_svnversion.h
65#----------------------------------------------------------------------------
66
67# The contents of vex_svnversion.h depends on the Vex revision number. The
68# ideal way to deal with it would be if SVN had post-update hooks: we'd
69# generate/regenerate it every time we did "svn co"/"svn up", and otherwise
70# never delete it or regenerate it.
71#
72# But SVN lacks post-update hooks. So instead we generate it when building
73# (it's in BUILT_SOURCES) if it's not present (we test for that in the
74# generation rule), or if 'make version' is run. (Thus it can get
75# out-of-date when developing; the 'make version' target lets that be
76# remedied manually.) Otherwise, we never delete it or regenerate it (in
77# particular, it is not present in CLEANFILES). Furthermore, at 'make dist'
78# time, we regenerate it, and copy it into the dist tarball, thus ensuring
79# the distributed version is up-to-date. Note that if a user manually
80# deletes it and rebuilds, or does 'make dist' from a distributed version,
81# it will be regenerated incorrectly, containing the string "exported"
82# instead of the SVN revision number.
83
84BUILT_SOURCES += priv/main/vex_svnversion.h
85
86# Generate it at build time if not present. Nb: generating a file and
87# putting it in $(srcdir) rather than $(builddir) seems like bad form. But
88# because this file won't be regenerated post-distribution, then it's more
89# like a non-generated file and so is reasonable to put in $(srcdir).
90priv/main/vex_svnversion.h: version
91 if [ ! -f priv/main/vex_svnversion.h ] ; then \
92 mv $(top_srcdir)/vex_svnversion.h $(srcdir)/priv/main/; \
93 else \
94 rm -f $(top_srcdir)/vex_svnversion.h; \
95 fi
96
97# Regenerate it and copy it into the dist tarball at 'make dist' time.
98dist-hook: version
99 mv $(top_srcdir)/vex_svnversion.h $(distdir)/priv/main/
100
101# Generate it.
102version:
103 cat quote.txt > $(top_srcdir)/vex_svnversion.h
104 svnversion -n . >> $(top_srcdir)/vex_svnversion.h
105 cat quote.txt >> $(top_srcdir)/vex_svnversion.h
106 cat newline.txt >> $(top_srcdir)/vex_svnversion.h
107
108#----------------------------------------------------------------------------
109# libvex-<platform>.a
110#----------------------------------------------------------------------------
111
112pkglib_LIBRARIES = libvex-@VGCONF_ARCH_PRI@-@VGCONF_OS@.a
113if VGCONF_HAVE_PLATFORM_SEC
114pkglib_LIBRARIES += libvex-@VGCONF_ARCH_SEC@-@VGCONF_OS@.a
115endif
116
117# XXX: automake cannot handle having multiple files of the same name in
118# different directories. The plan is to change the Vex filenames to avoid
119# this. In the meantime, we use some hacky rules to copy the like-named
120# files to differently-named files.
121
122LIBVEX_SOURCES_COMMON = \
123 priv/main/vex_globals.c \
124 priv/main/vex_main.c \
125 priv/main/vex_util.c \
126 priv/ir/irdefs.c \
127 priv/ir/irmatch.c \
128 priv/ir/iropt.c \
129 priv/guest-generic/bb_to_IR.c \
130 priv/guest-generic/g_generic_x87.c \
131 priv/guest-x86/ghelpers-x86.c \
132 priv/guest-x86/toIR-x86.c \
133 priv/guest-amd64/ghelpers-amd64.c \
134 priv/guest-amd64/toIR-amd64.c \
135 priv/guest-ppc/ghelpers-ppc.c \
136 priv/guest-ppc/toIR-ppc.c \
137 priv/guest-arm/ghelpers-arm.c \
138 priv/guest-arm/toIR-arm.c \
139 priv/host-generic/h_generic_regs.c \
140 priv/host-generic/h_generic_simd64.c \
141 priv/host-generic/reg_alloc2.c \
142 priv/host-x86/hdefs-x86.c \
143 priv/host-x86/isel-x86.c \
144 priv/host-amd64/hdefs-amd64.c \
145 priv/host-amd64/isel-amd64.c \
146 priv/host-ppc/hdefs-ppc.c \
147 priv/host-ppc/isel-ppc.c \
148 priv/host-arm/hdefs-arm.c \
149 priv/host-arm/isel-arm.c
150
151# XXX: temporary
152TMP_FILES = \
153 priv/guest-x86/ghelpers-x86.c \
154 priv/guest-amd64/ghelpers-amd64.c \
155 priv/guest-ppc/ghelpers-ppc.c \
156 priv/guest-arm/ghelpers-arm.c \
157 \
158 priv/guest-x86/toIR-x86.c \
159 priv/guest-amd64/toIR-amd64.c \
160 priv/guest-ppc/toIR-ppc.c \
161 priv/guest-arm/toIR-arm.c \
162 \
163 priv/host-x86/hdefs-x86.c \
164 priv/host-amd64/hdefs-amd64.c \
165 priv/host-ppc/hdefs-ppc.c \
166 priv/host-arm/hdefs-arm.c \
167 \
168 priv/host-x86/isel-x86.c \
169 priv/host-amd64/isel-amd64.c \
170 priv/host-ppc/isel-ppc.c \
171 priv/host-arm/isel-arm.c
172
173BUILT_SOURCES += $(TMP_FILES)
174CLEANFILES += $(TMP_FILES)
175
176# XXX: temporary
177EXTRA_DIST += \
178 priv/guest-x86/ghelpers.c \
179 priv/guest-amd64/ghelpers.c \
180 priv/guest-ppc/ghelpers.c \
181 priv/guest-arm/ghelpers.c \
182 \
183 priv/guest-x86/toIR.c \
184 priv/guest-amd64/toIR.c \
185 priv/guest-ppc/toIR.c \
186 priv/guest-arm/toIR.c \
187 \
188 priv/host-x86/hdefs.c \
189 priv/host-amd64/hdefs.c \
190 priv/host-ppc/hdefs.c \
191 priv/host-arm/hdefs.c \
192 \
193 priv/host-x86/isel.c \
194 priv/host-amd64/isel.c \
195 priv/host-ppc/isel.c \
196 priv/host-arm/isel.c
197
198
199# XXX: ghelpers
200priv/guest-x86/ghelpers-x86.c: priv/guest-x86/ghelpers.c
201 cp priv/guest-x86/ghelpers.c priv/guest-x86/ghelpers-x86.c
202
203priv/guest-amd64/ghelpers-amd64.c: priv/guest-amd64/ghelpers.c
204 cp priv/guest-amd64/ghelpers.c priv/guest-amd64/ghelpers-amd64.c
205
206priv/guest-ppc/ghelpers-ppc.c: priv/guest-ppc/ghelpers.c
207 cp priv/guest-ppc/ghelpers.c priv/guest-ppc/ghelpers-ppc.c
208
209priv/guest-arm/ghelpers-arm.c: priv/guest-arm/ghelpers.c
210 cp priv/guest-arm/ghelpers.c priv/guest-arm/ghelpers-arm.c
211
212# XXX: toIR
213priv/guest-x86/toIR-x86.c: priv/guest-x86/toIR.c
214 cp priv/guest-x86/toIR.c priv/guest-x86/toIR-x86.c
215
216priv/guest-amd64/toIR-amd64.c: priv/guest-amd64/toIR.c
217 cp priv/guest-amd64/toIR.c priv/guest-amd64/toIR-amd64.c
218
219priv/guest-ppc/toIR-ppc.c: priv/guest-ppc/toIR.c
220 cp priv/guest-ppc/toIR.c priv/guest-ppc/toIR-ppc.c
221
222priv/guest-arm/toIR-arm.c: priv/guest-arm/toIR.c
223 cp priv/guest-arm/toIR.c priv/guest-arm/toIR-arm.c
224
225# XXX: hdefs
226priv/host-x86/hdefs-x86.c: priv/host-x86/hdefs.c
227 cp priv/host-x86/hdefs.c priv/host-x86/hdefs-x86.c
228
229priv/host-amd64/hdefs-amd64.c: priv/host-amd64/hdefs.c
230 cp priv/host-amd64/hdefs.c priv/host-amd64/hdefs-amd64.c
231
232priv/host-ppc/hdefs-ppc.c: priv/host-ppc/hdefs.c
233 cp priv/host-ppc/hdefs.c priv/host-ppc/hdefs-ppc.c
234
235priv/host-arm/hdefs-arm.c: priv/host-arm/hdefs.c
236 cp priv/host-arm/hdefs.c priv/host-arm/hdefs-arm.c
237
238# XXX: isel
239priv/host-x86/isel-x86.c: priv/host-x86/isel.c
240 cp priv/host-x86/isel.c priv/host-x86/isel-x86.c
241
242priv/host-amd64/isel-amd64.c: priv/host-amd64/isel.c
243 cp priv/host-amd64/isel.c priv/host-amd64/isel-amd64.c
244
245priv/host-ppc/isel-ppc.c: priv/host-ppc/isel.c
246 cp priv/host-ppc/isel.c priv/host-ppc/isel-ppc.c
247
248priv/host-arm/isel-arm.c: priv/host-arm/isel.c
249 cp priv/host-arm/isel.c priv/host-arm/isel-arm.c
250
251
252LIBVEX_CFLAGS = \
253 -Wbad-function-cast \
254 -Wcast-qual \
255 -Wcast-align \
256 -fstrict-aliasing
257
258libvex_@VGCONF_ARCH_PRI@_@VGCONF_OS@_a_SOURCES = $(LIBVEX_SOURCES_COMMON)
259libvex_@VGCONF_ARCH_PRI@_@VGCONF_OS@_a_CPPFLAGS = \
260 $(AM_CPPFLAGS_@VGCONF_PLATFORM_PRI_CAPS@) -Ipriv
261libvex_@VGCONF_ARCH_PRI@_@VGCONF_OS@_a_CFLAGS = \
262 $(AM_CFLAGS_@VGCONF_PLATFORM_PRI_CAPS@) $(LIBVEX_CFLAGS)
263if VGCONF_HAVE_PLATFORM_SEC
264libvex_@VGCONF_ARCH_SEC@_@VGCONF_OS@_a_SOURCES = $(LIBVEX_SOURCES_COMMON)
265libvex_@VGCONF_ARCH_SEC@_@VGCONF_OS@_a_CPPFLAGS = \
266 $(AM_CPPFLAGS_@VGCONF_PLATFORM_SEC_CAPS@) -Ipriv
267libvex_@VGCONF_ARCH_SEC@_@VGCONF_OS@_a_CFLAGS = \
268 $(AM_CFLAGS_@VGCONF_PLATFORM_SEC_CAPS@) $(LIBVEX_CFLAGS)
269endif
270