automake
[Top][All Lists]
Advanced

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

Re: make dist and sources in subdirs


From: Robert Collins
Subject: Re: make dist and sources in subdirs
Date: Thu, 5 Apr 2001 20:44:48 +1000

----- Original Message -----
From: "Lars J. Aas" <address@hidden>
To: "Robert Collins" <address@hidden>
Cc: <address@hidden>
Sent: Thursday, April 05, 2001 5:34 PM
Subject: Re: make dist and sources in subdirs


> On Thu, Apr 05, 2001 at 09:20:46AM +0200, Lars J. Aas wrote:
> : On Thu, Apr 05, 2001 at 08:33:52AM +1000, Robert Collins wrote:
> : : I take it the answer to this is "yes it solves creating the
directory?"
> : : The reason why I was hoping to avoid a Makefile is that it saves a
level
> : : of recursion during make, and on cygwin that saves time.
> :
> : I'm doing the same thing for some libraries, and trying to fix the
dist
>
> Scratch that - I'm doing something different.  I still need to make
the
> dist rules more directory-aware, though.
>
>   Lars J
>

I tried adding a makefile in each leaf dir, and that didn't fix the
problem. Adding a DIST_SUBDIRS entry didn't either ..Switching the order
of the distdir commands did however:
from
===
distdir: $(DISTFILES)
        @for file in $(DISTFILES); do \
          d=$(srcdir); \
          if test -d $$d/$$file; then \
            cp -pR $$d/$$file $(distdir) \
            || exit 1; \
          else \
            test -f $(distdir)/$$file \
            || cp -p $$d/$$file $(distdir)/$$file \
            || exit 1; \
          fi; \
        done
        for subdir in $(DIST_SUBDIRS); do \
          if test "$$subdir" = .; then :; else \
            test -d $(distdir)/$$subdir \
            || mkdir $(distdir)/$$subdir \
            || exit 1; \
            (cd $$subdir && \
              $(MAKE) $(AM_MAKEFLAGS) \
                top_distdir="$(top_distdir)" \
                distdir=../$(distdir)/$$subdir \
                distdir) \
              || exit 1; \
          fi; \
        done
===
to
===
distdir: $(DISTFILES)
        for subdir in $(DIST_SUBDIRS); do \
          if test "$$subdir" = .; then :; else \
            test -d $(distdir)/$$subdir \
            || mkdir $(distdir)/$$subdir \
            || exit 1; \
            (cd $$subdir && \
              $(MAKE) $(AM_MAKEFLAGS) \
                top_distdir="$(top_distdir)" \
                distdir=../$(distdir)/$$subdir \
                distdir) \
              || exit 1; \
          fi; \
        done
        @for file in $(DISTFILES); do \
          d=$(srcdir); \
          if test -d $$d/$$file; then \
            cp -pR $$d/$$file $(distdir) \
            || exit 1; \
          else \
            test -f $(distdir)/$$file \
            || cp -p $$d/$$file $(distdir)/$$file \
            || exit 1; \
          fi; \
        done
===

I haven't dug into the automake sources yet, so perhaps I can just ask -
will this cause problems if it was the default? (I know it becomes a
depth first search). Perhaps making the directory first and then
iterating into after doing the current directories file (if depth first
is an issue).

This doesn't solve the issue if you are building with sources
like foo/bar/abe.c but it will solve foo/bar.c

Rob




reply via email to

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