We've encountered an interesting dependency problem. Not sure if this is a bug or feature. What we're trying to do is have a makefile include a sub makefile, with the sub-makefile automatically created based on multiple implicit rules. Which implicit rule "make" uses is based on the files that exist.
Below is such an example: $ /bin/rm -rf test $ mkdir -p test/dir1 $ touch test/dir1/file1 $ make Makefile:13: test/file3: No such file or directory make: *** No rule to make target `test/dir2/file2', needed by `foo'. Stop. It sounds like "make" gets confused when a file is being used for both an implicit rule, include file, and target dependency. It should recognize the first implicit rule doesn't match, and reference the second implicit rule. However, if we change the BAR definition to hold the absolute path, we do get the correct behavior. Thanks, Albert Ting ---------------------------------------------------------------------- all: @echo "DONE!" SUBDIR:=test BAR =$(SUBDIR:%=%/dir2/file2) #BAR =$(SUBDIR:%=$(PWD)/%/dir2/file2) foo: $(BAR) include test/file3 %/file3 : %/dir2/file2 %/dir1/file1 @echo "two file dependency" %/file3 : %/dir1/file1 @echo "one file dependency" _______________________________________________ Bug-make mailing list [EMAIL PROTECTED] http://mail.gnu.org/mailman/listinfo/bug-make