[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Explicit, implicit rule chain doesn't work in created dirs
From: |
barkalow |
Subject: |
Explicit, implicit rule chain doesn't work in created dirs |
Date: |
Tue, 27 Aug 2002 14:02:48 -0400 (EDT) |
I found this with make 3.78.1 (from redhat 6.2); it is the same in 3.79.1
Non-working Makefile:
------
dir:
mkdir -p dir/subdir
dir/subdir/file.b: dir
touch dir/subdir/file.b
dir/subdir/%.a: dir/subdir/%.b
cp $< $@
all: dir/subdir/file.a
------
if dir/subdir doesn't exist, "make all" fails:
*** No rule to make target `dir/subdir/file.a', needed by `all'.
if they do exist, everything is fine.
if the rule for file.b is a pattern rule:
------
dir:
mkdir -p dir/subdir
%/subdir/file.b: %
touch dir/subdir/file.b
dir/subdir/%.a: dir/subdir/%.b
cp $< $@
all: dir/subdir/file.a
------
everything is fine in either case.
I assume my original example is supposed to work, since it works if the
directory exists (not a condition mentioned anywhere I can see), and using
a pattern rule instead of a regular rule works (which should, if anything,
be less likely to work).
-Daniel
*This .sig left intentionally blank*
- Explicit, implicit rule chain doesn't work in created dirs,
barkalow <=