blob: 010620922b17bb57223a43982f79583383c61ec8 [file] [log] [blame]
njn25e49d8e72002-09-23 09:36:25 +00001
tomd9fa7512005-11-30 00:03:58 +00002AUTOMAKE_OPTIONS = foreign 1.7 dist-bzip2
sewardj31f6cb52003-03-01 01:26:55 +00003
njn3e986b22004-11-30 10:43:45 +00004include $(top_srcdir)/Makefile.all.am
nethercote4388a402004-09-01 23:20:49 +00005
njn86f12dc2005-03-14 01:16:05 +00006TOOLS = memcheck \
njn6a3009b2005-03-20 00:20:06 +00007 cachegrind \
weidendoa17f2a32006-03-20 10:27:30 +00008 callgrind \
njn6a3009b2005-03-20 00:20:06 +00009 massif \
10 lackey \
sewardj99a2ceb2007-11-09 12:30:36 +000011 none \
bartccf17de2008-07-04 15:14:35 +000012 helgrind \
13 drd
sewardjbbec7722007-11-25 14:08:53 +000014
sewardj9c606bd2008-09-18 18:12:50 +000015EXP_TOOLS = exp-omega \
16 exp-ptrcheck
sewardjb5f6f512005-03-10 23:59:00 +000017
njnf76d27a2009-05-28 01:53:07 +000018# DDD: once all tools work on Darwin, TEST_TOOLS and TEST_EXP_TOOLS can be
19# replaced with TOOLS and EXP_TOOLS.
20if !VGCONF_OS_IS_DARWIN
21 TEST_TOOLS = $(TOOLS)
22 TEST_EXP_TOOLS = $(EXP_TOOLS)
23else
24 TEST_TOOLS = memcheck \
25 cachegrind \
26 callgrind \
27 massif \
28 lackey \
29 none
30
31 TEST_EXP_TOOLS = exp-omega
32endif
33
njn3f7e9112005-06-19 05:43:21 +000034# Put docs last because building the HTML is slow and we want to get
35# everything else working before we try it.
sewardjbbec7722007-11-25 14:08:53 +000036SUBDIRS = include coregrind . tests perf auxprogs $(TOOLS) $(EXP_TOOLS) docs
njn1d0825f2006-03-27 11:37:07 +000037DIST_SUBDIRS = $(SUBDIRS)
sewardjde4a1d02002-03-22 01:27:54 +000038
njna63e2d72003-06-12 14:13:05 +000039SUPP_FILES = \
sewardj99774242006-10-14 14:03:51 +000040 glibc-2.2.supp glibc-2.3.supp glibc-2.4.supp glibc-2.5.supp \
sewardj84eb4872008-06-03 20:58:46 +000041 glibc-2.6.supp glibc-2.7.supp glibc-2.X.supp.in \
42 aix5libc.supp xfree-3.supp xfree-4.supp \
sewardj68c80c12007-11-18 14:40:02 +000043 glibc-2.34567-NPTL-helgrind.supp \
sewardjbbec7722007-11-25 14:08:53 +000044 glibc-2.2-LinuxThreads-helgrind.supp \
sewardj5744c022008-10-19 18:58:13 +000045 glibc-2.X-drd.supp \
njnf76d27a2009-05-28 01:53:07 +000046 exp-ptrcheck.supp \
47 darwin9.supp
njncfc000e2009-01-20 06:56:26 +000048DEFAULT_SUPP_FILES = @DEFAULT_SUPP@
gobry3b777892002-04-04 09:18:39 +000049
njn13e13192009-05-19 00:32:20 +000050# We include all the base .supp files in the distribution, but not
51# default.supp, as it is built from the base .supp files at compile-time.
52# The "val" in "val_DATA" ties in with $(valdir), defined in
53# Makefile.all.am. From the automake info pages:
54#
55# Sometimes the standard directories--even as augmented by Automake--are
56# not enough. In particular it is sometimes useful, for clarity, to
57# install objects in a subdirectory of some predefined directory. To this
58# end, Automake allows you to extend the list of possible installation
59# directories. A given prefix (e.g., `zar') is valid if a variable of the
60# same name with `dir' appended is defined (e.g., `zardir').
61#
njn254dafe2009-02-09 03:25:04 +000062dist_noinst_DATA = $(SUPP_FILES)
njn13e13192009-05-19 00:32:20 +000063val_DATA = default.supp
gobry3b777892002-04-04 09:18:39 +000064
muellerbddd6072003-11-19 21:50:07 +000065pkgconfigdir = $(libdir)/pkgconfig
66pkgconfig_DATA = valgrind.pc
67
njn541e50e2005-07-26 23:06:18 +000068incincdir = $(includedir)/valgrind
tom97245202005-07-27 09:25:08 +000069nodist_incinc_HEADERS = $(VEX_PUBLIC_HDRS)
njn541e50e2005-07-26 23:06:18 +000070
tomfb7bcde2005-11-07 15:24:38 +000071BUILT_SOURCES = default.supp valgrind.pc
njn13e13192009-05-19 00:32:20 +000072CLEANFILES = default.supp
daywalkerf5ef1852003-02-25 01:48:15 +000073
njn7fd6d382009-01-22 21:56:32 +000074if VGCONF_PLATFORMS_INCLUDE_X86_LINUX
tomfb7bcde2005-11-07 15:24:38 +000075BUILT_SOURCES += valt_load_address_x86_linux.lds
76CLEANFILES += valt_load_address_x86_linux.lds
77endif
njn7fd6d382009-01-22 21:56:32 +000078if VGCONF_PLATFORMS_INCLUDE_AMD64_LINUX
tomfb7bcde2005-11-07 15:24:38 +000079BUILT_SOURCES += valt_load_address_amd64_linux.lds
80CLEANFILES += valt_load_address_amd64_linux.lds
81endif
njn7fd6d382009-01-22 21:56:32 +000082if VGCONF_PLATFORMS_INCLUDE_PPC32_LINUX
tomfb7bcde2005-11-07 15:24:38 +000083BUILT_SOURCES += valt_load_address_ppc32_linux.lds
84CLEANFILES += valt_load_address_ppc32_linux.lds
85endif
njn7fd6d382009-01-22 21:56:32 +000086if VGCONF_PLATFORMS_INCLUDE_PPC64_LINUX
sewardj2c48c7b2005-11-29 13:05:56 +000087BUILT_SOURCES += valt_load_address_ppc64_linux.lds
88CLEANFILES += valt_load_address_ppc64_linux.lds
89endif
njn7fd6d382009-01-22 21:56:32 +000090if VGCONF_PLATFORMS_INCLUDE_PPC32_AIX5
sewardj1eff82b2006-10-17 00:56:43 +000091# No need to generate valt_load_address*.lds; the final executables
92# can be linked to be at any address. They will be relocated by
93# AIX kernel when they are loaded.
94endif
njn7fd6d382009-01-22 21:56:32 +000095if VGCONF_PLATFORMS_INCLUDE_PPC64_AIX5
sewardj1eff82b2006-10-17 00:56:43 +000096# Ditto
97endif
njnf76d27a2009-05-28 01:53:07 +000098if VGCONF_OS_IS_DARWIN
99# GrP untested, possibly hopeless
100endif
tomfb7bcde2005-11-07 15:24:38 +0000101
njncfc000e2009-01-20 06:56:26 +0000102default.supp: $(DEFAULT_SUPP_FILES)
103 echo "# This is a generated file, composed of the following suppression rules:" > default.supp
104 echo "# " $(DEFAULT_SUPP_FILES) >> default.supp
105 cat $(DEFAULT_SUPP_FILES) >> default.supp
sewardjde4a1d02002-03-22 01:27:54 +0000106
njn71fe3e62003-04-23 21:48:20 +0000107## Preprend @PERL@ because tests/vg_regtest isn't executable
daywalkerc60b3a12003-04-23 16:39:31 +0000108regtest: check
njnf76d27a2009-05-28 01:53:07 +0000109 @PERL@ tests/vg_regtest $(TEST_TOOLS) $(TEST_EXP_TOOLS)
njnad4e8ab2008-02-10 22:19:58 +0000110nonexp-regtest: check
njnf76d27a2009-05-28 01:53:07 +0000111 @PERL@ tests/vg_regtest $(TEST_TOOLS)
sewardjbbec7722007-11-25 14:08:53 +0000112exp-regtest: check
njnf76d27a2009-05-28 01:53:07 +0000113 @PERL@ tests/vg_regtest $(TEST_EXP_TOOLS)
njn55b98e92003-04-08 10:29:13 +0000114
njncc874b52009-01-08 06:07:05 +0000115## Preprend @PERL@ because tests/vg_perf isn't executable
njnec0c27a2005-12-10 23:11:28 +0000116perf: check
117 @PERL@ perf/vg_perf perf
118
njncdf8a172009-02-06 04:13:52 +0000119# Nb: no need to include any Makefile.am files here, or files included from
120# them, as automake includes them automatically.
nethercote537e8942004-08-25 11:40:07 +0000121EXTRA_DIST = \
fitzhardingecf826ad2004-01-07 08:47:44 +0000122 ACKNOWLEDGEMENTS \
nethercote16b59ee2004-10-09 15:59:05 +0000123 README_DEVELOPERS \
nethercote5da1e172003-12-03 21:44:45 +0000124 README_PACKAGERS \
njnf7c00b12005-07-19 21:46:19 +0000125 README_MISSING_SYSCALL_OR_IOCTL \
njn22ae5c02005-07-24 23:21:28 +0000126 valgrind.spec.in valgrind.pc.in \
sewardj6fb87f22008-12-13 18:46:44 +0000127 $(vex_primary_sources) \
128 vg-in-place
sewardjfed4dd02002-04-14 14:32:54 +0000129
gobryb0a955e2002-04-14 15:31:19 +0000130install-exec-hook:
daywalker47160d62002-04-15 00:54:13 +0000131 $(mkinstalldirs) $(DESTDIR)$(valdir)
njn25e49d8e72002-09-23 09:36:25 +0000132
njncfc000e2009-01-20 06:56:26 +0000133all-local: default.supp
nethercoteb7dceef2004-08-25 11:50:46 +0000134 mkdir -p $(inplacedir)
njn40d0df52009-02-09 01:52:55 +0000135 rm -f $(inplacedir)/default.supp
nethercoteb7dceef2004-08-25 11:50:46 +0000136 ln -s ../default.supp $(inplacedir)
fitzhardinge98abfc72003-12-16 02:05:15 +0000137
njnae508b02009-04-24 04:12:28 +0000138clean-local:
nethercoteb7dceef2004-08-25 11:50:46 +0000139 rm -rf $(inplacedir)
sewardj85a9dca2005-07-26 10:42:57 +0000140
tomab568f62005-07-27 07:36:22 +0000141# These list the bits of vex we need to install
sewardj85a9dca2005-07-26 10:42:57 +0000142
njn541e50e2005-07-26 23:06:18 +0000143VEX_PUBLIC_HDRS = \
tomab568f62005-07-27 07:36:22 +0000144 @VEX_DIR@/pub/libvex_guest_amd64.h \
145 @VEX_DIR@/pub/libvex_ir.h \
146 @VEX_DIR@/pub/libvex_guest_ppc32.h \
sewardj2c48c7b2005-11-29 13:05:56 +0000147 @VEX_DIR@/pub/libvex_guest_ppc64.h \
tomab568f62005-07-27 07:36:22 +0000148 @VEX_DIR@/pub/libvex_basictypes.h \
149 @VEX_DIR@/pub/libvex_guest_offsets.h \
150 @VEX_DIR@/pub/libvex_emwarn.h \
151 @VEX_DIR@/pub/libvex.h \
152 @VEX_DIR@/pub/libvex_trc_values.h \
153 @VEX_DIR@/pub/libvex_guest_arm.h \
154 @VEX_DIR@/pub/libvex_guest_x86.h
155
156# These list the bits of vex we need to copy into the tarball
157
dirk9f9ab892006-12-07 15:31:57 +0000158vex_primary_sources = \
sewardj1eff82b2006-10-17 00:56:43 +0000159 VEX/quote.txt \
160 VEX/newline.txt \
sewardjb1916722005-08-03 16:39:44 +0000161 VEX/HACKING.README \
162 VEX/LICENSE.README \
163 VEX/LICENSE.GPL \
tomab568f62005-07-27 07:36:22 +0000164 VEX/Makefile \
165 VEX/auxprogs/genoffsets.c \
sewardj85a9dca2005-07-26 10:42:57 +0000166 VEX/pub/libvex_guest_amd64.h \
167 VEX/pub/libvex_ir.h \
168 VEX/pub/libvex_guest_ppc32.h \
sewardj2c48c7b2005-11-29 13:05:56 +0000169 VEX/pub/libvex_guest_ppc64.h \
sewardj85a9dca2005-07-26 10:42:57 +0000170 VEX/pub/libvex_basictypes.h \
171 VEX/pub/libvex_guest_offsets.h \
172 VEX/pub/libvex_emwarn.h \
173 VEX/pub/libvex.h \
174 VEX/pub/libvex_trc_values.h \
175 VEX/pub/libvex_guest_arm.h \
tomab568f62005-07-27 07:36:22 +0000176 VEX/pub/libvex_guest_x86.h \
sewardj85a9dca2005-07-26 10:42:57 +0000177 VEX/priv/ir/irmatch.c \
178 VEX/priv/ir/irmatch.h \
179 VEX/priv/ir/irdefs.c \
180 VEX/priv/ir/iropt.c \
181 VEX/priv/ir/iropt.h \
cerion0fe14412005-12-23 11:44:40 +0000182 VEX/priv/host-ppc/isel.c \
183 VEX/priv/host-ppc/hdefs.c \
184 VEX/priv/host-ppc/hdefs.h \
sewardj85a9dca2005-07-26 10:42:57 +0000185 VEX/priv/main/vex_svnversion.h \
186 VEX/priv/main/vex_globals.c \
187 VEX/priv/main/vex_globals.h \
188 VEX/priv/main/vex_main.c \
189 VEX/priv/main/vex_util.c \
190 VEX/priv/main/vex_util.h \
191 VEX/priv/guest-arm/ghelpers.c \
192 VEX/priv/guest-arm/gdefs.h \
193 VEX/priv/guest-arm/toIR.c \
194 VEX/priv/guest-x86/ghelpers.c \
195 VEX/priv/guest-x86/gdefs.h \
196 VEX/priv/guest-x86/toIR.c \
197 VEX/priv/guest-generic/g_generic_x87.c \
198 VEX/priv/guest-generic/g_generic_x87.h \
199 VEX/priv/guest-generic/bb_to_IR.c \
200 VEX/priv/guest-generic/bb_to_IR.h \
201 VEX/priv/host-arm/isel.c \
202 VEX/priv/host-arm/hdefs.c \
203 VEX/priv/host-arm/hdefs.h \
204 VEX/priv/host-x86/isel.c \
205 VEX/priv/host-x86/hdefs.c \
206 VEX/priv/host-x86/hdefs.h \
207 VEX/priv/guest-amd64/ghelpers.c \
208 VEX/priv/guest-amd64/gdefs.h \
209 VEX/priv/guest-amd64/toIR.c \
cerion0fe14412005-12-23 11:44:40 +0000210 VEX/priv/guest-ppc/ghelpers.c \
211 VEX/priv/guest-ppc/gdefs.h \
212 VEX/priv/guest-ppc/toIR.c \
sewardj85a9dca2005-07-26 10:42:57 +0000213 VEX/priv/host-generic/reg_alloc2.c \
214 VEX/priv/host-generic/h_generic_regs.c \
215 VEX/priv/host-generic/h_generic_regs.h \
216 VEX/priv/host-generic/h_generic_simd64.c \
217 VEX/priv/host-generic/h_generic_simd64.h \
218 VEX/priv/host-amd64/isel.c \
219 VEX/priv/host-amd64/hdefs.c \
220 VEX/priv/host-amd64/hdefs.h
sewardj45f4e7c2005-09-27 19:20:21 +0000221
222
223# Generate a linker script for linking the binaries. This is the
224# standard gcc linker script, except hacked so that an alternative
225# load address can be specified by (1) asking gcc to use this script
226# (-Wl,-T,valt_load_address.lds) and (2) setting the symbol
227# valt_load_address to the required value
228# (-Wl,-defsym,valt_load_address=0x70000000).
229#
230# Extract ld's default linker script and hack it to our needs.
231# First we cut everything above and below the "=====..." lines at the top
232# and bottom.
233# Then we have to replace the load address with "valt_load_address".
234# The line to replace in has one of the following two forms:
235#
236# . = 0x08048000 + SIZEOF_HEADERS;
237#
238# or
239# PROVIDE (__executable_start = 0x08048000); . = 0x08048000 + SIZEOF_HEADERS;
240#
241# So we search for the line with a hex value "+ SIZEOF_HEADERS", and replace
242# all the hex values in that line with "valt_load_address".
tomfb7bcde2005-11-07 15:24:38 +0000243valt_load_address_x86_linux.lds: Makefile
244 $(CC) @FLAG_M32@ -Wl,--verbose -nostdlib 2>&1 | sed \
sewardj45f4e7c2005-09-27 19:20:21 +0000245 -e '1,/^=====\+$$/d' \
sewardj676fe782008-11-10 15:05:30 +0000246 -e '/^=====\+$$/,/.\*/d' \
sewardj3934b312009-02-14 16:07:40 +0000247 -e '/\. = \(0x[0-9A-Fa-f]\+\|SEGMENT_START("[^"]\+", 0x[0-9A-Fa-f]\+)\) + SIZEOF_HEADERS/s/0x[0-9A-Fa-f]\+/valt_load_address/g' > $@ \
sewardj45f4e7c2005-09-27 19:20:21 +0000248 || rm -f $@
249
tomfb7bcde2005-11-07 15:24:38 +0000250valt_load_address_amd64_linux.lds: Makefile
251 $(CC) -m64 -Wl,--verbose -nostdlib 2>&1 | sed \
252 -e '1,/^=====\+$$/d' \
sewardj676fe782008-11-10 15:05:30 +0000253 -e '/^=====\+$$/,/.\*/d' \
sewardj3934b312009-02-14 16:07:40 +0000254 -e '/\. = \(0x[0-9A-Fa-f]\+\|SEGMENT_START("[^"]\+", 0x[0-9A-Fa-f]\+)\) + SIZEOF_HEADERS/s/0x[0-9A-Fa-f]\+/valt_load_address/g' > $@ \
tomfb7bcde2005-11-07 15:24:38 +0000255 || rm -f $@
256
257valt_load_address_ppc32_linux.lds: Makefile
sewardj2c48c7b2005-11-29 13:05:56 +0000258 $(CC) @FLAG_M32@ -Wl,--verbose -nostdlib 2>&1 | sed \
259 -e '1,/^=====\+$$/d' \
sewardj676fe782008-11-10 15:05:30 +0000260 -e '/^=====\+$$/,/.\*/d' \
sewardj3934b312009-02-14 16:07:40 +0000261 -e '/\. = \(0x[0-9A-Fa-f]\+\|SEGMENT_START("[^"]\+", 0x[0-9A-Fa-f]\+)\) + SIZEOF_HEADERS/s/0x[0-9A-Fa-f]\+/valt_load_address/g' > $@ \
sewardj2c48c7b2005-11-29 13:05:56 +0000262 || rm -f $@
263
264valt_load_address_ppc64_linux.lds: Makefile
265 $(CC) -m64 -Wl,--verbose -nostdlib 2>&1 | sed \
tomfb7bcde2005-11-07 15:24:38 +0000266 -e '1,/^=====\+$$/d' \
sewardj676fe782008-11-10 15:05:30 +0000267 -e '/^=====\+$$/,/.\*/d' \
sewardj3934b312009-02-14 16:07:40 +0000268 -e '/\. = \(0x[0-9A-Fa-f]\+\|SEGMENT_START("[^"]\+", 0x[0-9A-Fa-f]\+)\) + SIZEOF_HEADERS/s/0x[0-9A-Fa-f]\+/valt_load_address/g' > $@ \
tomfb7bcde2005-11-07 15:24:38 +0000269 || rm -f $@