blob: 57ab3e20ff54c62090f469031c2d2a4ffc9ca0ee [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
njn3f7e9112005-06-19 05:43:21 +000018# Put docs last because building the HTML is slow and we want to get
19# everything else working before we try it.
sewardjbbec7722007-11-25 14:08:53 +000020SUBDIRS = include coregrind . tests perf auxprogs $(TOOLS) $(EXP_TOOLS) docs
njn1d0825f2006-03-27 11:37:07 +000021DIST_SUBDIRS = $(SUBDIRS)
sewardjde4a1d02002-03-22 01:27:54 +000022
njna63e2d72003-06-12 14:13:05 +000023SUPP_FILES = \
sewardj99774242006-10-14 14:03:51 +000024 glibc-2.2.supp glibc-2.3.supp glibc-2.4.supp glibc-2.5.supp \
sewardj84eb4872008-06-03 20:58:46 +000025 glibc-2.6.supp glibc-2.7.supp glibc-2.X.supp.in \
26 aix5libc.supp xfree-3.supp xfree-4.supp \
sewardj68c80c12007-11-18 14:40:02 +000027 glibc-2.34567-NPTL-helgrind.supp \
sewardjbbec7722007-11-25 14:08:53 +000028 glibc-2.2-LinuxThreads-helgrind.supp \
sewardj5744c022008-10-19 18:58:13 +000029 glibc-2.X-drd.supp \
30 exp-ptrcheck.supp
njncfc000e2009-01-20 06:56:26 +000031DEFAULT_SUPP_FILES = @DEFAULT_SUPP@
gobry3b777892002-04-04 09:18:39 +000032
njn13e13192009-05-19 00:32:20 +000033# We include all the base .supp files in the distribution, but not
34# default.supp, as it is built from the base .supp files at compile-time.
35# The "val" in "val_DATA" ties in with $(valdir), defined in
36# Makefile.all.am. From the automake info pages:
37#
38# Sometimes the standard directories--even as augmented by Automake--are
39# not enough. In particular it is sometimes useful, for clarity, to
40# install objects in a subdirectory of some predefined directory. To this
41# end, Automake allows you to extend the list of possible installation
42# directories. A given prefix (e.g., `zar') is valid if a variable of the
43# same name with `dir' appended is defined (e.g., `zardir').
44#
njn254dafe2009-02-09 03:25:04 +000045dist_noinst_DATA = $(SUPP_FILES)
njn13e13192009-05-19 00:32:20 +000046val_DATA = default.supp
gobry3b777892002-04-04 09:18:39 +000047
muellerbddd6072003-11-19 21:50:07 +000048pkgconfigdir = $(libdir)/pkgconfig
49pkgconfig_DATA = valgrind.pc
50
njn541e50e2005-07-26 23:06:18 +000051incincdir = $(includedir)/valgrind
tom97245202005-07-27 09:25:08 +000052nodist_incinc_HEADERS = $(VEX_PUBLIC_HDRS)
njn541e50e2005-07-26 23:06:18 +000053
tomfb7bcde2005-11-07 15:24:38 +000054BUILT_SOURCES = default.supp valgrind.pc
njn13e13192009-05-19 00:32:20 +000055CLEANFILES = default.supp
daywalkerf5ef1852003-02-25 01:48:15 +000056
njn7fd6d382009-01-22 21:56:32 +000057if VGCONF_PLATFORMS_INCLUDE_X86_LINUX
tomfb7bcde2005-11-07 15:24:38 +000058BUILT_SOURCES += valt_load_address_x86_linux.lds
59CLEANFILES += valt_load_address_x86_linux.lds
60endif
njn7fd6d382009-01-22 21:56:32 +000061if VGCONF_PLATFORMS_INCLUDE_AMD64_LINUX
tomfb7bcde2005-11-07 15:24:38 +000062BUILT_SOURCES += valt_load_address_amd64_linux.lds
63CLEANFILES += valt_load_address_amd64_linux.lds
64endif
njn7fd6d382009-01-22 21:56:32 +000065if VGCONF_PLATFORMS_INCLUDE_PPC32_LINUX
tomfb7bcde2005-11-07 15:24:38 +000066BUILT_SOURCES += valt_load_address_ppc32_linux.lds
67CLEANFILES += valt_load_address_ppc32_linux.lds
68endif
njn7fd6d382009-01-22 21:56:32 +000069if VGCONF_PLATFORMS_INCLUDE_PPC64_LINUX
sewardj2c48c7b2005-11-29 13:05:56 +000070BUILT_SOURCES += valt_load_address_ppc64_linux.lds
71CLEANFILES += valt_load_address_ppc64_linux.lds
72endif
njn7fd6d382009-01-22 21:56:32 +000073if VGCONF_PLATFORMS_INCLUDE_PPC32_AIX5
sewardj1eff82b2006-10-17 00:56:43 +000074# No need to generate valt_load_address*.lds; the final executables
75# can be linked to be at any address. They will be relocated by
76# AIX kernel when they are loaded.
77endif
njn7fd6d382009-01-22 21:56:32 +000078if VGCONF_PLATFORMS_INCLUDE_PPC64_AIX5
sewardj1eff82b2006-10-17 00:56:43 +000079# Ditto
80endif
tomfb7bcde2005-11-07 15:24:38 +000081
njncfc000e2009-01-20 06:56:26 +000082default.supp: $(DEFAULT_SUPP_FILES)
83 echo "# This is a generated file, composed of the following suppression rules:" > default.supp
84 echo "# " $(DEFAULT_SUPP_FILES) >> default.supp
85 cat $(DEFAULT_SUPP_FILES) >> default.supp
sewardjde4a1d02002-03-22 01:27:54 +000086
njn71fe3e62003-04-23 21:48:20 +000087## Preprend @PERL@ because tests/vg_regtest isn't executable
daywalkerc60b3a12003-04-23 16:39:31 +000088regtest: check
njnad4e8ab2008-02-10 22:19:58 +000089 @PERL@ tests/vg_regtest $(TOOLS) $(EXP_TOOLS)
90nonexp-regtest: check
sewardjb5f6f512005-03-10 23:59:00 +000091 @PERL@ tests/vg_regtest $(TOOLS)
sewardjbbec7722007-11-25 14:08:53 +000092exp-regtest: check
93 @PERL@ tests/vg_regtest $(EXP_TOOLS)
njn55b98e92003-04-08 10:29:13 +000094
njncc874b52009-01-08 06:07:05 +000095## Preprend @PERL@ because tests/vg_perf isn't executable
njnec0c27a2005-12-10 23:11:28 +000096perf: check
97 @PERL@ perf/vg_perf perf
98
njncdf8a172009-02-06 04:13:52 +000099# Nb: no need to include any Makefile.am files here, or files included from
100# them, as automake includes them automatically.
nethercote537e8942004-08-25 11:40:07 +0000101EXTRA_DIST = \
fitzhardingecf826ad2004-01-07 08:47:44 +0000102 ACKNOWLEDGEMENTS \
nethercote16b59ee2004-10-09 15:59:05 +0000103 README_DEVELOPERS \
nethercote5da1e172003-12-03 21:44:45 +0000104 README_PACKAGERS \
njnf7c00b12005-07-19 21:46:19 +0000105 README_MISSING_SYSCALL_OR_IOCTL \
njn22ae5c02005-07-24 23:21:28 +0000106 valgrind.spec.in valgrind.pc.in \
sewardj6fb87f22008-12-13 18:46:44 +0000107 $(vex_primary_sources) \
108 vg-in-place
sewardjfed4dd02002-04-14 14:32:54 +0000109
gobryb0a955e2002-04-14 15:31:19 +0000110install-exec-hook:
daywalker47160d62002-04-15 00:54:13 +0000111 $(mkinstalldirs) $(DESTDIR)$(valdir)
njn25e49d8e72002-09-23 09:36:25 +0000112
njncfc000e2009-01-20 06:56:26 +0000113all-local: default.supp
nethercoteb7dceef2004-08-25 11:50:46 +0000114 mkdir -p $(inplacedir)
njn40d0df52009-02-09 01:52:55 +0000115 rm -f $(inplacedir)/default.supp
nethercoteb7dceef2004-08-25 11:50:46 +0000116 ln -s ../default.supp $(inplacedir)
fitzhardinge98abfc72003-12-16 02:05:15 +0000117
njnae508b02009-04-24 04:12:28 +0000118clean-local:
nethercoteb7dceef2004-08-25 11:50:46 +0000119 rm -rf $(inplacedir)
sewardj85a9dca2005-07-26 10:42:57 +0000120
tomab568f62005-07-27 07:36:22 +0000121# These list the bits of vex we need to install
sewardj85a9dca2005-07-26 10:42:57 +0000122
njn541e50e2005-07-26 23:06:18 +0000123VEX_PUBLIC_HDRS = \
tomab568f62005-07-27 07:36:22 +0000124 @VEX_DIR@/pub/libvex_guest_amd64.h \
125 @VEX_DIR@/pub/libvex_ir.h \
126 @VEX_DIR@/pub/libvex_guest_ppc32.h \
sewardj2c48c7b2005-11-29 13:05:56 +0000127 @VEX_DIR@/pub/libvex_guest_ppc64.h \
tomab568f62005-07-27 07:36:22 +0000128 @VEX_DIR@/pub/libvex_basictypes.h \
129 @VEX_DIR@/pub/libvex_guest_offsets.h \
130 @VEX_DIR@/pub/libvex_emwarn.h \
131 @VEX_DIR@/pub/libvex.h \
132 @VEX_DIR@/pub/libvex_trc_values.h \
133 @VEX_DIR@/pub/libvex_guest_arm.h \
134 @VEX_DIR@/pub/libvex_guest_x86.h
135
136# These list the bits of vex we need to copy into the tarball
137
dirk9f9ab892006-12-07 15:31:57 +0000138vex_primary_sources = \
sewardj1eff82b2006-10-17 00:56:43 +0000139 VEX/quote.txt \
140 VEX/newline.txt \
sewardjb1916722005-08-03 16:39:44 +0000141 VEX/HACKING.README \
142 VEX/LICENSE.README \
143 VEX/LICENSE.GPL \
tomab568f62005-07-27 07:36:22 +0000144 VEX/Makefile \
145 VEX/auxprogs/genoffsets.c \
sewardj85a9dca2005-07-26 10:42:57 +0000146 VEX/pub/libvex_guest_amd64.h \
147 VEX/pub/libvex_ir.h \
148 VEX/pub/libvex_guest_ppc32.h \
sewardj2c48c7b2005-11-29 13:05:56 +0000149 VEX/pub/libvex_guest_ppc64.h \
sewardj85a9dca2005-07-26 10:42:57 +0000150 VEX/pub/libvex_basictypes.h \
151 VEX/pub/libvex_guest_offsets.h \
152 VEX/pub/libvex_emwarn.h \
153 VEX/pub/libvex.h \
154 VEX/pub/libvex_trc_values.h \
155 VEX/pub/libvex_guest_arm.h \
tomab568f62005-07-27 07:36:22 +0000156 VEX/pub/libvex_guest_x86.h \
sewardj85a9dca2005-07-26 10:42:57 +0000157 VEX/priv/ir/irmatch.c \
158 VEX/priv/ir/irmatch.h \
159 VEX/priv/ir/irdefs.c \
160 VEX/priv/ir/iropt.c \
161 VEX/priv/ir/iropt.h \
cerion0fe14412005-12-23 11:44:40 +0000162 VEX/priv/host-ppc/isel.c \
163 VEX/priv/host-ppc/hdefs.c \
164 VEX/priv/host-ppc/hdefs.h \
sewardj85a9dca2005-07-26 10:42:57 +0000165 VEX/priv/main/vex_svnversion.h \
166 VEX/priv/main/vex_globals.c \
167 VEX/priv/main/vex_globals.h \
168 VEX/priv/main/vex_main.c \
169 VEX/priv/main/vex_util.c \
170 VEX/priv/main/vex_util.h \
171 VEX/priv/guest-arm/ghelpers.c \
172 VEX/priv/guest-arm/gdefs.h \
173 VEX/priv/guest-arm/toIR.c \
174 VEX/priv/guest-x86/ghelpers.c \
175 VEX/priv/guest-x86/gdefs.h \
176 VEX/priv/guest-x86/toIR.c \
177 VEX/priv/guest-generic/g_generic_x87.c \
178 VEX/priv/guest-generic/g_generic_x87.h \
179 VEX/priv/guest-generic/bb_to_IR.c \
180 VEX/priv/guest-generic/bb_to_IR.h \
181 VEX/priv/host-arm/isel.c \
182 VEX/priv/host-arm/hdefs.c \
183 VEX/priv/host-arm/hdefs.h \
184 VEX/priv/host-x86/isel.c \
185 VEX/priv/host-x86/hdefs.c \
186 VEX/priv/host-x86/hdefs.h \
187 VEX/priv/guest-amd64/ghelpers.c \
188 VEX/priv/guest-amd64/gdefs.h \
189 VEX/priv/guest-amd64/toIR.c \
cerion0fe14412005-12-23 11:44:40 +0000190 VEX/priv/guest-ppc/ghelpers.c \
191 VEX/priv/guest-ppc/gdefs.h \
192 VEX/priv/guest-ppc/toIR.c \
sewardj85a9dca2005-07-26 10:42:57 +0000193 VEX/priv/host-generic/reg_alloc2.c \
194 VEX/priv/host-generic/h_generic_regs.c \
195 VEX/priv/host-generic/h_generic_regs.h \
196 VEX/priv/host-generic/h_generic_simd64.c \
197 VEX/priv/host-generic/h_generic_simd64.h \
198 VEX/priv/host-amd64/isel.c \
199 VEX/priv/host-amd64/hdefs.c \
200 VEX/priv/host-amd64/hdefs.h
sewardj45f4e7c2005-09-27 19:20:21 +0000201
202
203# Generate a linker script for linking the binaries. This is the
204# standard gcc linker script, except hacked so that an alternative
205# load address can be specified by (1) asking gcc to use this script
206# (-Wl,-T,valt_load_address.lds) and (2) setting the symbol
207# valt_load_address to the required value
208# (-Wl,-defsym,valt_load_address=0x70000000).
209#
210# Extract ld's default linker script and hack it to our needs.
211# First we cut everything above and below the "=====..." lines at the top
212# and bottom.
213# Then we have to replace the load address with "valt_load_address".
214# The line to replace in has one of the following two forms:
215#
216# . = 0x08048000 + SIZEOF_HEADERS;
217#
218# or
219# PROVIDE (__executable_start = 0x08048000); . = 0x08048000 + SIZEOF_HEADERS;
220#
221# So we search for the line with a hex value "+ SIZEOF_HEADERS", and replace
222# all the hex values in that line with "valt_load_address".
tomfb7bcde2005-11-07 15:24:38 +0000223valt_load_address_x86_linux.lds: Makefile
224 $(CC) @FLAG_M32@ -Wl,--verbose -nostdlib 2>&1 | sed \
sewardj45f4e7c2005-09-27 19:20:21 +0000225 -e '1,/^=====\+$$/d' \
sewardj676fe782008-11-10 15:05:30 +0000226 -e '/^=====\+$$/,/.\*/d' \
sewardj3934b312009-02-14 16:07:40 +0000227 -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 +0000228 || rm -f $@
229
tomfb7bcde2005-11-07 15:24:38 +0000230valt_load_address_amd64_linux.lds: Makefile
231 $(CC) -m64 -Wl,--verbose -nostdlib 2>&1 | sed \
232 -e '1,/^=====\+$$/d' \
sewardj676fe782008-11-10 15:05:30 +0000233 -e '/^=====\+$$/,/.\*/d' \
sewardj3934b312009-02-14 16:07:40 +0000234 -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 +0000235 || rm -f $@
236
237valt_load_address_ppc32_linux.lds: Makefile
sewardj2c48c7b2005-11-29 13:05:56 +0000238 $(CC) @FLAG_M32@ -Wl,--verbose -nostdlib 2>&1 | sed \
239 -e '1,/^=====\+$$/d' \
sewardj676fe782008-11-10 15:05:30 +0000240 -e '/^=====\+$$/,/.\*/d' \
sewardj3934b312009-02-14 16:07:40 +0000241 -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 +0000242 || rm -f $@
243
244valt_load_address_ppc64_linux.lds: Makefile
245 $(CC) -m64 -Wl,--verbose -nostdlib 2>&1 | sed \
tomfb7bcde2005-11-07 15:24:38 +0000246 -e '1,/^=====\+$$/d' \
sewardj676fe782008-11-10 15:05:30 +0000247 -e '/^=====\+$$/,/.\*/d' \
sewardj3934b312009-02-14 16:07:40 +0000248 -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 +0000249 || rm -f $@