njn | 3e65340 | 2009-02-06 07:12:57 +0000 | [diff] [blame^] | 1 | # This is used by coregrind/Makefile.am and by <tool>/Makefile.am for doing |
| 2 | # "make install". It copies $(noinst_PROGRAMS) into $prefix/lib/valgrind/, |
| 3 | # doing some magic renaming as it does. |
| 4 | # It needs to be depended on by an 'install-exec-local' rule. |
| 5 | # There is similar code in Makefile.inplace.am. |
| 6 | # |
| 7 | # Details about the renaming: the loop copies a bunch of files with |
| 8 | # names of the form wurble-arch-os to $prefix/lib/valgrind/arch-os/wurble. |
sewardj | 99a2ceb | 2007-11-09 12:30:36 +0000 | [diff] [blame] | 9 | # There is some complexity in the sed mangling because wurble may itself |
| 10 | # contain a dash, which must be ignored. For example we want |
| 11 | # exp-omega-x86-linux |
| 12 | # to be installed in |
| 13 | # $prefix/lib/valgrind/x86-linux/exp-omega |
| 14 | # and not in |
| 15 | # $prefix/lib/valgrind/omega-x86-linux/exp |
| 16 | # or similarly mutant place. |
| 17 | |
njn | 3e65340 | 2009-02-06 07:12:57 +0000 | [diff] [blame^] | 18 | install-exec-local-programs: |
tom | 8609d39 | 2005-12-19 12:48:03 +0000 | [diff] [blame] | 19 | if [ -n "$(noinst_PROGRAMS)" ] ; then \ |
| 20 | for f in $(noinst_PROGRAMS); do \ |
sewardj | 99a2ceb | 2007-11-09 12:30:36 +0000 | [diff] [blame] | 21 | name=`echo $$f | sed -e 's/-\([^-]*-[^-.]*\)\(\..*\)\?$$/\2/'`; \ |
| 22 | plat=`echo $$f | sed -e 's/^.*-\([^-]*-[^-.]*\)\(\..*\)\?$$/\1/'`; \ |
| 23 | $(mkinstalldirs) $(DESTDIR)$(valdir)/$$plat; \ |
| 24 | $(INSTALL_PROGRAM) $$f $(DESTDIR)$(valdir)/$$plat/$$name; \ |
tom | 8609d39 | 2005-12-19 12:48:03 +0000 | [diff] [blame] | 25 | done ; \ |
tom | 8609d39 | 2005-12-19 12:48:03 +0000 | [diff] [blame] | 26 | fi |
njn | 3e65340 | 2009-02-06 07:12:57 +0000 | [diff] [blame^] | 27 | |