]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Make Makefile.install.am much less confusing.
authorNicholas Nethercote <njn@valgrind.org>
Fri, 6 Feb 2009 07:12:57 +0000 (07:12 +0000)
committerNicholas Nethercote <njn@valgrind.org>
Fri, 6 Feb 2009 07:12:57 +0000 (07:12 +0000)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@9118

Makefile.inplace.am
Makefile.install.am
Makefile.tool.am
coregrind/Makefile.am

index 839fc32fae3f113f6f7adc464b92d8b8e0bc6ce3..c524832ddea10466080031b1527166c89438d7ee 100644 (file)
@@ -1,8 +1,8 @@
 # This is used by coregrind/Makefile.am and Makefile.tool.am for doing
 # "in-place" installs.  It copies $(noinst_PROGRAMS) into $inplacedir, doing
 # some magic renaming as it does.
-# For a description of what these magic sed commands do, see comments
-# in Makefile.install.am (which has identical magic)
+# There is similar code in Makefile.install.am (which describes how the
+# magic sed commands work).
 
 all-local:
        if [ -n "$(noinst_PROGRAMS)" ] ; then \
index 8ac1db947f9a9cd4625e901eb6e8f24c219f9eae..b2facf1bb375b0b78ed16067d544acfe458326e9 100644 (file)
@@ -1,6 +1,11 @@
-
-# What the first for loop does: it copies a bunch of files which names
-# of the form wurble-arch-os to $prefix/lib/valgrind/arch-os/wurble.
+# This is used by coregrind/Makefile.am and by <tool>/Makefile.am for doing
+# "make install".  It copies $(noinst_PROGRAMS) into $prefix/lib/valgrind/,
+# doing some magic renaming as it does.
+# It needs to be depended on by an 'install-exec-local' rule.
+# There is similar code in Makefile.inplace.am.
+#
+# Details about the renaming: the loop copies a bunch of files with
+# names of the form wurble-arch-os to $prefix/lib/valgrind/arch-os/wurble.
 # There is some complexity in the sed mangling because wurble may itself
 # contain a dash, which must be ignored.  For example we want
 #    exp-omega-x86-linux
@@ -9,20 +14,8 @@
 # and not in
 #    $prefix/lib/valgrind/omega-x86-linux/exp
 # or similarly mutant place.
-#
-# Note there is identical sed magic in Makefile.inplace.am.
 
-# What the second for loop does: it copies libcoregrind.a and libvex.a
-# into the correct (target-specific) lib dirs at install time.
-# $(noinst_LIBRARIES) will look like this:
-#    libcoregrind_x86_linux.a libreplacemalloc_toolpreload_x86_linux.a
-#    libcoregrind_amd64_linux.a libreplacemalloc_toolpreload_amd64_linux.a
-# The 'if expr' filters out all but the libcoregrind_ ones.
-# pD and pU are the (arch,os) target pairs separated by a dash (pD) or
-# an underscore (pU) respectively, eg amd64-linux (pD) and amd64_linux (pU).
-# It then copies libcoregrind.a and libvex.a to the right places.
-
-install-exec-local:
+install-exec-local-programs:
        if [ -n "$(noinst_PROGRAMS)" ] ; then \
          for f in $(noinst_PROGRAMS); do \
            name=`echo $$f | sed -e 's/-\([^-]*-[^-.]*\)\(\..*\)\?$$/\2/'`; \
@@ -30,15 +23,5 @@ install-exec-local:
            $(mkinstalldirs) $(DESTDIR)$(valdir)/$$plat; \
            $(INSTALL_PROGRAM) $$f $(DESTDIR)$(valdir)/$$plat/$$name; \
          done ; \
-       fi ; \
-       if [ -n "$(noinst_LIBRARIES)" ] ; then \
-         for f in $(noinst_LIBRARIES) expr_wont_match_me; do \
-           if expr match $$f libcoregrind_ > /dev/null ; then \
-             pU=`echo $$f | sed -e 's/libcoregrind_//g' -e 's/\.a//g'` ; \
-             pD=`echo $$pU | sed -e 's/_/-/g'` ; \
-             $(INSTALL_DATA) $$f $(DESTDIR)$(valdir)/$$pD/libcoregrind.a ; \
-             $(INSTALL_DATA) @VEX_DIR@/libvex_$$pU.a \
-                               $(DESTDIR)$(valdir)/$$pD/libvex.a ; \
-           fi ; \
-         done ; \
        fi
