%% Gianni Mariani <[EMAIL PROTECTED]> writes:
gm> It seems the attached Makefile will fail for a clean build. I
gm> read through the docs and it seems that there is nothing that says
gm> this should not work. The problem is a invalid assumption that if
gm> a implicit prerequisite's directory does not exist at the
gm> beginning then it must not be a candidate. It fails to not notice
gm> that during the bulding of other rules the directory will in fact
gm> be created.
There is a known issue with GNU make's directory caching. I've
considered adding a command-line option to disable it for makefiles
where it causes problems.
However, I wonder if you have considered doing this a different way?
Personally I think that depending on directories is not really a good
idea. While your method does solve most of the serious problems, it
seems hard to understand.
What I generally do is just use the $(shell ...) function to create
any needed directories when the makefile is invoked, as a kind of
pre-op. Like this:
WORKDIR=work.i686
__dummy := $(shell [ -d $(WORKDIR) ] || mkdir -p $(WORKDIR))
Now that directory gets created, if it doesn't exist, when the makefile
is parsed. It's always there, you don't need any target to depend on
it, etc.
--
-------------------------------------------------------------------------------
Paul D. Smith <[EMAIL PROTECTED]> Find some GNU make tips at:
http://www.gnu.org http://www.ultranet.com/~pauld/gmake/
"Please remain calm...I may be mad, but I am a professional." --Mad Scientist