blob: 9df0d8b9076b0b7e15db6ae327b4f636a82b7b3b [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
njn3e884182003-04-15 13:03:23 +00006## addrcheck must come after memcheck, for mac_*.o
njn86f12dc2005-03-14 01:16:05 +00007TOOLS = memcheck \
njn6a3009b2005-03-20 00:20:06 +00008 cachegrind \
njn6a3009b2005-03-20 00:20:06 +00009 massif \
10 lackey \
11 none
sewardjb5f6f512005-03-10 23:59:00 +000012
sewardjd0469f72005-04-20 14:30:19 +000013## addrcheck \
14
sewardj45f4e7c2005-09-27 19:20:21 +000015# Temporary: we want to compile Helgrind, but not regtest it.
16# And we want to include Addrcheck in the distro, but not compile/test it.
njn3f7e9112005-06-19 05:43:21 +000017# Put docs last because building the HTML is slow and we want to get
18# everything else working before we try it.
njnec0c27a2005-12-10 23:11:28 +000019SUBDIRS = include coregrind . tests perf auxprogs $(TOOLS) helgrind docs
sewardj45f4e7c2005-09-27 19:20:21 +000020DIST_SUBDIRS = $(SUBDIRS) addrcheck
sewardjde4a1d02002-03-22 01:27:54 +000021
njna63e2d72003-06-12 14:13:05 +000022SUPP_FILES = \
njnb8824022005-07-03 17:10:04 +000023 glibc-2.2.supp glibc-2.3.supp glibc-2.4.supp \
njna63e2d72003-06-12 14:13:05 +000024 xfree-3.supp xfree-4.supp
gobry3b777892002-04-04 09:18:39 +000025
nethercote537e8942004-08-25 11:40:07 +000026dist_val_DATA = $(SUPP_FILES) default.supp
gobry3b777892002-04-04 09:18:39 +000027
muellerbddd6072003-11-19 21:50:07 +000028pkgconfigdir = $(libdir)/pkgconfig
29pkgconfig_DATA = valgrind.pc
30
njn541e50e2005-07-26 23:06:18 +000031incincdir = $(includedir)/valgrind
tom97245202005-07-27 09:25:08 +000032nodist_incinc_HEADERS = $(VEX_PUBLIC_HDRS)
njn541e50e2005-07-26 23:06:18 +000033
tomfb7bcde2005-11-07 15:24:38 +000034BUILT_SOURCES = default.supp valgrind.pc
35CLEANFILES =
njnda762d42003-09-29 20:50:49 +000036DISTCLEANFILES = default.supp
daywalkerf5ef1852003-02-25 01:48:15 +000037
tomfb7bcde2005-11-07 15:24:38 +000038if VG_X86_LINUX
39BUILT_SOURCES += valt_load_address_x86_linux.lds
40CLEANFILES += valt_load_address_x86_linux.lds
41endif
42if VG_AMD64_LINUX
43BUILT_SOURCES += valt_load_address_amd64_linux.lds
44CLEANFILES += valt_load_address_amd64_linux.lds
45endif
46if VG_PPC32_LINUX
47BUILT_SOURCES += valt_load_address_ppc32_linux.lds
48CLEANFILES += valt_load_address_ppc32_linux.lds
49endif
sewardj2c48c7b2005-11-29 13:05:56 +000050if VG_PPC64_LINUX
51BUILT_SOURCES += valt_load_address_ppc64_linux.lds
52CLEANFILES += valt_load_address_ppc64_linux.lds
53endif
tomfb7bcde2005-11-07 15:24:38 +000054
gobry3b777892002-04-04 09:18:39 +000055default.supp: $(SUPP_FILES)
sewardjde4a1d02002-03-22 01:27:54 +000056
njn71fe3e62003-04-23 21:48:20 +000057## Preprend @PERL@ because tests/vg_regtest isn't executable
daywalkerc60b3a12003-04-23 16:39:31 +000058regtest: check
sewardjb5f6f512005-03-10 23:59:00 +000059 @PERL@ tests/vg_regtest $(TOOLS)
njn55b98e92003-04-08 10:29:13 +000060
njnec0c27a2005-12-10 23:11:28 +000061## Preprend @PERL@ because tests/vg_per isn't executable
62perf: check
63 @PERL@ perf/vg_perf perf
64
nethercote537e8942004-08-25 11:40:07 +000065EXTRA_DIST = \
fitzhardingecf826ad2004-01-07 08:47:44 +000066 ACKNOWLEDGEMENTS \
nethercote16b59ee2004-10-09 15:59:05 +000067 README_DEVELOPERS \
nethercote5da1e172003-12-03 21:44:45 +000068 README_PACKAGERS \
njnf7c00b12005-07-19 21:46:19 +000069 README_MISSING_SYSCALL_OR_IOCTL \
njn22ae5c02005-07-24 23:21:28 +000070 valgrind.spec.in valgrind.pc.in \
njn73dc2c72005-08-28 04:48:12 +000071 Makefile.all.am Makefile.tool.am Makefile.core.am \
sewardj85a9dca2005-07-26 10:42:57 +000072 Makefile.tool-inplace.am \
tomab568f62005-07-27 07:36:22 +000073 $(VEX_PRIMARY_SOURCES)
sewardjfed4dd02002-04-14 14:32:54 +000074
gobryb0a955e2002-04-14 15:31:19 +000075install-exec-hook:
daywalker47160d62002-04-15 00:54:13 +000076 $(mkinstalldirs) $(DESTDIR)$(valdir)
njn25e49d8e72002-09-23 09:36:25 +000077
fitzhardinge98abfc72003-12-16 02:05:15 +000078all-local:
nethercoteb7dceef2004-08-25 11:50:46 +000079 mkdir -p $(inplacedir)
80 rm -f $(addprefix $(inplacedir)/,default.supp $(SUPP_FILES))
81 ln -s ../default.supp $(inplacedir)
82 ln -s $(addprefix ../$(top_srcdir)/,$(SUPP_FILES)) $(inplacedir)
fitzhardinge98abfc72003-12-16 02:05:15 +000083
thughes734160c2004-06-28 21:52:40 +000084distclean-local:
nethercoteb7dceef2004-08-25 11:50:46 +000085 rm -rf $(inplacedir)
sewardj85a9dca2005-07-26 10:42:57 +000086
tomab568f62005-07-27 07:36:22 +000087# These list the bits of vex we need to install
sewardj85a9dca2005-07-26 10:42:57 +000088
njn541e50e2005-07-26 23:06:18 +000089VEX_PUBLIC_HDRS = \
tomab568f62005-07-27 07:36:22 +000090 @VEX_DIR@/pub/libvex_guest_amd64.h \
91 @VEX_DIR@/pub/libvex_ir.h \
92 @VEX_DIR@/pub/libvex_guest_ppc32.h \
sewardj2c48c7b2005-11-29 13:05:56 +000093 @VEX_DIR@/pub/libvex_guest_ppc64.h \
tomab568f62005-07-27 07:36:22 +000094 @VEX_DIR@/pub/libvex_basictypes.h \
95 @VEX_DIR@/pub/libvex_guest_offsets.h \
96 @VEX_DIR@/pub/libvex_emwarn.h \
97 @VEX_DIR@/pub/libvex.h \
98 @VEX_DIR@/pub/libvex_trc_values.h \
99 @VEX_DIR@/pub/libvex_guest_arm.h \
100 @VEX_DIR@/pub/libvex_guest_x86.h
101
102# These list the bits of vex we need to copy into the tarball
103
104VEX_PRIMARY_SOURCES = \
sewardjb1916722005-08-03 16:39:44 +0000105 VEX/HACKING.README \
106 VEX/LICENSE.README \
107 VEX/LICENSE.GPL \
tomab568f62005-07-27 07:36:22 +0000108 VEX/Makefile \
109 VEX/auxprogs/genoffsets.c \
sewardj85a9dca2005-07-26 10:42:57 +0000110 VEX/pub/libvex_guest_amd64.h \
111 VEX/pub/libvex_ir.h \
112 VEX/pub/libvex_guest_ppc32.h \
sewardj2c48c7b2005-11-29 13:05:56 +0000113 VEX/pub/libvex_guest_ppc64.h \
sewardj85a9dca2005-07-26 10:42:57 +0000114 VEX/pub/libvex_basictypes.h \
115 VEX/pub/libvex_guest_offsets.h \
116 VEX/pub/libvex_emwarn.h \
117 VEX/pub/libvex.h \
118 VEX/pub/libvex_trc_values.h \
119 VEX/pub/libvex_guest_arm.h \
tomab568f62005-07-27 07:36:22 +0000120 VEX/pub/libvex_guest_x86.h \
sewardj85a9dca2005-07-26 10:42:57 +0000121 VEX/priv/ir/irmatch.c \
122 VEX/priv/ir/irmatch.h \
123 VEX/priv/ir/irdefs.c \
124 VEX/priv/ir/iropt.c \
125 VEX/priv/ir/iropt.h \
126 VEX/priv/host-ppc32/isel.c \
127 VEX/priv/host-ppc32/hdefs.c \
128 VEX/priv/host-ppc32/hdefs.h \
129 VEX/priv/main/vex_svnversion.h \
130 VEX/priv/main/vex_globals.c \
131 VEX/priv/main/vex_globals.h \
132 VEX/priv/main/vex_main.c \
133 VEX/priv/main/vex_util.c \
134 VEX/priv/main/vex_util.h \
135 VEX/priv/guest-arm/ghelpers.c \
136 VEX/priv/guest-arm/gdefs.h \
137 VEX/priv/guest-arm/toIR.c \
138 VEX/priv/guest-x86/ghelpers.c \
139 VEX/priv/guest-x86/gdefs.h \
140 VEX/priv/guest-x86/toIR.c \
141 VEX/priv/guest-generic/g_generic_x87.c \
142 VEX/priv/guest-generic/g_generic_x87.h \
143 VEX/priv/guest-generic/bb_to_IR.c \
144 VEX/priv/guest-generic/bb_to_IR.h \
145 VEX/priv/host-arm/isel.c \
146 VEX/priv/host-arm/hdefs.c \
147 VEX/priv/host-arm/hdefs.h \
148 VEX/priv/host-x86/isel.c \
149 VEX/priv/host-x86/hdefs.c \
150 VEX/priv/host-x86/hdefs.h \
151 VEX/priv/guest-amd64/ghelpers.c \
152 VEX/priv/guest-amd64/gdefs.h \
153 VEX/priv/guest-amd64/toIR.c \
154 VEX/priv/guest-ppc32/ghelpers.c \
155 VEX/priv/guest-ppc32/gdefs.h \
156 VEX/priv/guest-ppc32/toIR.c \
157 VEX/priv/host-generic/reg_alloc2.c \
158 VEX/priv/host-generic/h_generic_regs.c \
159 VEX/priv/host-generic/h_generic_regs.h \
160 VEX/priv/host-generic/h_generic_simd64.c \
161 VEX/priv/host-generic/h_generic_simd64.h \
162 VEX/priv/host-amd64/isel.c \
163 VEX/priv/host-amd64/hdefs.c \
164 VEX/priv/host-amd64/hdefs.h
sewardj45f4e7c2005-09-27 19:20:21 +0000165
166
167# Generate a linker script for linking the binaries. This is the
168# standard gcc linker script, except hacked so that an alternative
169# load address can be specified by (1) asking gcc to use this script
170# (-Wl,-T,valt_load_address.lds) and (2) setting the symbol
171# valt_load_address to the required value
172# (-Wl,-defsym,valt_load_address=0x70000000).
173#
174# Extract ld's default linker script and hack it to our needs.
175# First we cut everything above and below the "=====..." lines at the top
176# and bottom.
177# Then we have to replace the load address with "valt_load_address".
178# The line to replace in has one of the following two forms:
179#
180# . = 0x08048000 + SIZEOF_HEADERS;
181#
182# or
183# PROVIDE (__executable_start = 0x08048000); . = 0x08048000 + SIZEOF_HEADERS;
184#
185# So we search for the line with a hex value "+ SIZEOF_HEADERS", and replace
186# all the hex values in that line with "valt_load_address".
tomfb7bcde2005-11-07 15:24:38 +0000187valt_load_address_x86_linux.lds: Makefile
188 $(CC) @FLAG_M32@ -Wl,--verbose -nostdlib 2>&1 | sed \
sewardj45f4e7c2005-09-27 19:20:21 +0000189 -e '1,/^=====\+$$/d' \
190 -e '/^=====\+$$/d' \
191 -e '/\. = 0x[0-9A-Fa-f]\+ + SIZEOF_HEADERS/s/0x[0-9A-Fa-f]\+/valt_load_address/g' > $@ \
192 || rm -f $@
193
tomfb7bcde2005-11-07 15:24:38 +0000194valt_load_address_amd64_linux.lds: Makefile
195 $(CC) -m64 -Wl,--verbose -nostdlib 2>&1 | sed \
196 -e '1,/^=====\+$$/d' \
197 -e '/^=====\+$$/d' \
198 -e '/\. = 0x[0-9A-Fa-f]\+ + SIZEOF_HEADERS/s/0x[0-9A-Fa-f]\+/valt_load_address/g' > $@ \
199 || rm -f $@
200
201valt_load_address_ppc32_linux.lds: Makefile
sewardj2c48c7b2005-11-29 13:05:56 +0000202 $(CC) @FLAG_M32@ -Wl,--verbose -nostdlib 2>&1 | sed \
203 -e '1,/^=====\+$$/d' \
204 -e '/^=====\+$$/d' \
205 -e '/\. = 0x[0-9A-Fa-f]\+ + SIZEOF_HEADERS/s/0x[0-9A-Fa-f]\+/valt_load_address/g' > $@ \
206 || rm -f $@
207
208valt_load_address_ppc64_linux.lds: Makefile
209 $(CC) -m64 -Wl,--verbose -nostdlib 2>&1 | sed \
tomfb7bcde2005-11-07 15:24:38 +0000210 -e '1,/^=====\+$$/d' \
211 -e '/^=====\+$$/d' \
212 -e '/\. = 0x[0-9A-Fa-f]\+ + SIZEOF_HEADERS/s/0x[0-9A-Fa-f]\+/valt_load_address/g' > $@ \
213 || rm -f $@