+
index 3c6be1a9ee6f7c49b79802e7c0ebaf38b4969929..8e896f1bd2e28f470f7f6152c1b386c9ffcc913e 100644 (file)
@@ -153,3 +153,6 @@ LIBREPLACEMALLOC_LDFLAGS_PPC32_AIX5 = \
 
 LIBREPLACEMALLOC_LDFLAGS_PPC64_AIX5 = \
        $(LIBREPLACEMALLOC_PPC64_AIX5)
+
+
+install-exec-local: install-exec-local-programs
index 4ae49d35bd2576bd6d06924ddcdbae7d1564c40f..d13d40baea5fc9b1cdd1ed5e373b1197a4528626 100644 (file)
@@ -1,8 +1,7 @@
 
 # Be very careful when renaming any files, targets, whatever, in this
-# Makefile.  The install-exec-local target in ../Makefile.install.am
-# does some fragile sed file-name-mangling which is liable to break if
-# the names of noinst_LIBRARIES or noinst_PROGRAMS change 'shape'.
+# Makefile.  Various parts of the system rely on these names having
+# particular forms.
 
 include $(top_srcdir)/Makefile.all.am
 include $(top_srcdir)/Makefile.flags.am
@@ -32,23 +31,30 @@ default.supp: $(SUPP_FILES)
 
 
 noinst_LIBRARIES =
+LIBPLATFORMS =
 if VGCONF_PLATFORMS_INCLUDE_X86_LINUX
 noinst_LIBRARIES += libcoregrind_x86_linux.a libreplacemalloc_toolpreload_x86_linux.a
+LIBPLATFORMS += x86_linux
 endif
 if VGCONF_PLATFORMS_INCLUDE_AMD64_LINUX
 noinst_LIBRARIES += libcoregrind_amd64_linux.a libreplacemalloc_toolpreload_amd64_linux.a
+LIBPLATFORMS += amd64_linux
 endif
 if VGCONF_PLATFORMS_INCLUDE_PPC32_LINUX
 noinst_LIBRARIES += libcoregrind_ppc32_linux.a libreplacemalloc_toolpreload_ppc32_linux.a
+LIBPLATFORMS += ppc32_linux
 endif
 if VGCONF_PLATFORMS_INCLUDE_PPC64_LINUX
 noinst_LIBRARIES += libcoregrind_ppc64_linux.a libreplacemalloc_toolpreload_ppc64_linux.a
+LIBPLATFORMS += ppc64_linux
 endif
 if VGCONF_PLATFORMS_INCLUDE_PPC32_AIX5
 noinst_LIBRARIES += libcoregrind_ppc32_aix5.a libreplacemalloc_toolpreload_ppc32_aix5.a
+LIBPLATFORMS += ppc32_aix5
 endif
 if VGCONF_PLATFORMS_INCLUDE_PPC64_AIX5
 noinst_LIBRARIES += libcoregrind_ppc64_aix5.a libreplacemalloc_toolpreload_ppc64_aix5.a
+LIBPLATFORMS += ppc64_aix5
 endif
 
 
@@ -267,7 +273,6 @@ libcoregrind_x86_linux_a_SOURCES = \
        m_sigframe/sigframe-x86-linux.c \
        m_syswrap/syscall-x86-linux.S \
        m_syswrap/syswrap-x86-linux.c
-
 libcoregrind_x86_linux_a_CPPFLAGS = $(AM_CPPFLAGS_X86_LINUX)
 libcoregrind_x86_linux_a_CFLAGS = $(AM_CFLAGS_X86_LINUX)
 libcoregrind_x86_linux_a_CCASFLAGS = $(AM_CCASFLAGS_X86_LINUX)
@@ -280,7 +285,6 @@ libcoregrind_amd64_linux_a_SOURCES = \
        m_sigframe/sigframe-amd64-linux.c \
        m_syswrap/syscall-amd64-linux.S \
        m_syswrap/syswrap-amd64-linux.c
-
 libcoregrind_amd64_linux_a_CPPFLAGS = $(AM_CPPFLAGS_AMD64_LINUX)
 libcoregrind_amd64_linux_a_CFLAGS = $(AM_CFLAGS_AMD64_LINUX)
 libcoregrind_amd64_linux_a_CCASFLAGS = $(AM_CCASFLAGS_AMD64_LINUX)
