[Top][All Lists]

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

May I use a _directory_ as a prerequisite?

From: Eric Hanchrow
Subject: May I use a _directory_ as a prerequisite?
Date: Thu, 29 Apr 2004 12:14:14 -0700
User-agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3.50 (gnu/linux)

I have a script that generates interface bindings by reading header
files.  (It's sort of a crude homemade version of `swig'.)  I want
this script to run not just when any of the files changes, but also
if any of those files _gets deleted_.  So I decided to write a rule
like this:

bindings: $(wildcard $(header_dir)/*.h) $(header_dir)

It seems to work -- that is, the rule runs not only when one of the
header files changes, but also after I delete or add a header file.

The question is: can I depend upon this behavior?  That is, can I
depend upon `make' reading the last-mod time of a directory?  The
documentation doesn't say anything about this; it only refers to
prerequisites as files.

Always code as if the guy who ends up maintaining your code will
    be a violent psychopath who knows where you live.  John F. Woods

reply via email to

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