Re: Make clean runs autoconf

From: Ryan Davis <ryand-ruby@...>
Date: 2004-04-07 00:08:03 UTC
List: ruby-core #2759
On Mar 20, 2004, at 0:07, Gavin Sinclair wrote:

> That is a strange way to clean a build area.  Damn slow too.
> Looking at the generated Makefile, I can't see why.
> This is under Cygwin.

GNU make (at the least) attempts to rebuild makefiles when needed:

> after reading in all makefiles, `make' will consider
> each as a goal target and attempt to update it.  If a makefile has a
> rule which says how to update it (found either in that very makefile or
> in another one) or if an implicit rule applies to it (*note Using
> Implicit Rules: Implicit Rules.), it will be updated if necessary.

There is a Makefile rule that through transitive closure is dependent 
upon config.status, configure, and configure.in, so if any of those 
files are touched or missing, it'll rebuild.

The following is a patch that prevents a rebuild if the rule contains 
"clean" somewhere in the rule:

<534> cvs diff -du Makefile.in
Index: Makefile.in
===================================================================
RCS file: /src/ruby/Makefile.in,v
retrieving revision 1.55.2.4
diff -d -u -r1.55.2.4 Makefile.in
--- Makefile.in 7 Mar 2004 07:28:10 -0000       1.55.2.4
+++ Makefile.in 7 Apr 2004 00:05:03 -0000
@@ -200,7 +200,9 @@
                 end; \
                 ' > $@

+ifneq ($(findstring clean,$(MAKECMDGOALS)),clean)
  Makefile:      $(srcdir)/Makefile.in
+endif

  .PRECIOUS:     @MAKEFILES@

@@ -208,6 +210,7 @@

  PHONY:

+ifneq ($(findstring clean,$(MAKECMDGOALS)),clean)
  @MAKEFILES@: config.status
                 MAKE=$(MAKE) $(SHELL) ./config.status
                 @{ \
@@ -223,6 +226,7 @@

  $(srcdir)/configure: $(srcdir)/configure.in
                 cd $(srcdir) && $(AUTOCONF)
+endif

  .c.@OBJEXT@:
         $(CC) $(CFLAGS) $(CPPFLAGS) -c $<


In This Thread

Prev Next