Subject: Organizing stuff by architecture
To: None <netbsd-ports@sun-lamp.cs.berkeley.edu>
From: Paul Mackerras <Paul.Mackerras@cs.anu.edu.au>
List: netbsd-ports
Date: 11/24/1993 08:12:07
There are now at least four 68k-based machines that NetBSD has been
ported to, including my "da30" machine (hp300, amiga, sun3 are the
others).  At present, machine-dependent stuff is organized in various
places such as src/lib/csu, src/gnu/usr.bin/gcc2/arch, etc., in
directories labelled ${MACHINE}.

Now, as mycroft and deraadt have pointed out, it doesn't make sense
to have essentially identical code in four different directories for
four different 68k-based ports.  We could have hp300, amiga, etc. be
symbolic links to m68k, but cvs apparently doesn't support symbolic
links.

My suggestion is that we create a file /usr/share/mk/arch.mk,
which would contain something like the following:

.if ${MACHINE} == "hp300" || ${MACHINE} == "amiga" || ${MACHINE} == "sun3" \
	|| ${MACHINE} == "da30"
ARCH=	m68k

.else
ARCH=	${MACHINE}
.endif

Makefiles could .include <arch.mk> and then use ${ARCH} rather than
${MACHINE}, for example:

.PATH:	${.CURDIR}/arch/${ARCH}

or

.include "config/Makefile.${ARCH}"

or

.include "${.CURDIR}/arch/${ARCH}/Makefile.inc"

Comments?

------------------------------------------------------------------------------