Subject: Re: Problem with make DESTDIR=...
To: None <current-users@NetBSD.ORG>
From: Michael Richardson <>
List: current-users
Date: 01/08/1997 18:27:04

  I needed a self-contained development environment for BSDi and SunOS
for the firewalls that I used to work on when I was at Milkyway
  We used BSD make (I look at GNU make, but decided it was overkill).
  My criteria was:
	- no use of environment variables: I tend to work on multiple
	versions in multiple windows, and always edit with
	emacs. Being able to compile anything under Emacs with M-x
	compile is important. While I think *I* can cope with
	different keys for different versions, some of the junior 
	people could not.
	- be able to build at any point in the tree. I don't know
	special for building lower in the tree. I have since seen
	SSLeay is neat in that a make in the tree goes to the top,
	sets the variables and descends. 
	- be able to avoid lots of #ifdef through use of -I${INCLUDEDIR}/${OS}/${MACHINE} type things.

  All of this is easy with some template's, some use of .include "../"
and the like. 
  The problem was we wanted to keep the templates within the source
tree in order to keep them under revision control. So, we couldn't
leave the including up the tree to get things from the top to find the
make templates in the make templates!
  We wound up putting a standard file called in the
/usr/share/mk equivalent. did the right .include, and set a
series of variables pointing at the make templates. A Makefile looked


	.include <>
	.include "${MILKYWAYPROGMK}"
  A top level "configure" program did a "pwd" and stuck the result
into a top level "". Each "" included
"../" except for the top one. 
  ${TOPDIR}/ had something like:
	INCLUDEDIR=${TOPDIR}/include might do:

  I modified make to chdir to obj.${MACHINE}. I think NetBSD's make
does this as well. I also enforced use of objdir, which took some
tricks to get rid of /a or /tmp_mnt, etc.. since we use the automounter.
  [in retrospect, it should have been obj.${OS}.${MACHINE} because we
wound up dealing with UnixWare/i386 vs BSDi/i386 and Sparc/SunOS vs
Sparc/Solaris). Also, the makefiles were really OS specific not really
machine specific, but that was two and half years ago...]

   :!mcr!:            |  Network security consulting and 
   Michael Richardson |      contract programming
 WWW: PGP key available.

Version: 2.6.3ia
Charset: latin1
Comment: Processed by Mailcrypt 3.4, an Emacs/PGP interface