blob: a9694a335b84e823fcba81bc2f740e055bef5627 [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 \
sewardj0ab55482007-11-09 23:30:51 +000012 helgrind \
sewardj99a2ceb2007-11-09 12:30:36 +000013 exp-omega
sewardjb5f6f512005-03-10 23:59:00 +000014
njn3f7e9112005-06-19 05:43:21 +000015# Put docs last because building the HTML is slow and we want to get
16# everything else working before we try it.
sewardj0ab55482007-11-09 23:30:51 +000017SUBDIRS = include coregrind . tests perf auxprogs $(TOOLS) docs
njn1d0825f2006-03-27 11:37:07 +000018DIST_SUBDIRS = $(SUBDIRS)
sewardjde4a1d02002-03-22 01:27:54 +000019
njna63e2d72003-06-12 14:13:05 +000020SUPP_FILES = \
sewardj99774242006-10-14 14:03:51 +000021 glibc-2.2.supp glibc-2.3.supp glibc-2.4.supp glibc-2.5.supp \
sewardj0ab55482007-11-09 23:30:51 +000022 glibc-2.6.supp aix5libc.supp xfree-3.supp xfree-4.supp \
23 glibc-2.X-helgrind.supp
gobry3b777892002-04-04 09:18:39 +000024
nethercote537e8942004-08-25 11:40:07 +000025dist_val_DATA = $(SUPP_FILES) default.supp
gobry3b777892002-04-04 09:18:39 +000026
muellerbddd6072003-11-19 21:50:07 +000027pkgconfigdir = $(libdir)/pkgconfig
28pkgconfig_DATA = valgrind.pc
29
njn541e50e2005-07-26 23:06:18 +000030incincdir = $(includedir)/valgrind
tom97245202005-07-27 09:25:08 +000031nodist_incinc_HEADERS = $(VEX_PUBLIC_HDRS)
njn541e50e2005-07-26 23:06:18 +000032
tomfb7bcde2005-11-07 15:24:38 +000033BUILT_SOURCES = default.supp valgrind.pc
34CLEANFILES =
njnda762d42003-09-29 20:50:49 +000035DISTCLEANFILES = default.supp
daywalkerf5ef1852003-02-25 01:48:15 +000036
sewardj1eff82b2006-10-17 00:56:43 +000037if VGP_X86_LINUX
tomfb7bcde2005-11-07 15:24:38 +000038BUILT_SOURCES += valt_load_address_x86_linux.lds
39CLEANFILES += valt_load_address_x86_linux.lds
40endif
sewardj1eff82b2006-10-17 00:56:43 +000041if VGP_AMD64_LINUX
tomfb7bcde2005-11-07 15:24:38 +000042BUILT_SOURCES += valt_load_address_amd64_linux.lds
43CLEANFILES += valt_load_address_amd64_linux.lds
44endif
sewardj1eff82b2006-10-17 00:56:43 +000045if VGP_PPC32_LINUX
tomfb7bcde2005-11-07 15:24:38 +000046BUILT_SOURCES += valt_load_address_ppc32_linux.lds
47CLEANFILES += valt_load_address_ppc32_linux.lds
48endif
sewardj1eff82b2006-10-17 00:56:43 +000049if VGP_PPC64_LINUX
sewardj2c48c7b2005-11-29 13:05:56 +000050BUILT_SOURCES += valt_load_address_ppc64_linux.lds
51CLEANFILES += valt_load_address_ppc64_linux.lds
52endif
sewardj1eff82b2006-10-17 00:56:43 +000053if VGP_PPC32_AIX5
54# No need to generate valt_load_address*.lds; the final executables
55# can be linked to be at any address. They will be relocated by
56# AIX kernel when they are loaded.
57endif
58if VGP_PPC64_AIX5
59# Ditto
60endif
tomfb7bcde2005-11-07 15:24:38 +000061
gobry3b777892002-04-04 09:18:39 +000062default.supp: $(SUPP_FILES)
sewardjde4a1d02002-03-22 01:27:54 +000063
njn71fe3e62003-04-23 21:48:20 +000064## Preprend @PERL@ because tests/vg_regtest isn't executable
daywalkerc60b3a12003-04-23 16:39:31 +000065regtest: check
sewardjb5f6f512005-03-10 23:59:00 +000066 @PERL@ tests/vg_regtest $(TOOLS)
njn55b98e92003-04-08 10:29:13 +000067
njnec0c27a2005-12-10 23:11:28 +000068## Preprend @PERL@ because tests/vg_per isn't executable
69perf: check
70 @PERL@ perf/vg_perf perf
71
nethercote537e8942004-08-25 11:40:07 +000072EXTRA_DIST = \
fitzhardingecf826ad2004-01-07 08:47:44 +000073 ACKNOWLEDGEMENTS \
nethercote16b59ee2004-10-09 15:59:05 +000074 README_DEVELOPERS \
nethercote5da1e172003-12-03 21:44:45 +000075 README_PACKAGERS \
njnf7c00b12005-07-19 21:46:19 +000076 README_MISSING_SYSCALL_OR_IOCTL \
njn22ae5c02005-07-24 23:21:28 +000077 valgrind.spec.in valgrind.pc.in \
njn73dc2c72005-08-28 04:48:12 +000078 Makefile.all.am Makefile.tool.am Makefile.core.am \
sewardj85a9dca2005-07-26 10:42:57 +000079 Makefile.tool-inplace.am \
dirk9f9ab892006-12-07 15:31:57 +000080 $(vex_primary_sources)
sewardjfed4dd02002-04-14 14:32:54 +000081
gobryb0a955e2002-04-14 15:31:19 +000082install-exec-hook:
daywalker47160d62002-04-15 00:54:13 +000083 $(mkinstalldirs) $(DESTDIR)$(valdir)
njn25e49d8e72002-09-23 09:36:25 +000084
fitzhardinge98abfc72003-12-16 02:05:15 +000085all-local:
nethercoteb7dceef2004-08-25 11:50:46 +000086 mkdir -p $(inplacedir)
87 rm -f $(addprefix $(inplacedir)/,default.supp $(SUPP_FILES))
88 ln -s ../default.supp $(inplacedir)
89 ln -s $(addprefix ../$(top_srcdir)/,$(SUPP_FILES)) $(inplacedir)
fitzhardinge98abfc72003-12-16 02:05:15 +000090
thughes734160c2004-06-28 21:52:40 +000091distclean-local:
nethercoteb7dceef2004-08-25 11:50:46 +000092 rm -rf $(inplacedir)
sewardj85a9dca2005-07-26 10:42:57 +000093
tomab568f62005-07-27 07:36:22 +000094# These list the bits of vex we need to install
sewardj85a9dca2005-07-26 10:42:57 +000095
njn541e50e2005-07-26 23:06:18 +000096VEX_PUBLIC_HDRS = \
tomab568f62005-07-27 07:36:22 +000097 @VEX_DIR@/pub/libvex_guest_amd64.h \
98 @VEX_DIR@/pub/libvex_ir.h \
99 @VEX_DIR@/pub/libvex_guest_ppc32.h \
sewardj2c48c7b2005-11-29 13:05:56 +0000100 @VEX_DIR@/pub/libvex_guest_ppc64.h \
tomab568f62005-07-27 07:36:22 +0000101 @VEX_DIR@/pub/libvex_basictypes.h \
102 @VEX_DIR@/pub/libvex_guest_offsets.h \
103 @VEX_DIR@/pub/libvex_emwarn.h \
104 @VEX_DIR@/pub/libvex.h \
105 @VEX_DIR@/pub/libvex_trc_values.h \
106 @VEX_DIR@/pub/libvex_guest_arm.h \
107 @VEX_DIR@/pub/libvex_guest_x86.h
108
109# These list the bits of vex we need to copy into the tarball
110
dirk9f9ab892006-12-07 15:31:57 +0000111vex_primary_sources = \
sewardj1eff82b2006-10-17 00:56:43 +0000112 VEX/quote.txt \
113 VEX/newline.txt \
sewardjb1916722005-08-03 16:39:44 +0000114 VEX/HACKING.README \
115 VEX/LICENSE.README \
116 VEX/LICENSE.GPL \
tomab568f62005-07-27 07:36:22 +0000117 VEX/Makefile \
118 VEX/auxprogs/genoffsets.c \
sewardj85a9dca2005-07-26 10:42:57 +0000119 VEX/pub/libvex_guest_amd64.h \
120 VEX/pub/libvex_ir.h \
121 VEX/pub/libvex_guest_ppc32.h \
sewardj2c48c7b2005-11-29 13:05:56 +0000122 VEX/pub/libvex_guest_ppc64.h \
sewardj85a9dca2005-07-26 10:42:57 +0000123 VEX/pub/libvex_basictypes.h \
124 VEX/pub/libvex_guest_offsets.h \
125 VEX/pub/libvex_emwarn.h \
126 VEX/pub/libvex.h \
127 VEX/pub/libvex_trc_values.h \
128 VEX/pub/libvex_guest_arm.h \
tomab568f62005-07-27 07:36:22 +0000129 VEX/pub/libvex_guest_x86.h \
sewardj85a9dca2005-07-26 10:42:57 +0000130 VEX/priv/ir/irmatch.c \
131 VEX/priv/ir/irmatch.h \
132 VEX/priv/ir/irdefs.c \
133 VEX/priv/ir/iropt.c \
134 VEX/priv/ir/iropt.h \
cerion0fe14412005-12-23 11:44:40 +0000135 VEX/priv/host-ppc/isel.c \
136 VEX/priv/host-ppc/hdefs.c \
137 VEX/priv/host-ppc/hdefs.h \
sewardj85a9dca2005-07-26 10:42:57 +0000138 VEX/priv/main/vex_svnversion.h \
139 VEX/priv/main/vex_globals.c \
140 VEX/priv/main/vex_globals.h \
141 VEX/priv/main/vex_main.c \
142 VEX/priv/main/vex_util.c \
143 VEX/priv/main/vex_util.h \
144 VEX/priv/guest-arm/ghelpers.c \
145 VEX/priv/guest-arm/gdefs.h \
146 VEX/priv/guest-arm/toIR.c \
147 VEX/priv/guest-x86/ghelpers.c \
148 VEX/priv/guest-x86/gdefs.h \
149 VEX/priv/guest-x86/toIR.c \
150 VEX/priv/guest-generic/g_generic_x87.c \
151 VEX/priv/guest-generic/g_generic_x87.h \
152 VEX/priv/guest-generic/bb_to_IR.c \
153 VEX/priv/guest-generic/bb_to_IR.h \
154 VEX/priv/host-arm/isel.c \
155 VEX/priv/host-arm/hdefs.c \
156 VEX/priv/host-arm/hdefs.h \
157 VEX/priv/host-x86/isel.c \
158 VEX/priv/host-x86/hdefs.c \
159 VEX/priv/host-x86/hdefs.h \
160 VEX/priv/guest-amd64/ghelpers.c \
161 VEX/priv/guest-amd64/gdefs.h \
162 VEX/priv/guest-amd64/toIR.c \
cerion0fe14412005-12-23 11:44:40 +0000163 VEX/priv/guest-ppc/ghelpers.c \
164 VEX/priv/guest-ppc/gdefs.h \
165 VEX/priv/guest-ppc/toIR.c \
sewardj85a9dca2005-07-26 10:42:57 +0000166 VEX/priv/host-generic/reg_alloc2.c \
167 VEX/priv/host-generic/h_generic_regs.c \
168 VEX/priv/host-generic/h_generic_regs.h \
169 VEX/priv/host-generic/h_generic_simd64.c \
170 VEX/priv/host-generic/h_generic_simd64.h \
171 VEX/priv/host-amd64/isel.c \
172 VEX/priv/host-amd64/hdefs.c \
173 VEX/priv/host-amd64/hdefs.h
sewardj45f4e7c2005-09-27 19:20:21 +0000174
175
176# Generate a linker script for linking the binaries. This is the
177# standard gcc linker script, except hacked so that an alternative
178# load address can be specified by (1) asking gcc to use this script
179# (-Wl,-T,valt_load_address.lds) and (2) setting the symbol
180# valt_load_address to the required value
181# (-Wl,-defsym,valt_load_address=0x70000000).
182#
183# Extract ld's default linker script and hack it to our needs.
184# First we cut everything above and below the "=====..." lines at the top
185# and bottom.
186# Then we have to replace the load address with "valt_load_address".
187# The line to replace in has one of the following two forms:
188#
189# . = 0x08048000 + SIZEOF_HEADERS;
190#
191# or
192# PROVIDE (__executable_start = 0x08048000); . = 0x08048000 + SIZEOF_HEADERS;
193#
194# So we search for the line with a hex value "+ SIZEOF_HEADERS", and replace
195# all the hex values in that line with "valt_load_address".
tomfb7bcde2005-11-07 15:24:38 +0000196valt_load_address_x86_linux.lds: Makefile
197 $(CC) @FLAG_M32@ -Wl,--verbose -nostdlib 2>&1 | sed \
sewardj45f4e7c2005-09-27 19:20:21 +0000198 -e '1,/^=====\+$$/d' \
199 -e '/^=====\+$$/d' \
200 -e '/\. = 0x[0-9A-Fa-f]\+ + SIZEOF_HEADERS/s/0x[0-9A-Fa-f]\+/valt_load_address/g' > $@ \
201 || rm -f $@
202
tomfb7bcde2005-11-07 15:24:38 +0000203valt_load_address_amd64_linux.lds: Makefile
204 $(CC) -m64 -Wl,--verbose -nostdlib 2>&1 | sed \
205 -e '1,/^=====\+$$/d' \
206 -e '/^=====\+$$/d' \
207 -e '/\. = 0x[0-9A-Fa-f]\+ + SIZEOF_HEADERS/s/0x[0-9A-Fa-f]\+/valt_load_address/g' > $@ \
208 || rm -f $@
209
210valt_load_address_ppc32_linux.lds: Makefile
sewardj2c48c7b2005-11-29 13:05:56 +0000211 $(CC) @FLAG_M32@ -Wl,--verbose -nostdlib 2>&1 | sed \
212 -e '1,/^=====\+$$/d' \
213 -e '/^=====\+$$/d' \
214 -e '/\. = 0x[0-9A-Fa-f]\+ + SIZEOF_HEADERS/s/0x[0-9A-Fa-f]\+/valt_load_address/g' > $@ \
215 || rm -f $@
216
217valt_load_address_ppc64_linux.lds: Makefile
218 $(CC) -m64 -Wl,--verbose -nostdlib 2>&1 | sed \
tomfb7bcde2005-11-07 15:24:38 +0000219 -e '1,/^=====\+$$/d' \
220 -e '/^=====\+$$/d' \
221 -e '/\. = 0x[0-9A-Fa-f]\+ + SIZEOF_HEADERS/s/0x[0-9A-Fa-f]\+/valt_load_address/g' > $@ \
222 || rm -f $@