blob: b2facf1bb375b0b78ed16067d544acfe458326e9 [file] [log] [blame]
njn3e653402009-02-06 07:12:57 +00001# 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.
sewardj99a2ceb2007-11-09 12:30:36 +00009# 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
njn3e653402009-02-06 07:12:57 +000018install-exec-local-programs:
tom8609d392005-12-19 12:48:03 +000019 if [ -n "$(noinst_PROGRAMS)" ] ; then \
20 for f in $(noinst_PROGRAMS); do \
sewardj99a2ceb2007-11-09 12:30:36 +000021 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; \
tom8609d392005-12-19 12:48:03 +000025 done ; \
tom8609d392005-12-19 12:48:03 +000026 fi
njn3e653402009-02-06 07:12:57 +000027