Subject: Make .PATH strangeness
To: None <netbsd-help@NetBSD.ORG>
From: Ty Sarna <tsarna@endicor.com>
List: netbsd-help
Date: 12/02/1997 16:40:13
Imagine the following situation:

/path/prog1	sources for a program
/path/prog2	current dir, sources for a second program

Makefile in prog2 has:

.PATH: /path/prog1

and also creates a local copy of /path/prog1/src.c, by copying it to
${OBJDIR} and patching it. Make happily follows the rules to create the
local copy before trying to compile src.c, and then inists on compiling
/path/prog1/src.c instead of ${.OBJDIR}/src.c. Even if I use:

.PATH: ${.OBJDIR} /path/prog1

It wants to compile the /path/prog1 version!

Is this a bug? It seems like it builds up the dependancy too early
(there insn't one in ${.CURDIR}, then scan the path: none in ${.OBJDIR},
aha, one in /path/prog1.) Then it goes to make src.o, runs the
dependancy to create the local version in ${.OBJDIR}, and goes to
compile src.c, but doesn't bother to look again to see that there is now
a src.c earlier in the path.

Is this behaviour correct, or should I send-pr?

Is there any workaround, short of using a different filename in
/path/prog2 (my current solution)?