njn25 | e49d8e7 | 2002-09-23 09:36:25 +0000 | [diff] [blame] | 1 | |
tom | d9fa751 | 2005-11-30 00:03:58 +0000 | [diff] [blame^] | 2 | AUTOMAKE_OPTIONS = foreign 1.7 dist-bzip2 |
sewardj | 31f6cb5 | 2003-03-01 01:26:55 +0000 | [diff] [blame] | 3 | |
njn | 3e986b2 | 2004-11-30 10:43:45 +0000 | [diff] [blame] | 4 | include $(top_srcdir)/Makefile.all.am |
nethercote | 4388a40 | 2004-09-01 23:20:49 +0000 | [diff] [blame] | 5 | |
njn | 3e88418 | 2003-04-15 13:03:23 +0000 | [diff] [blame] | 6 | ## addrcheck must come after memcheck, for mac_*.o |
njn | 86f12dc | 2005-03-14 01:16:05 +0000 | [diff] [blame] | 7 | TOOLS = memcheck \ |
njn | 6a3009b | 2005-03-20 00:20:06 +0000 | [diff] [blame] | 8 | cachegrind \ |
njn | 6a3009b | 2005-03-20 00:20:06 +0000 | [diff] [blame] | 9 | massif \ |
| 10 | lackey \ |
| 11 | none |
sewardj | b5f6f51 | 2005-03-10 23:59:00 +0000 | [diff] [blame] | 12 | |
sewardj | d0469f7 | 2005-04-20 14:30:19 +0000 | [diff] [blame] | 13 | ## addrcheck \ |
| 14 | |
sewardj | 45f4e7c | 2005-09-27 19:20:21 +0000 | [diff] [blame] | 15 | # 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. |
njn | 3f7e911 | 2005-06-19 05:43:21 +0000 | [diff] [blame] | 17 | # Put docs last because building the HTML is slow and we want to get |
| 18 | # everything else working before we try it. |
sewardj | 45f4e7c | 2005-09-27 19:20:21 +0000 | [diff] [blame] | 19 | SUBDIRS = include coregrind . tests auxprogs $(TOOLS) helgrind docs |
| 20 | DIST_SUBDIRS = $(SUBDIRS) addrcheck |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 21 | |
njn | a63e2d7 | 2003-06-12 14:13:05 +0000 | [diff] [blame] | 22 | SUPP_FILES = \ |
njn | b882402 | 2005-07-03 17:10:04 +0000 | [diff] [blame] | 23 | glibc-2.2.supp glibc-2.3.supp glibc-2.4.supp \ |
njn | a63e2d7 | 2003-06-12 14:13:05 +0000 | [diff] [blame] | 24 | xfree-3.supp xfree-4.supp |
gobry | 3b77789 | 2002-04-04 09:18:39 +0000 | [diff] [blame] | 25 | |
nethercote | 537e894 | 2004-08-25 11:40:07 +0000 | [diff] [blame] | 26 | dist_val_DATA = $(SUPP_FILES) default.supp |
gobry | 3b77789 | 2002-04-04 09:18:39 +0000 | [diff] [blame] | 27 | |
mueller | bddd607 | 2003-11-19 21:50:07 +0000 | [diff] [blame] | 28 | pkgconfigdir = $(libdir)/pkgconfig |
| 29 | pkgconfig_DATA = valgrind.pc |
| 30 | |
njn | 541e50e | 2005-07-26 23:06:18 +0000 | [diff] [blame] | 31 | incincdir = $(includedir)/valgrind |
tom | 9724520 | 2005-07-27 09:25:08 +0000 | [diff] [blame] | 32 | nodist_incinc_HEADERS = $(VEX_PUBLIC_HDRS) |
njn | 541e50e | 2005-07-26 23:06:18 +0000 | [diff] [blame] | 33 | |
tom | fb7bcde | 2005-11-07 15:24:38 +0000 | [diff] [blame] | 34 | BUILT_SOURCES = default.supp valgrind.pc |
| 35 | CLEANFILES = |
njn | da762d4 | 2003-09-29 20:50:49 +0000 | [diff] [blame] | 36 | DISTCLEANFILES = default.supp |
daywalker | f5ef185 | 2003-02-25 01:48:15 +0000 | [diff] [blame] | 37 | |
tom | fb7bcde | 2005-11-07 15:24:38 +0000 | [diff] [blame] | 38 | if VG_X86_LINUX |
| 39 | BUILT_SOURCES += valt_load_address_x86_linux.lds |
| 40 | CLEANFILES += valt_load_address_x86_linux.lds |
| 41 | endif |
| 42 | if VG_AMD64_LINUX |
| 43 | BUILT_SOURCES += valt_load_address_amd64_linux.lds |
| 44 | CLEANFILES += valt_load_address_amd64_linux.lds |
| 45 | endif |
| 46 | if VG_PPC32_LINUX |
| 47 | BUILT_SOURCES += valt_load_address_ppc32_linux.lds |
| 48 | CLEANFILES += valt_load_address_ppc32_linux.lds |
| 49 | endif |
sewardj | 2c48c7b | 2005-11-29 13:05:56 +0000 | [diff] [blame] | 50 | if VG_PPC64_LINUX |
| 51 | BUILT_SOURCES += valt_load_address_ppc64_linux.lds |
| 52 | CLEANFILES += valt_load_address_ppc64_linux.lds |
| 53 | endif |
tom | fb7bcde | 2005-11-07 15:24:38 +0000 | [diff] [blame] | 54 | |
gobry | 3b77789 | 2002-04-04 09:18:39 +0000 | [diff] [blame] | 55 | default.supp: $(SUPP_FILES) |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 56 | |
njn | 71fe3e6 | 2003-04-23 21:48:20 +0000 | [diff] [blame] | 57 | ## Preprend @PERL@ because tests/vg_regtest isn't executable |
daywalker | c60b3a1 | 2003-04-23 16:39:31 +0000 | [diff] [blame] | 58 | regtest: check |
sewardj | b5f6f51 | 2005-03-10 23:59:00 +0000 | [diff] [blame] | 59 | @PERL@ tests/vg_regtest $(TOOLS) |
njn | 55b98e9 | 2003-04-08 10:29:13 +0000 | [diff] [blame] | 60 | |
nethercote | 537e894 | 2004-08-25 11:40:07 +0000 | [diff] [blame] | 61 | EXTRA_DIST = \ |
fitzhardinge | cf826ad | 2004-01-07 08:47:44 +0000 | [diff] [blame] | 62 | ACKNOWLEDGEMENTS \ |
nethercote | 16b59ee | 2004-10-09 15:59:05 +0000 | [diff] [blame] | 63 | README_DEVELOPERS \ |
nethercote | 5da1e17 | 2003-12-03 21:44:45 +0000 | [diff] [blame] | 64 | README_PACKAGERS \ |
njn | f7c00b1 | 2005-07-19 21:46:19 +0000 | [diff] [blame] | 65 | README_MISSING_SYSCALL_OR_IOCTL \ |
njn | 22ae5c0 | 2005-07-24 23:21:28 +0000 | [diff] [blame] | 66 | valgrind.spec.in valgrind.pc.in \ |
njn | 73dc2c7 | 2005-08-28 04:48:12 +0000 | [diff] [blame] | 67 | Makefile.all.am Makefile.tool.am Makefile.core.am \ |
sewardj | 85a9dca | 2005-07-26 10:42:57 +0000 | [diff] [blame] | 68 | Makefile.tool-inplace.am \ |
tom | ab568f6 | 2005-07-27 07:36:22 +0000 | [diff] [blame] | 69 | $(VEX_PRIMARY_SOURCES) |
sewardj | fed4dd0 | 2002-04-14 14:32:54 +0000 | [diff] [blame] | 70 | |
gobry | b0a955e | 2002-04-14 15:31:19 +0000 | [diff] [blame] | 71 | install-exec-hook: |
daywalker | 47160d6 | 2002-04-15 00:54:13 +0000 | [diff] [blame] | 72 | $(mkinstalldirs) $(DESTDIR)$(valdir) |
njn25 | e49d8e7 | 2002-09-23 09:36:25 +0000 | [diff] [blame] | 73 | |
fitzhardinge | 98abfc7 | 2003-12-16 02:05:15 +0000 | [diff] [blame] | 74 | all-local: |
nethercote | b7dceef | 2004-08-25 11:50:46 +0000 | [diff] [blame] | 75 | mkdir -p $(inplacedir) |
| 76 | rm -f $(addprefix $(inplacedir)/,default.supp $(SUPP_FILES)) |
| 77 | ln -s ../default.supp $(inplacedir) |
| 78 | ln -s $(addprefix ../$(top_srcdir)/,$(SUPP_FILES)) $(inplacedir) |
fitzhardinge | 98abfc7 | 2003-12-16 02:05:15 +0000 | [diff] [blame] | 79 | |
thughes | 734160c | 2004-06-28 21:52:40 +0000 | [diff] [blame] | 80 | distclean-local: |
nethercote | b7dceef | 2004-08-25 11:50:46 +0000 | [diff] [blame] | 81 | rm -rf $(inplacedir) |
sewardj | 85a9dca | 2005-07-26 10:42:57 +0000 | [diff] [blame] | 82 | |
tom | ab568f6 | 2005-07-27 07:36:22 +0000 | [diff] [blame] | 83 | # These list the bits of vex we need to install |
sewardj | 85a9dca | 2005-07-26 10:42:57 +0000 | [diff] [blame] | 84 | |
njn | 541e50e | 2005-07-26 23:06:18 +0000 | [diff] [blame] | 85 | VEX_PUBLIC_HDRS = \ |
tom | ab568f6 | 2005-07-27 07:36:22 +0000 | [diff] [blame] | 86 | @VEX_DIR@/pub/libvex_guest_amd64.h \ |
| 87 | @VEX_DIR@/pub/libvex_ir.h \ |
| 88 | @VEX_DIR@/pub/libvex_guest_ppc32.h \ |
sewardj | 2c48c7b | 2005-11-29 13:05:56 +0000 | [diff] [blame] | 89 | @VEX_DIR@/pub/libvex_guest_ppc64.h \ |
tom | ab568f6 | 2005-07-27 07:36:22 +0000 | [diff] [blame] | 90 | @VEX_DIR@/pub/libvex_basictypes.h \ |
| 91 | @VEX_DIR@/pub/libvex_guest_offsets.h \ |
| 92 | @VEX_DIR@/pub/libvex_emwarn.h \ |
| 93 | @VEX_DIR@/pub/libvex.h \ |
| 94 | @VEX_DIR@/pub/libvex_trc_values.h \ |
| 95 | @VEX_DIR@/pub/libvex_guest_arm.h \ |
| 96 | @VEX_DIR@/pub/libvex_guest_x86.h |
| 97 | |
| 98 | # These list the bits of vex we need to copy into the tarball |
| 99 | |
| 100 | VEX_PRIMARY_SOURCES = \ |
sewardj | b191672 | 2005-08-03 16:39:44 +0000 | [diff] [blame] | 101 | VEX/HACKING.README \ |
| 102 | VEX/LICENSE.README \ |
| 103 | VEX/LICENSE.GPL \ |
tom | ab568f6 | 2005-07-27 07:36:22 +0000 | [diff] [blame] | 104 | VEX/Makefile \ |
| 105 | VEX/auxprogs/genoffsets.c \ |
sewardj | 85a9dca | 2005-07-26 10:42:57 +0000 | [diff] [blame] | 106 | VEX/pub/libvex_guest_amd64.h \ |
| 107 | VEX/pub/libvex_ir.h \ |
| 108 | VEX/pub/libvex_guest_ppc32.h \ |
sewardj | 2c48c7b | 2005-11-29 13:05:56 +0000 | [diff] [blame] | 109 | VEX/pub/libvex_guest_ppc64.h \ |
sewardj | 85a9dca | 2005-07-26 10:42:57 +0000 | [diff] [blame] | 110 | VEX/pub/libvex_basictypes.h \ |
| 111 | VEX/pub/libvex_guest_offsets.h \ |
| 112 | VEX/pub/libvex_emwarn.h \ |
| 113 | VEX/pub/libvex.h \ |
| 114 | VEX/pub/libvex_trc_values.h \ |
| 115 | VEX/pub/libvex_guest_arm.h \ |
tom | ab568f6 | 2005-07-27 07:36:22 +0000 | [diff] [blame] | 116 | VEX/pub/libvex_guest_x86.h \ |
sewardj | 85a9dca | 2005-07-26 10:42:57 +0000 | [diff] [blame] | 117 | VEX/priv/ir/irmatch.c \ |
| 118 | VEX/priv/ir/irmatch.h \ |
| 119 | VEX/priv/ir/irdefs.c \ |
| 120 | VEX/priv/ir/iropt.c \ |
| 121 | VEX/priv/ir/iropt.h \ |
| 122 | VEX/priv/host-ppc32/isel.c \ |
| 123 | VEX/priv/host-ppc32/hdefs.c \ |
| 124 | VEX/priv/host-ppc32/hdefs.h \ |
| 125 | VEX/priv/main/vex_svnversion.h \ |
| 126 | VEX/priv/main/vex_globals.c \ |
| 127 | VEX/priv/main/vex_globals.h \ |
| 128 | VEX/priv/main/vex_main.c \ |
| 129 | VEX/priv/main/vex_util.c \ |
| 130 | VEX/priv/main/vex_util.h \ |
| 131 | VEX/priv/guest-arm/ghelpers.c \ |
| 132 | VEX/priv/guest-arm/gdefs.h \ |
| 133 | VEX/priv/guest-arm/toIR.c \ |
| 134 | VEX/priv/guest-x86/ghelpers.c \ |
| 135 | VEX/priv/guest-x86/gdefs.h \ |
| 136 | VEX/priv/guest-x86/toIR.c \ |
| 137 | VEX/priv/guest-generic/g_generic_x87.c \ |
| 138 | VEX/priv/guest-generic/g_generic_x87.h \ |
| 139 | VEX/priv/guest-generic/bb_to_IR.c \ |
| 140 | VEX/priv/guest-generic/bb_to_IR.h \ |
| 141 | VEX/priv/host-arm/isel.c \ |
| 142 | VEX/priv/host-arm/hdefs.c \ |
| 143 | VEX/priv/host-arm/hdefs.h \ |
| 144 | VEX/priv/host-x86/isel.c \ |
| 145 | VEX/priv/host-x86/hdefs.c \ |
| 146 | VEX/priv/host-x86/hdefs.h \ |
| 147 | VEX/priv/guest-amd64/ghelpers.c \ |
| 148 | VEX/priv/guest-amd64/gdefs.h \ |
| 149 | VEX/priv/guest-amd64/toIR.c \ |
| 150 | VEX/priv/guest-ppc32/ghelpers.c \ |
| 151 | VEX/priv/guest-ppc32/gdefs.h \ |
| 152 | VEX/priv/guest-ppc32/toIR.c \ |
| 153 | VEX/priv/host-generic/reg_alloc2.c \ |
| 154 | VEX/priv/host-generic/h_generic_regs.c \ |
| 155 | VEX/priv/host-generic/h_generic_regs.h \ |
| 156 | VEX/priv/host-generic/h_generic_simd64.c \ |
| 157 | VEX/priv/host-generic/h_generic_simd64.h \ |
| 158 | VEX/priv/host-amd64/isel.c \ |
| 159 | VEX/priv/host-amd64/hdefs.c \ |
| 160 | VEX/priv/host-amd64/hdefs.h |
sewardj | 45f4e7c | 2005-09-27 19:20:21 +0000 | [diff] [blame] | 161 | |
| 162 | |
| 163 | # Generate a linker script for linking the binaries. This is the |
| 164 | # standard gcc linker script, except hacked so that an alternative |
| 165 | # load address can be specified by (1) asking gcc to use this script |
| 166 | # (-Wl,-T,valt_load_address.lds) and (2) setting the symbol |
| 167 | # valt_load_address to the required value |
| 168 | # (-Wl,-defsym,valt_load_address=0x70000000). |
| 169 | # |
| 170 | # Extract ld's default linker script and hack it to our needs. |
| 171 | # First we cut everything above and below the "=====..." lines at the top |
| 172 | # and bottom. |
| 173 | # Then we have to replace the load address with "valt_load_address". |
| 174 | # The line to replace in has one of the following two forms: |
| 175 | # |
| 176 | # . = 0x08048000 + SIZEOF_HEADERS; |
| 177 | # |
| 178 | # or |
| 179 | # PROVIDE (__executable_start = 0x08048000); . = 0x08048000 + SIZEOF_HEADERS; |
| 180 | # |
| 181 | # So we search for the line with a hex value "+ SIZEOF_HEADERS", and replace |
| 182 | # all the hex values in that line with "valt_load_address". |
tom | fb7bcde | 2005-11-07 15:24:38 +0000 | [diff] [blame] | 183 | valt_load_address_x86_linux.lds: Makefile |
| 184 | $(CC) @FLAG_M32@ -Wl,--verbose -nostdlib 2>&1 | sed \ |
sewardj | 45f4e7c | 2005-09-27 19:20:21 +0000 | [diff] [blame] | 185 | -e '1,/^=====\+$$/d' \ |
| 186 | -e '/^=====\+$$/d' \ |
| 187 | -e '/\. = 0x[0-9A-Fa-f]\+ + SIZEOF_HEADERS/s/0x[0-9A-Fa-f]\+/valt_load_address/g' > $@ \ |
| 188 | || rm -f $@ |
| 189 | |
tom | fb7bcde | 2005-11-07 15:24:38 +0000 | [diff] [blame] | 190 | valt_load_address_amd64_linux.lds: Makefile |
| 191 | $(CC) -m64 -Wl,--verbose -nostdlib 2>&1 | sed \ |
| 192 | -e '1,/^=====\+$$/d' \ |
| 193 | -e '/^=====\+$$/d' \ |
| 194 | -e '/\. = 0x[0-9A-Fa-f]\+ + SIZEOF_HEADERS/s/0x[0-9A-Fa-f]\+/valt_load_address/g' > $@ \ |
| 195 | || rm -f $@ |
| 196 | |
| 197 | valt_load_address_ppc32_linux.lds: Makefile |
sewardj | 2c48c7b | 2005-11-29 13:05:56 +0000 | [diff] [blame] | 198 | $(CC) @FLAG_M32@ -Wl,--verbose -nostdlib 2>&1 | sed \ |
| 199 | -e '1,/^=====\+$$/d' \ |
| 200 | -e '/^=====\+$$/d' \ |
| 201 | -e '/\. = 0x[0-9A-Fa-f]\+ + SIZEOF_HEADERS/s/0x[0-9A-Fa-f]\+/valt_load_address/g' > $@ \ |
| 202 | || rm -f $@ |
| 203 | |
| 204 | valt_load_address_ppc64_linux.lds: Makefile |
| 205 | $(CC) -m64 -Wl,--verbose -nostdlib 2>&1 | sed \ |
tom | fb7bcde | 2005-11-07 15:24:38 +0000 | [diff] [blame] | 206 | -e '1,/^=====\+$$/d' \ |
| 207 | -e '/^=====\+$$/d' \ |
| 208 | -e '/\. = 0x[0-9A-Fa-f]\+ + SIZEOF_HEADERS/s/0x[0-9A-Fa-f]\+/valt_load_address/g' > $@ \ |
| 209 | || rm -f $@ |