Subject: Re: proper way for one source tree - multi arch compiles?
To: Thorsten Frueauf <s_frueau@ira.uka.de>
From: Jason Thorpe <thorpej@nas.nasa.gov>
List: current-users
Date: 01/05/1996 15:47:24
On Fri, 5 Jan 1996 13:53:34 +0100 (MET) 
 s_frueau@ira.uka.de (Thorsten Frueauf) wrote:

 > I want to find a proper way for holding only one current source tree
 > on my Amiga NetBSD current machine with being able to build the
 > tree on the Amiga and (via nfs export) on my HP 9000/400 (Apollo).
 > I know it is possible, but I don't know how to set it up in an
 > ellegant way. 

You want to use "obj.${MACHINE}" direcories in the source tree...Here's a 
snippet from my .cshrc file:

if ( $OS == 'NetBSD' ) then
	setenv OBJMACHINE	TRUE
	setenv USR_OBJMACHINE	TRUE
	setenv BSDSRCDIR	`cd /usr/src; pwd`
endif

If that s set in your environment, a "make obj" will set up something 
like the following (ls output fixed for 80 colums):

basalt (thorpej) /usr/src/bin/cat 114% ls -l
total 12
 1 drwxr-xr-x  2 thorpej  netbsd   512 Dec 20 08:30 CVS/
 1 -rw-r--r--  1 thorpej  netbsd   129 Dec 19 09:01 Makefile
 4 -rw-r--r--  1 thorpej  netbsd  3748 Dec 19 09:01 cat.1
 6 -rw-r--r--  1 thorpej  netbsd  6013 Dec 19 09:01 cat.c
 0 lrwxr-xr-x  1 thorpej  netbsd    22 Dec 30 17:25 obj.amiga@ ->
						/usr/obj.amiga/bin/cat
 0 lrwxr-xr-x  1 thorpej  netbsd    22 Dec 30 17:25 obj.hp300@ -> 
						/usr/obj.hp300/bin/cat
 0 lrwxr-xr-x  1 thorpej  netbsd    22 Dec 30 17:25 obj.mvme68k@ ->
						/usr/obj.mvme68k/bin/cat
 0 lrwxr-xr-x  1 thorpej  netbsd    22 Dec 30 17:25 obj.sparc@ -> 
						/usr/obj.sparc/bin/cat
 0 lrwxr-xr-x  1 thorpej  netbsd    22 Dec 30 17:25 obj.sun3@ ->
						/usr/obj.sun3/bin/cat

I do it that way because I keep my sparc and hp300 objects on different 
filesystems (different machines, even...)

basalt (thorpej) /usr 116% ls -l
total 20

[ . . . ]

 0 lrwxr-xr-x   1 root  wheel    26 Dec 10 01:20 obj.amiga@ -> 
						/nfs/coredump/u1/obj.amiga
 0 lrwxr-xr-x   1 root  wheel    28 Dec 10 01:20 obj.hp300@ -> 
						/nfs/basalt/netbsd/obj.hp300
 0 lrwxr-xr-x   1 root  wheel    28 Dec 10 01:20 obj.is68k@ -> 
						/nfs/basalt/netbsd/obj.is68k
 0 lrwxr-xr-x   1 root  wheel    27 Dec 10 01:20 obj.mvme68k@ ->
						/nfs/bigsby/local/obj.mvme68k
 0 lrwxr-xr-x   1 root  wheel    27 Dec 10 01:20 obj.sparc@ -> 
						/nfs/bigsby/local/obj.sparc
 0 lrwxr-xr-x   1 root  wheel    27 Dec 10 01:20 obj.sun3@ -> 
						/nfs/basalt/netbsd/obj.sun3
[ . . . ]

 0 lrwxr-xr-x   1 root  wheel    22 Dec 10 01:20 src@ -> 
						/nfs/basalt/netbsd/src

[ . . . ]

In the presence of obj* directories, the Makefiles do the Right Thing.  
Make certain that you `make cleandir' across the entire tree first, then 
`make obj' across the entire tree for each platform you wish to build 
for.

Hope this helps you.

--------------------------------------------------------------------------
Jason R. Thorpe                                       thorpej@nas.nasa.gov
NASA Ames Research Center                               Home: 408.866.1912
NAS: M/S 258-6                                          Work: 415.604.0935
Moffett Field, CA 94035                                Pager: 415.428.6939