sewardj | 5533424 | 2005-11-09 14:04:27 +0000 | [diff] [blame] | 1 | |
sewardj | 99a2ceb | 2007-11-09 12:30:36 +0000 | [diff] [blame] | 2 | # What the first for loop does: it copies a bunch of files which names |
| 3 | # of the form wurble-arch-os to $prefix/lib/valgrind/arch-os/wurble. |
| 4 | # There is some complexity in the sed mangling because wurble may itself |
| 5 | # contain a dash, which must be ignored. For example we want |
| 6 | # exp-omega-x86-linux |
| 7 | # to be installed in |
| 8 | # $prefix/lib/valgrind/x86-linux/exp-omega |
| 9 | # and not in |
| 10 | # $prefix/lib/valgrind/omega-x86-linux/exp |
| 11 | # or similarly mutant place. |
| 12 | |
sewardj | 5533424 | 2005-11-09 14:04:27 +0000 | [diff] [blame] | 13 | # What the second for loop does: it copies libcoregrind.a and libvex.a |
| 14 | # into the correct (target-specific) lib dirs at install time. |
| 15 | # $(noinst_LIBRARIES) will look like this: |
| 16 | # libcoregrind_x86_linux.a libreplacemalloc_toolpreload_x86_linux.a |
| 17 | # libcoregrind_amd64_linux.a libreplacemalloc_toolpreload_amd64_linux.a |
| 18 | # The 'if expr' filters out all but the libcoregrind_ ones. |
| 19 | # pD and pU are the (arch,os) target pairs separated by a dash (pD) or |
| 20 | # an underscore (pU) respectively, eg amd64-linux (pD) and amd64_linux (pU). |
| 21 | # It then copies libcoregrind.a and libvex.a to the right places. |
| 22 | |
tom | fb7bcde | 2005-11-07 15:24:38 +0000 | [diff] [blame] | 23 | install-exec-local: |
tom | 8609d39 | 2005-12-19 12:48:03 +0000 | [diff] [blame] | 24 | if [ -n "$(noinst_PROGRAMS)" ] ; then \ |
| 25 | for f in $(noinst_PROGRAMS); do \ |
sewardj | 99a2ceb | 2007-11-09 12:30:36 +0000 | [diff] [blame] | 26 | name=`echo $$f | sed -e 's/-\([^-]*-[^-.]*\)\(\..*\)\?$$/\2/'`; \ |
| 27 | plat=`echo $$f | sed -e 's/^.*-\([^-]*-[^-.]*\)\(\..*\)\?$$/\1/'`; \ |
| 28 | $(mkinstalldirs) $(DESTDIR)$(valdir)/$$plat; \ |
| 29 | $(INSTALL_PROGRAM) $$f $(DESTDIR)$(valdir)/$$plat/$$name; \ |
tom | 8609d39 | 2005-12-19 12:48:03 +0000 | [diff] [blame] | 30 | done ; \ |
| 31 | fi ; \ |
| 32 | if [ -n "$(noinst_LIBRARIES)" ] ; then \ |
sewardj | 1eff82b | 2006-10-17 00:56:43 +0000 | [diff] [blame] | 33 | for f in $(noinst_LIBRARIES) expr_wont_match_me; do \ |
tom | 8609d39 | 2005-12-19 12:48:03 +0000 | [diff] [blame] | 34 | if expr match $$f libcoregrind_ > /dev/null ; then \ |
| 35 | pU=`echo $$f | sed -e 's/libcoregrind_//g' -e 's/\.a//g'` ; \ |
| 36 | pD=`echo $$pU | sed -e 's/_/-/g'` ; \ |
| 37 | $(INSTALL_DATA) $$f $(DESTDIR)$(valdir)/$$pD/libcoregrind.a ; \ |
sewardj | 99a2ceb | 2007-11-09 12:30:36 +0000 | [diff] [blame] | 38 | $(INSTALL_DATA) @VEX_DIR@/libvex_$$pU.a \ |
| 39 | $(DESTDIR)$(valdir)/$$pD/libvex.a ; \ |
tom | 8609d39 | 2005-12-19 12:48:03 +0000 | [diff] [blame] | 40 | fi ; \ |
| 41 | done ; \ |
| 42 | fi |