Subject: make(1) problems
To: None <current-users@NetBSD.ORG>
From: Simon Burge <simonb@telstra.com.au>
List: current-users
Date: 10/02/1996 14:25:47
I'm not sure that this is the right list, but I can't think of one
better...

I'm using "new" style Makefiles for a program I'm writing, and I'm
trying to link programs with a library elsewhere within my source
tree.  I'm using obj dirs (so I can compile on more than one platform
with the same source tree), and the problem is trying to find the
compiled library.  Something like this (in a Makefile.inc) seems to be
the only way I've found so far:

	LIBFOO!=cd $(.CURDIR)/../libfoo; \
		printf "xxx:\n\techo \$${.OBJDIR}/libfoo.a\n" | \
		${MAKE} -r -s -f - xxx | grep libfoo

but is a little ugly.  It also seems that all of the programs have to
be at the same "level" in the source tree.  For example:

	.../libfoo
	.../proga
	.../tools/progb
	.../tools/progc

Here, progb & progc would have to include a different Makefile.inc,
because the "cd $(.CURDIR)/" stuff would have to go to ../../libfoo,
not ../libfoo.  I could just put another Makefile.inc in the tools
directory, but that's duplicating stuff unnecessarily...

What I'm looking for is some sort of top-level Makefile.inc that
defines LIBFOO properly without all the restrictions and farting
about.  Am I beating my head against a brick wall here?

Simon.
--
Simon Burge						simonb@telstra.com.au
UNIX Support, CPR Project.				+61 3 9634 3974 (Phone)
Telstra Corporation, Melbourne, Australia.		+61 3 9670 1189 (Fax)