|
From: <sv...@va...> - 2009-02-06 07:13:04
|
Author: njn Date: 2009-02-06 07:12:57 +0000 (Fri, 06 Feb 2009) New Revision: 9118 Log: Make Makefile.install.am much less confusing. Modified: trunk/Makefile.inplace.am trunk/Makefile.install.am trunk/Makefile.tool.am trunk/coregrind/Makefile.am Modified: trunk/Makefile.inplace.am =================================================================== --- trunk/Makefile.inplace.am 2009-02-06 06:39:37 UTC (rev 9117) +++ trunk/Makefile.inplace.am 2009-02-06 07:12:57 UTC (rev 9118) @@ -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 \ Modified: trunk/Makefile.install.am =================================================================== --- trunk/Makefile.install.am 2009-02-06 06:39:37 UTC (rev 9117) +++ trunk/Makefile.install.am 2009-02-06 07:12:57 UTC (rev 9118) @@ -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 @@ $(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 + Modified: trunk/Makefile.tool.am =================================================================== --- trunk/Makefile.tool.am 2009-02-06 06:39:37 UTC (rev 9117) +++ trunk/Makefile.tool.am 2009-02-06 07:12:57 UTC (rev 9118) @@ -153,3 +153,6 @@ LIBREPLACEMALLOC_LDFLAGS_PPC64_AIX5 = \ $(LIBREPLACEMALLOC_PPC64_AIX5) + + +install-exec-local: install-exec-local-programs Modified: trunk/coregrind/Makefile.am =================================================================== --- trunk/coregrind/Makefile.am 2009-02-06 06:39:37 UTC (rev 9117) +++ trunk/coregrind/Makefile.am 2009-02-06 07:12:57 UTC (rev 9118) @@ -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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 = \ |