[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[automake-commit] branch master updated: automake: install-exec did not
From: |
Karl Berry |
Subject: |
[automake-commit] branch master updated: automake: install-exec did not depend on $(BUILT_SOURCES). |
Date: |
Tue, 06 Oct 2020 21:16:28 -0400 |
This is an automated email from the git hooks/post-receive script.
karl pushed a commit to branch master
in repository automake.
View the commit online:
https://git.savannah.gnu.org/gitweb/?p=automake.git;a=commitdiff;h=dbc1c9e775b0ce78c3cbb912d5e9934f8a99965a
The following commit(s) were added to refs/heads/master by this push:
new dbc1c9e automake: install-exec did not depend on $(BUILT_SOURCES).
dbc1c9e is described below
commit dbc1c9e775b0ce78c3cbb912d5e9934f8a99965a
Author: Karl Berry <karl@freefriends.org>
AuthorDate: Tue Oct 6 18:16:14 2020 -0700
automake: install-exec did not depend on $(BUILT_SOURCES).
This change fixes https://bugs.gnu.org/43683.
* lib/am/install.am (install-exec): %maybe_BUILT_SOURCES% dependency,
twice. Basic patch from madmurphy (tiny change), message#8.
(.MAKE) [maybe_BUILT_SOURCES]: depend on install-exec.
* NEWS: mention it.
* doc/automake.texi (Sources): mention this (also that make dist
depends on $(BUILT_SOURCES)).
* t/built-sources-install-exec.sh: new test.
* t/list-of-tests.mk (handwritten_TESTS): add it.
* t/built-sources-install.sh: typo.
* t/built-sources-check.sh: typo.
---
NEWS | 2 ++
doc/automake.texi | 22 ++++++-------
lib/am/install.am | 5 +--
t/built-sources-check.sh | 2 +-
...es-install.sh => built-sources-install-exec.sh} | 36 +++-------------------
t/built-sources-install.sh | 2 +-
t/list-of-tests.mk | 1 +
7 files changed, 23 insertions(+), 47 deletions(-)
diff --git a/NEWS b/NEWS
index f36011c..eb17e48 100644
--- a/NEWS
+++ b/NEWS
@@ -75,6 +75,8 @@ New in ?.?.?:
contrib/checklinkx (a small modification of W3C checklink) added,
with accompany target checklinkx to recheck urls.
+ - install-exec target depends on $(BUILT_SOURCES).
+
- valac argument matching more precise, to avoid garbage in DIST_COMMON.
* Distribution
diff --git a/doc/automake.texi b/doc/automake.texi
index 738eb84..91e1d67 100644
--- a/doc/automake.texi
+++ b/doc/automake.texi
@@ -7361,11 +7361,11 @@ rule to build @file{foo.h} first by lack of dependency
information.
@cindex @code{BUILT_SOURCES}, defined
The @code{BUILT_SOURCES} variable is a workaround for this problem. A
-source file listed in @code{BUILT_SOURCES} is made on @samp{make all}
-or @samp{make check} (or even @samp{make install}) before other
-targets are processed. However, such a source file is not
-@emph{compiled} unless explicitly requested by mentioning it in some
-other @code{_SOURCES} variable.
+source file listed in @code{BUILT_SOURCES} is made when @samp{make
+all}, @samp{make check}, @samp{make install}, @samp{make install-exec}
+(or @code{make dist}) is run, before other targets are processed.
+However, such a source file is not @emph{compiled} unless explicitly
+requested by mentioning it in some other @code{_SOURCES} variable.
So, to conclude our introductory example, we could use
@samp{BUILT_SOURCES = foo.h} to ensure @file{foo.h} gets built before
@@ -7380,12 +7380,12 @@ doesn't need to appear in @code{BUILT_SOURCES} (unless
it is included by
another source), because it's a known dependency of the associated
object.
-It might be important to emphasize that @code{BUILT_SOURCES} is
-honored only by @samp{make all}, @samp{make check} and @samp{make
-install}. This means you cannot build a specific target (e.g.,
-@samp{make foo}) in a clean tree if it depends on a built source.
-However it will succeed if you have run @samp{make all} earlier,
-because accurate dependencies are already available.
+To emphasize, @code{BUILT_SOURCES} is honored only by @samp{make all},
+@samp{make check}, @samp{make install}, and @code{make install-exec}
+(and @samp{make dist}). This means you cannot build an arbitrary
+target (e.g., @samp{make foo}) in a clean tree if it depends on a
+built source. However it will succeed if you have run @samp{make all}
+earlier, because accurate dependencies are already available.
The next section illustrates and discusses the handling of built sources
on a toy example.
diff --git a/lib/am/install.am b/lib/am/install.am
index 3f9831f..8066def 100644
--- a/lib/am/install.am
+++ b/lib/am/install.am
@@ -52,18 +52,19 @@ if %?SUBDIRS%
RECURSIVE_TARGETS += install-data-recursive install-exec-recursive \
install-recursive uninstall-recursive
install:%maybe_BUILT_SOURCES% install-recursive
-install-exec: install-exec-recursive
+install-exec:%maybe_BUILT_SOURCES% install-exec-recursive
install-data: install-data-recursive
uninstall: uninstall-recursive
else !%?SUBDIRS%
install:%maybe_BUILT_SOURCES% install-am
-install-exec: install-exec-am
+install-exec:%maybe_BUILT_SOURCES% install-exec-am
install-data: install-data-am
uninstall: uninstall-am
endif !%?SUBDIRS%
if %?maybe_BUILT_SOURCES%
.MAKE: install
+.MAKE: install-exec
endif %?maybe_BUILT_SOURCES%
.MAKE .PHONY: install-am
diff --git a/t/built-sources-check.sh b/t/built-sources-check.sh
index 2b73e39..54adf0c 100644
--- a/t/built-sources-check.sh
+++ b/t/built-sources-check.sh
@@ -44,7 +44,7 @@ BUILT_SOURCES = command2.inc
check_SCRIPTS = echo.sh
echo.sh:
## The next line ensures that command1.inc has been built before
-## recurring into the subdir.
+## recursing into the subdir.
test -f ../command1.inc
(echo '#! /bin/sh'; cat command2.inc) > $@
chmod +x $@
diff --git a/t/built-sources-install.sh b/t/built-sources-install-exec.sh
old mode 100644
new mode 100755
similarity index 53%
copy from t/built-sources-install.sh
copy to t/built-sources-install-exec.sh
index f4bd57f..47c7f1a
--- a/t/built-sources-install.sh
+++ b/t/built-sources-install-exec.sh
@@ -14,44 +14,19 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
-# Make sure 'install:' honors $(BUILT_SOURCES).
-# PR/359.
+# Test that 'install-exec:' honors $(BUILT_SOURCES);
+# https://bugs.gnu.org/43683.
. test-init.sh
cat >> configure.ac << 'END'
-AC_CONFIG_FILES([dir/Makefile])
AC_OUTPUT
END
-mkdir dir
-
cat > Makefile.am << 'END'
BUILT_SOURCES = built1
-SUBDIRS = dir
built1:
echo ok > $@
-CLEANFILES = built1
-install-data-hook:
- $(MKDIR_P) $(DESTDIR)$(prefix)/dir2
- cp built1 $(DESTDIR)$(prefix)/built1
- cp dir/built2 $(DESTDIR)$(prefix)/dir2/built3
-uninstall-hook:
- rm -f $(DESTDIR)$(prefix)/built1
- rm -f $(DESTDIR)$(prefix)/dir2/built3
- rmdir $(DESTDIR)$(prefix)/dir2
-installcheck-local:
- test -f $(prefix)/built1
- test -f $(prefix)/dir2/built3
-END
-
-cat > dir/Makefile.am << 'END'
-BUILT_SOURCES = built2
-built2:
-## The next line ensures that command1.inc has been built before
-## recurring into the subdir.
- cp ../built1 $@
-CLEANFILES = built2
END
$ACLOCAL
@@ -59,11 +34,8 @@ $AUTOCONF
$AUTOMAKE
./configure --prefix "$(pwd)/inst"
-# Now make sure these two files are rebuilt during make install.
-$MAKE install
+# Make sure this file is rebuilt by make install-exec.
+$MAKE install-exec
test -f built1
-test -f dir/built2
-$MAKE installcheck
-$MAKE distcheck
:
diff --git a/t/built-sources-install.sh b/t/built-sources-install.sh
index f4bd57f..f5109a4 100644
--- a/t/built-sources-install.sh
+++ b/t/built-sources-install.sh
@@ -49,7 +49,7 @@ cat > dir/Makefile.am << 'END'
BUILT_SOURCES = built2
built2:
## The next line ensures that command1.inc has been built before
-## recurring into the subdir.
+## recursing into the subdir.
cp ../built1 $@
CLEANFILES = built2
END
diff --git a/t/list-of-tests.mk b/t/list-of-tests.mk
index 3bd1211..f44eed0 100644
--- a/t/list-of-tests.mk
+++ b/t/list-of-tests.mk
@@ -203,6 +203,7 @@ t/built-sources-check.sh \
t/built-sources-cond.sh \
t/built-sources-fork-bomb.sh \
t/built-sources-install.sh \
+t/built-sources-install-exec.sh \
t/built-sources-subdir.sh \
t/built-sources.sh \
t/candist.sh \
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [automake-commit] branch master updated: automake: install-exec did not depend on $(BUILT_SOURCES).,
Karl Berry <=