summaryrefslogtreecommitdiff
path: root/lib/am/data.am
diff options
context:
space:
mode:
authorStefano Lattarini <stefano.lattarini@gmail.com>2012-03-16 23:48:53 +0100
committerStefano Lattarini <stefano.lattarini@gmail.com>2012-03-18 19:29:45 +0100
commit368f1c4c295e3cc4c442af986a1cbb0daa16e3ad (patch)
tree4522c47291f88f86fd3da5ab289c198b84201ee2 /lib/am/data.am
parent6743961843f3d810500aabe20cfe2cb0e9ae5839 (diff)
downloadautomake-368f1c4c295e3cc4c442af986a1cbb0daa16e3ad.tar.gz
install: don't create empty dirs when an empty 'foo_PRIMARY' is used
Fixes automake bug#11030 and bug#10997. An empty declaration of "foo_PRIMARY" in a Makefile.am used to cause the generated install rules to create the directory $(foodir) anyway, even if nothing was to be installed there. While this could be seen as a convenient way to create a $(foodir) directory upon "make install" (respecting $(DESTDIR) settings and such), it also caused problems with conditionals; for example, an input of: if FALSE pgkdata_DATA = something endif caused the generated install rules to unconditionally create the $(pkgdatadir) directory (see automake bug#10997). Also, a user wanting to create an empty directory upon installation can easily do so with a custom install hook, as in: installdirs-local: $(MKDIR_P) $(DESTDIR)$(foodir) install-data-hook: installdirs-local On the other hand, the old behavior of "always create $(foodir), even if 'foo_PRIMARY' is empty" was harder and more tricky to override. Thus, from now on, an empty declaration of "foo_PRIMARY" will not cause the directory $(foodir) to be created upon "make install" anymore. * lib/am/data.am, lib/am/java.am, lib/am/libs.am, lib/am/lisp.am, lib/am/ltlib.am, lib/am/mans.am, lib/am/progs.am, lib/am/python.am, lib/am/scripts.am, lib/am/texinfos.am: Adjust install rules to avoid creating an installation directory if no files are actually to be installed there. * tests/instdir-empty.test: Remove, it was testing a semantic opposite to the one we now want and implement. * tests/instdir-no-empty.test: New test, check the new semantic. * tests/instdir-cond.test: Enhance. Move the still-failing part of the test ... * tests/instdir-cond2.test: ... here. * tests/list-of-tests.mk, tests/Makefile.am (XFAIL_TESTS): Update. * tests/java3.test: Adjust to avoid spurious failures. * HACKING, NEWS, THANKS: Update. Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
Diffstat (limited to 'lib/am/data.am')
-rw-r--r--lib/am/data.am14
1 files changed, 10 insertions, 4 deletions
diff --git a/lib/am/data.am b/lib/am/data.am
index 1817447de..98a38a832 100644
--- a/lib/am/data.am
+++ b/lib/am/data.am
@@ -1,6 +1,5 @@
## automake - create Makefile.in from Makefile.am
-## Copyright (C) 1994, 1995, 1996, 1998, 1999, 2001, 2003, 2004, 2006,
-## 2007, 2008, 2009 Free Software Foundation, Inc.
+## Copyright (C) 1994-2012 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
@@ -28,11 +27,14 @@ am__installdirs += "$(DESTDIR)$(%NDIR%dir)"
.PHONY install-%EXEC?exec:data%-am: install-%DIR%%PRIMARY%
install-%DIR%%PRIMARY%: $(%DIR%_%PRIMARY%)
@$(NORMAL_INSTALL)
- test -z "$(%NDIR%dir)" || $(MKDIR_P) "$(DESTDIR)$(%NDIR%dir)"
if %?BASE%
## Funny invocation because Makefile variable can be empty, leading to
## a syntax error in sh.
@list='$(%DIR%_%PRIMARY%)'; test -n "$(%NDIR%dir)" || list=; \
+ if test -n "$$list"; then \
+ echo " $(MKDIR_P) '$(DESTDIR)$(%NDIR%dir)'"; \
+ $(MKDIR_P) '$(DESTDIR)$(%NDIR%dir)' || exit 1; \
+ fi; \
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; \
@@ -47,13 +49,17 @@ if %?BASE%
done
else !%?BASE%
@list='$(%DIR%_%PRIMARY%)'; test -n "$(%NDIR%dir)" || list=; \
+ if test -n "$$list"; then \
+ echo " $(MKDIR_P) '$(DESTDIR)$(%NDIR%dir)'"; \
+ $(MKDIR_P) "$(DESTDIR)$(%NDIR%dir)" || exit 1; \
+ fi; \
$(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; \
test -z "$$xfiles" || { \
test "x$$dir" = x. || { \
- echo "$(MKDIR_P) '$(DESTDIR)$(%NDIR%dir)/$$dir'"; \
+ echo " $(MKDIR_P) '$(DESTDIR)$(%NDIR%dir)/$$dir'"; \
$(MKDIR_P) "$(DESTDIR)$(%NDIR%dir)/$$dir"; }; \
echo " $(INSTALL_%ONE_PRIMARY%) $$xfiles '$(DESTDIR)$(%NDIR%dir)/$$dir'"; \
$(INSTALL_%ONE_PRIMARY%) $$xfiles "$(DESTDIR)$(%NDIR%dir)/$$dir" || exit $$?; }; \