automake-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Patch: RFC: fix for PR 46


From: Tom Tromey
Subject: Patch: RFC: fix for PR 46
Date: 14 Jul 2002 23:38:19 -0600
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2

This fixes PR automake/46.

With this fix, you can add a directory and a top-level `make' will
correctly automake and config.status the new directory.

The drawbacks:

* You must run `make' from the top build directory only; the feature
  won't work (but won't hurt) if you run make in a subdir
* At the top level it always re-runs automake and config.status, which
  could be slow, especially for a large project

In fact, the speed, especially of running automake, for a large
project is largely what is stopping me from simply checking this in.
Our test suite is deceptively simple here.  I suspect that running
automake on something like gstreamer will give a very different
feeling.

If you read the PR, you'll see another idea from Alexandre Oliva,
namely to make the recursive rules depend on each subdir Makefile.
This is an attractive idea, but I think it has a major drawback.
Suppose you want to remove a directory: you remove it from SUBDIRS,
AC_OUTPUT, and the filesystem.  Then a simple `make' will fail,
because the old Makefile won't find the now-removed Makefile.

Comments?  Suggestions?

Tom

Index: ChangeLog
from  Tom Tromey  <address@hidden>

        For PR automake/46:
        * tests/Makefile.am (XFAIL_TESTS): Removed subdir5.test.
        * lib/am/configure.am (%MAKEFILE-IN%): At top level, run automake
        for all directories.
        (%MAKEFILE%): At top level, run config.status for all files.

Index: lib/am/configure.am
===================================================================
RCS file: /cvs/automake/automake/lib/am/configure.am,v
retrieving revision 1.13
diff -u -r1.13 configure.am
--- lib/am/configure.am 6 Jun 2002 08:34:41 -0000 1.13
+++ lib/am/configure.am 15 Jul 2002 05:24:24 -0000
@@ -23,14 +23,26 @@
 
 ## This rule remakes the Makefile.in.
 %MAKEFILE-IN%: %MAINTAINER-MODE% %MAKEFILE-AM% %MAKEFILE-IN-DEPS% 
$(top_srcdir)/%CONFIGURE-AC% $(ACLOCAL_M4)
+if %?TOPDIR_P%
+## In the topmost directory, just rebuild everything.  This lets
+## things work correctly if the user adds a new directory.
+       cd $(top_srcdir) && $(AUTOMAKE) --%STRICTNESS% %USE-DEPS%
+else !%?TOPDIR_P%
        cd $(top_srcdir) && \
          $(AUTOMAKE) --%STRICTNESS% %USE-DEPS% %MAKEFILE-AM-SOURCES%
+endif !%?TOPDIR_P%
 
 ## This rule remakes the Makefile.
 %MAKEFILE%: %MAINTAINER-MODE% %MAKEFILE-IN% %MAKEFILE-DEPS% 
$(top_builddir)/config.status
+if %?TOPDIR_P%
+## In the topmost directory, just rebuild everything.  This lets
+## things work correctly if the user adds a new directory.
+       $(SHELL) ./config.status
+else !%?TOPDIR_P%
 ## FIXME: $(am__depfiles_maybe) lets us re-run the rule to create the
 ## .P files.  Ideally we wouldn't have to do this by hand.
        cd $(top_builddir) && $(SHELL) ./config.status %CONFIG-MAKEFILE% 
$(am__depfiles_maybe)
+endif !%?TOPDIR_P%
 
 
 
Index: tests/Makefile.am
===================================================================
RCS file: /cvs/automake/automake/tests/Makefile.am,v
retrieving revision 1.417
diff -u -r1.417 Makefile.am
--- tests/Makefile.am 12 Jul 2002 08:00:57 -0000 1.417
+++ tests/Makefile.am 15 Jul 2002 05:24:24 -0000
@@ -1,6 +1,6 @@
 ## Process this file with automake to create Makefile.in
 
-XFAIL_TESTS = subdir5.test auxdir2.test cond17.test
+XFAIL_TESTS = auxdir2.test cond17.test
 
 TESTS =        \
 acinclude.test \
Index: tests/Makefile.in
===================================================================
RCS file: /cvs/automake/automake/tests/Makefile.in,v
retrieving revision 1.537
diff -u -r1.537 Makefile.in
--- tests/Makefile.in 12 Jul 2002 08:00:57 -0000 1.537
+++ tests/Makefile.in 15 Jul 2002 05:24:24 -0000
@@ -87,7 +87,7 @@
 sysconfdir = @sysconfdir@
 target_alias = @target_alias@
 
-XFAIL_TESTS = subdir5.test auxdir2.test cond17.test
+XFAIL_TESTS = auxdir2.test cond17.test
 
 TESTS = \
 acinclude.test \



reply via email to

[Prev in Thread] Current Thread [Next in Thread]