automake
[Top][All Lists]
Advanced

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

cleaning in conditional subdirs


From: Steve Robbins
Subject: cleaning in conditional subdirs
Date: Sun, 5 Nov 2000 17:12:44 -0500 (EST)

Hi,

I just ran into some "surprising" behaviour.

[Apologies if this has been covered before -- I couldn't figure out how to
search the list archives at http://mail.gnu.org/mailman/listinfo/automake.]


The situation is (and I double-checked that it persists with CVS automake
and autoconf) with a Makefile.am and conditionally-defined SUBDIRS, e.g.

        if USE_B
        SUBDIRS = a b
        else
        SUBDIRS = a
        endif

Now, suppose "USE_B" is false.  

Of course, configure.in lists b/Makefile in AC_OUTPUT, so b/Makefile is
generated.  

The variable SUBDIRS is defined as "a" alone, so all rules but one do NOT
descend into subdir "b" (the exception is "make distdir").

This means that the sequence
        ./configure
        make distclean

which one expects (after a fresh unpacking of the .tar.gz) to be a no-op,
will in fact create the file b/Makefile.


Now, on the face of it, an obvious remedy seems to be that all the "make
clean" family (clean,distclean,maintainer-clean) of rules should descend
into all possible subdirs, as does the "distdir" rule.

Would that be correct?  Are there drawbacks?

Thanks,
-Steve





reply via email to

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