Found: a version of 'make' that uses a MAKEPATH

ggr at pyuxbb.UUCP ggr at pyuxbb.UUCP
Thu Sep 29 01:36:39 AEST 1983


Well, it uses the environment variable VPATH, and you won't guess where
I found it.  In my own /usr/src/cmd/make directory.  It seems that
if you have a USG UNIX (aka System III or System V) you already
have this undocumented (of course) feature.  Thanks to Guy Harris
(that other Guy) who had remembered it from a bout of code-reading
he once did.

Thanks also to many who replied having make front-ends that fiddle
with linking files, read '.from' files to get paths, or take
'.PREFIXES' lines in the Makefile itself.

This feature is *not* in the Version 7 make, nor in various BSD
makes I've seen (at least not as VPATH).

Now to make it useful:  it seems to be adequate (if you carefully
craft your Makefiles) *if* the search directories other than the
current are kept up to date (object files not deleted).
Otherwise, you get results like:

	$ VPATH=:/usr/src/cmd/diff make -f /usr/src/cmd/diff/diff.mk
		cc -O -s -i -o diff diff.c
	0: No source file diff.c
	*** Error code 1

	Stop.

Now you can get around this by making a 'cc' command that uses VPATH
also, does stat's on its arguments that look like input file names, and
replaces them with full pathnames before invoking the real /bin/cc.
(You have to do this with commands other than cc as well.)
Or maybe I can work this into make itself.
Or maybe I'll take another look at the other solutions.

			=== Guy Riddle == AT&T Bell Laboratories, Piscataway ===



More information about the Comp.unix.wizards mailing list