Nonrecursive Makefile.am: Ensuring directory creation?

2009-08-11 Thread Jack Kelly
Hello list,

I am writing a nonrecursive Makefile.am, and cannot find the
recommended way of requiring that directories in the source tree have
had their equivalents created in the build tree. This has led me to
write rules like this:

8---
doc/fake437-primitive.texi: doc/$(am__dirstamp)
include/fake437/primitive.h; $(EXTRACT_TEXI)
---8

but I feel that using anything starting with $(am__) is asking for
trouble by relying on internal details.

There's no mention of dirstamp in the info file and Googling didn't
yield anything useful either.

Does anyone have suggestions of where to look or better approaches?

-- Jack




Re: Nonrecursive Makefile.am: Ensuring directory creation?

2009-08-11 Thread Ralf Wildenhues
Hello Jack,

* Jack Kelly wrote on Tue, Aug 11, 2009 at 02:37:22PM CEST:
 I am writing a nonrecursive Makefile.am, and cannot find the
 recommended way of requiring that directories in the source tree have
 had their equivalents created in the build tree. This has led me to
 write rules like this:
 
 8---
 doc/fake437-primitive.texi: doc/$(am__dirstamp)
 include/fake437/primitive.h; $(EXTRACT_TEXI)
 ---8
 
 but I feel that using anything starting with $(am__) is asking for
 trouble by relying on internal details.

Right you are in assuming that.

Unfortunately, Automake doesn't yet provide a good API for directory
stamping yet.  You can easily use your own though, that don't interfere
with automake's stamps and rules:

  subdir/generated-file: subdir/my-dirstamp
commands ...
  subdir/my-dirstamp:
@$(MKDIR_P) subdir
@:  $@
  DISTCLEANFILES += subdir/my-dirstamp

Hope that helps.

Cheers,
Ralf




Re: Nonrecursive Makefile.am: Ensuring directory creation?

2009-08-11 Thread Russ Allbery
Ralf Wildenhues ralf.wildenh...@gmx.de writes:

 Unfortunately, Automake doesn't yet provide a good API for directory
 stamping yet.  You can easily use your own though, that don't interfere
 with automake's stamps and rules:

   subdir/generated-file: subdir/my-dirstamp
 commands ...
   subdir/my-dirstamp:
 @$(MKDIR_P) subdir
 @:  $@
   DISTCLEANFILES += subdir/my-dirstamp

A possibly simpler way, depending on what you're trying to accomplish, is
to do this at configure time:

AC_CONFIG_COMMANDS([tests/data/.placeholder], [touch tests/data/.placeholder])

-- 
Russ Allbery (r...@stanford.edu) http://www.eyrie.org/~eagle/