diff options
author | Ralf Wildenhues <Ralf.Wildenhues@gmx.de> | 2009-03-28 18:04:48 +0100 |
---|---|---|
committer | Ralf Wildenhues <Ralf.Wildenhues@gmx.de> | 2009-03-28 18:04:48 +0100 |
commit | 9bfd7e89c90b5ad1721e4bcb536bae2f7562dbba (patch) | |
tree | 3980d80629f3bd53d24c612f9da8007a2213832b /lib/am/data.am | |
parent | 0930139923e8db0b0334e17dc379682a63f73831 (diff) | |
download | automake-9bfd7e89c90b5ad1721e4bcb536bae2f7562dbba.tar.gz |
Sane (un)install for empty directory variables.
This patch fixes all install and uninstall rules to behave
sanely when $(wheredir) is the empty string, but $(where_HOW) is
nonempty, for all kinds of values of `where' and `HOW'.
* lib/am/data.am (install-%DIR%%PRIMARY%, uninstall-%DIR%%PRIMARY%):
Do not touch the install tree if the corresponding directory variable
$(%NDIR%dir) is empty.
* lib/am/java.am (install-%DIR%JAVA, uninstall-%DIR%JAVA): Likewise.
* lib/am/libs.am (install-%DIR%LIBRARIES, uninstall-%DIR%LIBRARIES):
Likewise.
* lib/am/lisp.am (install-%DIR%LISP, uninstall-%DIR%LISP): Likewise.
* lib/am/ltlib.am (install-%DIR%LTLIBRARIES, uninstall-%DIR%LTLIBRARIES):
Likewise.
* lib/am/mans.am (install-man%SECTION%, uninstall-man%SECTION%):
Likewise.
* lib/am/progs.am (install-%DIR%PROGRAMS, uninstall-%DIR%PROGRAMS):
Likewise.
* lib/am/python.am (install-%DIR%PYTHON, uninstall-%DIR%PYTHON):
Likewise.
* lib/am/scripts.am (install-%DIR%SCRIPTS, uninstall-%DIR%SCRIPTS):
Likewise.
* lib/am/texinfos.am (install-dvi-am, install-html-am, install-pdf-am)
(install-ps-am, uninstall-dvi-am, uninstall-html-am, uninstall-pdf-am)
(uninstall-ps-am): Likewise.
* tests/instdir2.test, tests/instdir-java.test,
tests/instdir-lisp.test, tests/instdir-ltlib.test,
tests/instdir-prog.test, tests/instdir-python.test,
tests/instdir-texi.test: New tests.
* tests/Makefile.am: Update.
* NEWS: Update.
Suggestion by Akim Demaille.
Signed-off-by: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
Diffstat (limited to 'lib/am/data.am')
-rw-r--r-- | lib/am/data.am | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/lib/am/data.am b/lib/am/data.am index 62383fa9f..3e0eec334 100644 --- a/lib/am/data.am +++ b/lib/am/data.am @@ -1,6 +1,6 @@ ## automake - create Makefile.in from Makefile.am ## Copyright (C) 1994, 1995, 1996, 1998, 1999, 2001, 2003, 2004, 2006, -## 2007, 2008 Free Software Foundation, Inc. +## 2007, 2008, 2009 Free Software Foundation, Inc. ## This program is free software; you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by @@ -32,7 +32,8 @@ install-%DIR%%PRIMARY%: $(%DIR%_%PRIMARY%) if %?BASE% ## Funny invocation because Makefile variable can be empty, leading to ## a syntax error in sh. - @list='$(%DIR%_%PRIMARY%)'; for p in $$list; do \ + @list='$(%DIR%_%PRIMARY%)'; test -n "$(%NDIR%dir)" || list=; \ + for p in $$list; do \ ## A file can be in the source directory or the build directory. if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ ## If the _%PRIMARY% variable has an entry like foo/bar, install it as @@ -45,8 +46,8 @@ if %?BASE% $(INSTALL_%ONE_PRIMARY%) $$files "$(DESTDIR)$(%NDIR%dir)" || exit $$?; \ done else !%?BASE% - @list='$(%DIR%_%PRIMARY%)'; $(am__nobase_list) | \ - while read dir files; do \ + @list='$(%DIR%_%PRIMARY%)'; test -n "$(%NDIR%dir)" || list=; \ + $(am__nobase_list) | while read dir files; do \ xfiles=; for file in $$files; do \ if test -f "$$file"; then xfiles="$$xfiles $$file"; \ else xfiles="$$xfiles $(srcdir)/$$file"; fi; done; \ @@ -69,7 +70,7 @@ if %?INSTALL% .PHONY uninstall-am: uninstall-%DIR%%PRIMARY% uninstall-%DIR%%PRIMARY%: @$(NORMAL_UNINSTALL) - @list='$(%DIR%_%PRIMARY%)'; \ + @list='$(%DIR%_%PRIMARY%)'; test -n "$(%NDIR%dir)" || list=; \ ?BASE? files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ ?!BASE? $(am__nobase_strip_setup); files=`$(am__nobase_strip)`; \ test -n "$$files" || exit 0; \ |