blob: cde1a548b133a108b89001ef52808e31c81e47b5 [file] [log] [blame]
sewardj55334242005-11-09 14:04:27 +00001
sewardj99a2ceb2007-11-09 12:30:36 +00002# 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.
sewardja273dc62007-11-17 18:35:54 +000012#
13# Note there is identical sed magic in Makefile.tool-inplace.am.
sewardj99a2ceb2007-11-09 12:30:36 +000014
sewardj55334242005-11-09 14:04:27 +000015# What the second for loop does: it copies libcoregrind.a and libvex.a
16# into the correct (target-specific) lib dirs at install time.
17# $(noinst_LIBRARIES) will look like this:
18# libcoregrind_x86_linux.a libreplacemalloc_toolpreload_x86_linux.a
19# libcoregrind_amd64_linux.a libreplacemalloc_toolpreload_amd64_linux.a
20# The 'if expr' filters out all but the libcoregrind_ ones.
21# pD and pU are the (arch,os) target pairs separated by a dash (pD) or
22# an underscore (pU) respectively, eg amd64-linux (pD) and amd64_linux (pU).
23# It then copies libcoregrind.a and libvex.a to the right places.
24
tomfb7bcde2005-11-07 15:24:38 +000025install-exec-local:
tom8609d392005-12-19 12:48:03 +000026 if [ -n "$(noinst_PROGRAMS)" ] ; then \
27 for f in $(noinst_PROGRAMS); do \
sewardj99a2ceb2007-11-09 12:30:36 +000028 name=`echo $$f | sed -e 's/-\([^-]*-[^-.]*\)\(\..*\)\?$$/\2/'`; \
29 plat=`echo $$f | sed -e 's/^.*-\([^-]*-[^-.]*\)\(\..*\)\?$$/\1/'`; \
30 $(mkinstalldirs) $(DESTDIR)$(valdir)/$$plat; \
31 $(INSTALL_PROGRAM) $$f $(DESTDIR)$(valdir)/$$plat/$$name; \
tom8609d392005-12-19 12:48:03 +000032 done ; \
33 fi ; \
34 if [ -n "$(noinst_LIBRARIES)" ] ; then \
sewardj1eff82b2006-10-17 00:56:43 +000035 for f in $(noinst_LIBRARIES) expr_wont_match_me; do \
tom8609d392005-12-19 12:48:03 +000036 if expr match $$f libcoregrind_ > /dev/null ; then \
37 pU=`echo $$f | sed -e 's/libcoregrind_//g' -e 's/\.a//g'` ; \
38 pD=`echo $$pU | sed -e 's/_/-/g'` ; \
39 $(INSTALL_DATA) $$f $(DESTDIR)$(valdir)/$$pD/libcoregrind.a ; \
sewardj99a2ceb2007-11-09 12:30:36 +000040 $(INSTALL_DATA) @VEX_DIR@/libvex_$$pU.a \
41 $(DESTDIR)$(valdir)/$$pD/libvex.a ; \
tom8609d392005-12-19 12:48:03 +000042 fi ; \
43 done ; \
44 fi