blob: 8870758d39e11758647f6ca143cefb020e8df8fd [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.
12
sewardj55334242005-11-09 14:04:27 +000013# 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
tomfb7bcde2005-11-07 15:24:38 +000023install-exec-local:
tom8609d392005-12-19 12:48:03 +000024 if [ -n "$(noinst_PROGRAMS)" ] ; then \
25 for f in $(noinst_PROGRAMS); do \
sewardj99a2ceb2007-11-09 12:30:36 +000026 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; \
tom8609d392005-12-19 12:48:03 +000030 done ; \
31 fi ; \
32 if [ -n "$(noinst_LIBRARIES)" ] ; then \
sewardj1eff82b2006-10-17 00:56:43 +000033 for f in $(noinst_LIBRARIES) expr_wont_match_me; do \
tom8609d392005-12-19 12:48:03 +000034 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 ; \
sewardj99a2ceb2007-11-09 12:30:36 +000038 $(INSTALL_DATA) @VEX_DIR@/libvex_$$pU.a \
39 $(DESTDIR)$(valdir)/$$pD/libvex.a ; \
tom8609d392005-12-19 12:48:03 +000040 fi ; \
41 done ; \
42 fi