Subject: Re: Bad domestic test in src/Makefile?
To: Curt Sampson <>
From: Scott Reynolds <>
List: tech-toolchain
Date: 03/30/1999 09:35:00
On Tue, 30 Mar 1999, Curt Sampson wrote:

> The following code was recently changed in src/Makefile:
>  .if exists(domestic) && \
>      (make(clean) || make(cleandir) || make(obj) || \
>      ((make(includes) || make(install)) && \
> -    !(defined(EXPORTABLE_SYSTEM) || defined(_BUILD))))
> +    !defined(EXPORTABLE_SYSTEM) && defined(_DISTRIB)))
>  SUBDIR+= domestic
>  .endif
> This test appears to be wrong to me; it seems to me that, regardless
> of the setting of EXPORTABLE_SYSTEM now, if _DISTRIB is not set
> domestic is never included in SUBDIR. This basically makes it
> impossible to build a domestic tree with `make build.'

Um, Curt, I direct your attention to this part of the `build' target:

	.if exists(domestic) && !defined(EXPORTABLE_SYSTEM)
		(cd ${.CURDIR}/domestic && ${MAKE} ${_J} _SLAVE_BUILD= build)

> [...]
> Does anybody know what the purpose of step 2 is (i.e., what end it
> is trying to achieve)? If not, I'll attempt to `fix' it....

There is nothing broken here.  Do not `attempt' to `fix' it.

> If someone does know how all this is supposed to work, could he
> document it in the makefiles? And also document the purpose of the
> _DISTRIB and _BUILD variables?

grep _BUILD src/Makefile
grep _DISTRIB src/Makefile src/etc/Makefile

There's more complicated things going on here than these two (internal)
variables.  Don't mess with this unless you understand it.