@@ -293,7 +297,6 @@ libcoregrind_ppc32_linux_a_SOURCES = \
        m_sigframe/sigframe-ppc32-linux.c \
        m_syswrap/syscall-ppc32-linux.S \
        m_syswrap/syswrap-ppc32-linux.c
-
 libcoregrind_ppc32_linux_a_CPPFLAGS = $(AM_CPPFLAGS_PPC32_LINUX)
 libcoregrind_ppc32_linux_a_CFLAGS = $(AM_CFLAGS_PPC32_LINUX)
 libcoregrind_ppc32_linux_a_CCASFLAGS = $(AM_CCASFLAGS_PPC32_LINUX)
@@ -306,7 +309,6 @@ libcoregrind_ppc64_linux_a_SOURCES = \
        m_sigframe/sigframe-ppc64-linux.c \
        m_syswrap/syscall-ppc64-linux.S \
        m_syswrap/syswrap-ppc64-linux.c
-
 libcoregrind_ppc64_linux_a_CPPFLAGS = $(AM_CPPFLAGS_PPC64_LINUX)
 libcoregrind_ppc64_linux_a_CFLAGS = $(AM_CFLAGS_PPC64_LINUX)
 libcoregrind_ppc64_linux_a_CCASFLAGS = $(AM_CCASFLAGS_PPC64_LINUX)
@@ -319,7 +321,6 @@ libcoregrind_ppc32_aix5_a_SOURCES = \
        m_sigframe/sigframe-ppc32-aix5.c \
        m_syswrap/syscall-ppc32-aix5.S \
        m_syswrap/syswrap-ppc32-aix5.c
-
 libcoregrind_ppc32_aix5_a_CPPFLAGS = $(AM_CPPFLAGS_PPC32_AIX5)
 libcoregrind_ppc32_aix5_a_CFLAGS = $(AM_CFLAGS_PPC32_AIX5)
 libcoregrind_ppc32_aix5_a_CCASFLAGS = $(AM_CCASFLAGS_PPC32_AIX5)
@@ -333,7 +334,6 @@ libcoregrind_ppc64_aix5_a_SOURCES = \
        m_sigframe/sigframe-ppc64-aix5.c \
        m_syswrap/syscall-ppc64-aix5.S \
        m_syswrap/syswrap-ppc64-aix5.c
-
 libcoregrind_ppc64_aix5_a_CPPFLAGS = $(AM_CPPFLAGS_PPC64_AIX5)
 libcoregrind_ppc64_aix5_a_CFLAGS = $(AM_CFLAGS_PPC64_AIX5)
 libcoregrind_ppc64_aix5_a_CCASFLAGS = $(AM_CCASFLAGS_PPC64_AIX5)
@@ -418,6 +418,22 @@ vgpreload_core_ppc64_aix5_so_LDFLAGS = $(PRELOAD_LDFLAGS_PPC64_AIX5)
 clean-local:
        $(MAKE) -C @VEX_DIR@ CC="$(CC)" AR="$(AR)" clean
 
+# Nb: The loop installs some .a files for possible use by standalone tools
+# into the correct (target-specific) lib dirs at install time.
+# $(LIBPLATFORMS) will look like this:
+#    x86_linux amd64_linux
+# pD and pU are the (arch,os) target pairs separated by a dash (pD) or
+# an underscore (pU) respectively, eg amd64-linux (pD) and amd64_linux (pU).
+# It then copies the libraries to the right places.
+install-exec-local: install-exec-local-programs
+       for pU in $(LIBPLATFORMS) ; do \
+         pD=`echo $$pU | sed -e 's/_/-/g'` ; \
+         $(INSTALL_DATA) libcoregrind_$$pU.a $(DESTDIR)$(valdir)/$$pD/libcoregrind.a ; \
+         $(INSTALL_DATA) libreplacemalloc_toolpreload_$$pU.a $(DESTDIR)$(valdir)/$$pD/libreplacemalloc_toolpreload.a ; \
+         $(INSTALL_DATA) @VEX_DIR@/libvex_$$pU.a $(DESTDIR)$(valdir)/$$pD/libvex.a ; \
+       done
+
+
 MANUAL_DEPS = $(noinst_HEADERS) $(include_HEADERS)
 
 EXTRA_DIST = \