History log of /netbsd-current/share/mk/bsd.obj.mk
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
# 1.54 03-Jun-2023 lukem

bsd.obj.mk: move MKHOSTOBJ to bsd.own.mk

Add default for MKHOSTOBJ=no to to bsd.own.mk _MKVARS.no.
Simplify bsd.obj.mk check.


Revision tags: netbsd-10-base
# 1.53 29-Mar-2022 christos

get rid of old style `` command substitution in shell and use $() instead.


Revision tags: netbsd-9-3-RELEASE cjep_sun2x-base1 cjep_sun2x-base cjep_staticlib_x-base1 netbsd-9-2-RELEASE cjep_staticlib_x-base netbsd-9-1-RELEASE phil-wifi-20200421 phil-wifi-20200411 is-mlppp-base phil-wifi-20200406 netbsd-9-0-RELEASE netbsd-9-0-RC2 netbsd-9-0-RC1 phil-wifi-20191119 netbsd-9-base phil-wifi-20190609 pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226 pgoyette-compat-1126 pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906 pgoyette-compat-0728 phil-wifi-base pgoyette-compat-0625 pgoyette-compat-0521
# 1.52 19-May-2018 christos

Prevent 'make obj' creating an objdir inside an objdir. This happens the
second time we call 'make obj' in /usr/src/rescue with MAKEOBJDIR set.
XXX: pullup-8


Revision tags: pgoyette-compat-0502 pgoyette-compat-0422 netbsd-8-0-RC1 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 pgoyette-compat-base matt-nb8-mediatek-base perseant-stdc-iso10646-base netbsd-8-base prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1 pgoyette-localcount-20170320 bouyer-socketcan-base pgoyette-localcount-20170107
# 1.51 10-Dec-2016 christos

branches: 1.51.6; 1.51.12;
Back in 1993 ${MACHINE} was a unique way to define objdirs for
every platform. Thus setting OBJMACHINE, allowed one to keep
in-tree objdirs with multiple builds. With the advent of evb*, this
has become impossible until now. Introduce OBJMACHINE_ARCH that
adds ${MACHINE_ARCH} to the objdir so that we have unique objdirs
per build again. Until we restructure things to that this is not
necessary, it is the simplest fix.


# 1.50 08-Dec-2016 christos

factor out expression.


Revision tags: netbsd-7-2-RELEASE netbsd-7-1-2-RELEASE netbsd-7-1-1-RELEASE netbsd-7-1-RELEASE netbsd-7-1-RC2 netbsd-7-nhusb-base-20170116 netbsd-7-1-RC1 pgoyette-localcount-20161104 netbsd-7-0-2-RELEASE localcount-20160914 netbsd-7-nhusb-base pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base netbsd-7-0-1-RELEASE netbsd-7-0-RELEASE netbsd-7-0-RC3 netbsd-7-0-RC2 netbsd-7-0-RC1 netbsd-6-0-6-RELEASE netbsd-6-1-5-RELEASE netbsd-7-base yamt-pagecache-base9 yamt-pagecache-tag8 netbsd-6-1-4-RELEASE netbsd-6-0-5-RELEASE tls-earlyentropy-base riastradh-xf86-video-intel-2-7-1-pre-2-21-15 riastradh-drm2-base3 netbsd-6-1-3-RELEASE netbsd-6-0-4-RELEASE netbsd-6-1-2-RELEASE netbsd-6-0-3-RELEASE netbsd-6-1-1-RELEASE riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base netbsd-6-0-2-RELEASE netbsd-6-1-RELEASE netbsd-6-1-RC4 netbsd-6-1-RC3 agc-symver-base netbsd-6-1-RC2 netbsd-6-1-RC1 yamt-pagecache-base8 netbsd-6-0-1-RELEASE yamt-pagecache-base7 matt-nb6-plus-nbase yamt-pagecache-base6 netbsd-6-0-RELEASE netbsd-6-0-RC2 tls-maxphys-base matt-nb6-plus-base netbsd-6-0-RC1 yamt-pagecache-base5 yamt-pagecache-base4 netbsd-6-base yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base cherry-xenmp-base bouyer-quota2-nbase bouyer-quota2-base matt-mips64-premerge-20101231
# 1.49 25-Jan-2010 christos

branches: 1.49.28;
PR/42658: Geoff Wing: Quote directory variables to deal with spaces in the
source pathname.


Revision tags: netbsd-5-2-3-RELEASE netbsd-5-1-5-RELEASE netbsd-5-2-2-RELEASE netbsd-5-1-4-RELEASE netbsd-5-2-1-RELEASE netbsd-5-1-3-RELEASE netbsd-5-2-RELEASE netbsd-5-2-RC1 netbsd-5-1-2-RELEASE netbsd-5-1-1-RELEASE matt-nb5-mips64-premerge-20101231 matt-nb5-pq3-base netbsd-5-1-RELEASE netbsd-5-1-RC4 matt-nb5-mips64-k15 netbsd-5-1-RC3 netbsd-5-1-RC2 netbsd-5-1-RC1 netbsd-5-0-2-RELEASE matt-nb5-mips64-premerge-20091211 matt-premerge-20091211 matt-nb5-mips64-u2-k2-k4-k7-k8-k9 matt-nb4-mips64-k7-u2a-k9b matt-nb5-mips64-u1-k1-k5 netbsd-5-0-1-RELEASE jym-xensuspend-nbase netbsd-5-0-RELEASE netbsd-5-0-RC4 netbsd-5-0-RC3 netbsd-5-0-RC2 jym-xensuspend-base netbsd-5-0-RC1 netbsd-5-base matt-mips64-base2 wrstuden-revivesa-base-3 wrstuden-revivesa-base-2 wrstuden-revivesa-base-1 yamt-pf42-base4 yamt-pf42-base3 hpcarm-cleanup-nbase yamt-pf42-baseX yamt-pf42-base2 wrstuden-revivesa-base yamt-pf42-base mjf-devfs2-base keiichi-mipv6-nbase keiichi-mipv6-base pc532-eol-2008 matt-armv6-nbase cube-autoconf-base matt-armv6-base hpcarm-cleanup-base
# 1.48 11-Dec-2007 lukem

It's "its" for possessive, not "it's".


Revision tags: netbsd-4-0-1-RELEASE wrstuden-fixsa-newbase matt-armv6-prevmlocking wrstuden-fixsa-base-1 netbsd-4-0-RELEASE netbsd-4-0-RC5 netbsd-4-0-RC4 netbsd-4-0-RC3 netbsd-4-0-RC2 netbsd-4-0-RC1 matt-mips64-base wrstuden-fixsa-base netbsd-4-base
# 1.47 26-Nov-2006 dsl

branches: 1.47.8;
Comment where make's internal copy of .OBJDIR gets changed


Revision tags: netbsd-3-1-1-RELEASE netbsd-3-0-3-RELEASE abandoned-netbsd-4-base netbsd-3-1-RELEASE netbsd-3-0-2-RELEASE netbsd-3-1-RC4 netbsd-3-1-RC3 netbsd-3-1-RC2 netbsd-3-1-RC1 netbsd-3-0-1-RELEASE netbsd-3-0-RELEASE netbsd-3-0-RC6 netbsd-3-0-RC5 netbsd-3-0-RC4 netbsd-3-0-RC3 netbsd-3-0-RC2 netbsd-3-0-RC1 netbsd-2-0-3-RELEASE netbsd-2-1-RELEASE netbsd-2-1-RC6 netbsd-2-1-RC5 netbsd-2-1-RC4 netbsd-2-1-RC3 netbsd-2-1-RC2 netbsd-2-1-RC1 netbsd-2-0-2-RELEASE netbsd-3-base netbsd-2-0-1-RELEASE netbsd-2-base netbsd-2-0-RELEASE netbsd-2-0-RC5 netbsd-2-0-RC4 netbsd-2-0-RC3 netbsd-2-0-RC2 netbsd-2-0-RC1 netbsd-2-0-base
# 1.46 04-Dec-2003 lukem

Ensure that ${TOOL_STAT} is executable before trying to run it;
it may not be available when performing "make obj" in tools/
when using BSDSRCDIR & BSDOBJDIR (instead of MAKEOBJDIR{,PREFIX}).


# 1.45 06-Nov-2003 lukem

support MAKEVERBOSE for objdir creation messages


# 1.44 28-Jul-2003 lukem

Be consistent how "multiple include protection" is implemented. I.e,

.if !defined(_BSD_foo_MK_)
_BSD_foo_MK_=1

# ...

.endif # !defined(_BSD_foo_MK_)


# 1.43 28-Jul-2003 lukem

Pull in <bsd.sys.mk> as well, for the TOOL_ variables in the
USETOOLS=never case.
Found & fixed by Anders Hjalmarsson in PR misc/22283.


# 1.42 20-Jul-2003 lukem

Use ltarg=`stat -qf '%Y' $l` to read a symlink's target (and rely upon
a non-zero exit value to indicate a missing file or non-symlink),
instead of test -h $l && ltarg=`ls -ld $l | awk '{print $NF}'`
since the former is quicker and more concise.


# 1.41 18-Jul-2003 lukem

whitespace cleanup


Revision tags: netbsd-1-6-PATCH002-RELEASE netbsd-1-6-PATCH002 netbsd-1-6-PATCH002-RC4 netbsd-1-6-PATCH002-RC3 netbsd-1-6-PATCH002-RC2 netbsd-1-6-PATCH002-RC1 netbsd-1-6-PATCH001 netbsd-1-6-PATCH001-RELEASE netbsd-1-6-PATCH001-RC3 netbsd-1-6-PATCH001-RC2 netbsd-1-6-PATCH001-RC1 fvdl_fs64_base netbsd-1-6-RELEASE netbsd-1-6-RC3 netbsd-1-6-RC2 netbsd-1-6-RC1 netbsd-1-6-base
# 1.40 14-Mar-2002 thorpej

Add a BUILDID variable, which further qualifies object directories.


# 1.39 29-Nov-2001 wiz

Remove spurious '.' in line 42, as reported by Naoto Shimazaki on
current-users on Thu, 29 Nov 2001 09:17:16.


# 1.38 28-Nov-2001 tv

Use :U successfully this time. In an expression such as ${FOO:D:Ubar}, you
end up with empty string if FOO is defined, and `bar' if it is undefined.


# 1.37 27-Nov-2001 jmc

If using MAKEOBJDIRPREFIX use the same checks as the symlink logic does below.

i.e. if the root of the object tree doesn't exist then complain and exit.

This makes both sections consistant to each other (MAKEOBJDIR specifies an
exact directory so there's no root per se to check so nothing can really be
done there).


# 1.36 20-Nov-2001 tv

:U can't be used to test for existence, as the variable may contain an
arbitrary value; change back to .if !defined(). Problem noted by
bernd@arresum.inka.de in PR toolchain/14629.


# 1.35 14-Nov-2001 tv

Turn off host-specific objdirs by default. Set MKHOSTOBJ=yes to enable.


# 1.34 12-Nov-2001 tv

Use ${__curdir} consistently.


# 1.33 11-Nov-2001 tv

Also handle the USR_OBJMACHINE case for OBJHOSTMACHINE.


# 1.32 11-Nov-2001 tv

Affix the ${HOST_OSTYPE} info to the end of the objdir name if OBJMACHINE
is set (and MAKEOBJDIR[PREFIX] is not in use). This permits multiple hosts
to compile hostprogs (not just src/tools) for a given target without
colliding with each other.

Currently restricted only to new toolchain builds, as this requires a new
make(1) in order to function properly.


# 1.31 11-Nov-2001 tv

Fix variable concatenation in previous.


# 1.30 11-Nov-2001 tv

Make the BSDSRCDIR/BSDOBJDIR symlink based objdir system work for the top
source directory. This will use BSDOBJDIR of OBJMACHINE is unset, and will
create a directory '.MACHINE' inside BSDOBJDIR if OBJMACHINE is set.

MAKEOBJDIR and MAKEOBJDIRPREFIX based objdirs already cope with the top
level directory just fine.


# 1.29 31-Oct-2001 tv

Use __curdir throughout, so MAKEOBJDIR builds see resolved paths in the
"foo -> bar" messages written to stdout.


# 1.28 14-Aug-2001 tv

Protect against multiple inclusion, and evaluate ${.CURDIR} early (to assist
the top-level toolchain bootstrap).


# 1.27 10-Jun-2001 mrg

fail `make obj' if $BSDOBJDIR doesn't exist. fixes PR#12937.


# 1.26 11-Mar-2001 cgd

"test !", rather than "! test". The former is more portable.


# 1.25 07-Jul-2000 cgd

test -h, not test -L.


Revision tags: netbsd-1-5-PATCH003 netbsd-1-5-PATCH002 netbsd-1-5-PATCH001 netbsd-1-5-RELEASE netbsd-1-5-BETA2 netbsd-1-5-BETA netbsd-1-5-ALPHA2 netbsd-1-5-base minoura-xpg4dl-base
# 1.24 18-Feb-2000 itohy

s/MAKOBJDIR/MAKEOBJDIR/
Pointed out by Katsuomi Hamajima.


# 1.23 08-Feb-2000 sjg

Fixed handling of MAKEOBJDIR so that it matches make(1)'s expectations.
Added handling of MAKEOBJDIRPREFIX.
In both cases we simply need to mkdir the appropriate path if it does not
exists.


Revision tags: wrstuden-devbsize-19991221 wrstuden-devbsize-base
# 1.22 04-Dec-1999 sommerfeld

When building obj symlinks, if there's already a link pointing at the right target,
do nothing rather than deleting and recreating an identical link.


Revision tags: comdex-fall-1999-base
# 1.21 21-Aug-1999 sommerfeld

branches: 1.21.4;
Use (if defined) instead of obj.foo or obj
when building object directories


# 1.20 10-Jun-1999 kim

Oops, PWD is really something else in most environments.
Call this variable PAWD instead.


# 1.19 10-Jun-1999 tls

Fix a typo which caused "make obj" to try to *execute* the direcroty it was in.


# 1.18 08-Jun-1999 kim

Allow "make obj" to work nicely with amd by setting
PWD=/usr/bin/pawd in /etc/mk.conf and using the amd
mount point path for BSDSRCDIR.


Revision tags: netbsd-1-4-PATCH001 netbsd-1-4-RELEASE netbsd-1-4-base
# 1.17 12-Feb-1999 lukem

branches: 1.17.2;
pull in bsd.own.mk for MKOBJ


# 1.16 12-Feb-1999 lukem

* Add support for MKDOC MKLINKLIB MKLINT MKMAN MKNLS MKOBJ MKPIC MKPICINSTALL
MKPROFILE MKSHARE, which default to `yes' unless an equivalent NOxxx
variable is defined.
* Add MKCATPAGES, which if "no" prevents catpages from being built or installed

Users should use "MKxxx=no" instead of "NOxxx=" in /etc/mk.conf, because
this allows easy override on the make(1) command line (e.g 'make MKSHARE=yes'
to override MKSHARE=no in /etc/mk.conf).


# 1.15 27-Aug-1998 tv

Rename show-objdir to print-objdir to be consistent with existing
convention.


# 1.14 27-Aug-1998 tv

Add pseudo-target "show-objdir", which will print the value of ${.OBJDIR}
and nothing else. Intended target: cleaning up the ugly "echo | make"
constructs to find files from another directory's objdir.


Revision tags: netbsd-1-3-PATCH002 netbsd-1-3-PATCH001 netbsd-1-3-RELEASE netbsd-1-3-BETA netbsd-1-3-base
# 1.13 09-May-1997 mycroft

branches: 1.13.2;
Automatically add the .c files corresponding to .l and .y files to DPSRCS.
Automatically add DPSRCS to CLEANFILES.


# 1.12 07-May-1997 mycroft

Don't use _SUBDIRUSE outside of bsd.subdir.mk.


# 1.11 06-May-1997 mycroft

Add a pile of missing .PHONYs.


# 1.10 15-Apr-1997 christos

Make the `obj' target `.PHONY', so that does not get affected by .PATH/VPATH
This is not hurting things right now, and it will help things when path
searching for target nodes is enabled for make.


Revision tags: netbsd-1-2-PATCH001 netbsd-1-2-RELEASE netbsd-1-2-BETA netbsd-1-2-base
# 1.9 10-Apr-1996 thorpej

Get the current working directory from "/bin/pwd" rather than "pwd".
Changes to the shell make the behavior of "make obj" inconsistent
with previous behavior, depending on the login shell used by the user.
See PR #2200 for details. PR remains open while further analysis is
done. This at least restores the previous semantics for us csh(1) users.


# 1.8 21-Feb-1996 pk

Use shell internal substring matching, like bsd.man.mk.


Revision tags: netbsd-1-1-PATCH001 netbsd-1-1-RELEASE netbsd-1-1-base
# 1.7 10-Jun-1995 mycroft

Explicitly remove obj link before creating it.


Revision tags: netbsd-1-0-PATCH06 netbsd-1-0-PATCH05 netbsd-1-0-PATCH04 netbsd-1-0-PATCH03 netbsd-1-0-PATCH02 netbsd-1-0-PATCH1 netbsd-1-0-PATCH0 netbsd-1-0-RELEASE netbsd-1-0-base
# 1.6 30-Jun-1994 cgd

RCSID frobbing, and minor sanity adjustments.


# 1.5 30-Jun-1994 cgd

don't be careless with _SUBDIRUSE


# 1.4 07-Nov-1993 cgd

define BSDOBJDIR and BSDSRCDIR to have make think of the src and obj
trees as rooted someplace other than /usr/src and /usr/obj.


# 1.3 23-Oct-1993 cgd

add support to make obj.${MACHINE} dirs, if the user so requests.
note that not all makefiles in the tree will work with them, yet.


# 1.2 21-Oct-1993 cgd

'obj' was missing in echo which informed of symlink creation


# 1.1 15-Aug-1993 mycroft

Create target directories with `install -d', and move `obj' targets into one
file.


# 1.53 29-Mar-2022 christos

get rid of old style `` command substitution in shell and use $() instead.


Revision tags: cjep_sun2x-base1 cjep_sun2x-base cjep_staticlib_x-base1 netbsd-9-2-RELEASE cjep_staticlib_x-base netbsd-9-1-RELEASE phil-wifi-20200421 phil-wifi-20200411 is-mlppp-base phil-wifi-20200406 netbsd-9-0-RELEASE netbsd-9-0-RC2 netbsd-9-0-RC1 phil-wifi-20191119 netbsd-9-base phil-wifi-20190609 pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226 pgoyette-compat-1126 pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906 pgoyette-compat-0728 phil-wifi-base pgoyette-compat-0625 pgoyette-compat-0521
# 1.52 19-May-2018 christos

Prevent 'make obj' creating an objdir inside an objdir. This happens the
second time we call 'make obj' in /usr/src/rescue with MAKEOBJDIR set.
XXX: pullup-8


Revision tags: pgoyette-compat-0502 pgoyette-compat-0422 netbsd-8-0-RC1 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 pgoyette-compat-base matt-nb8-mediatek-base perseant-stdc-iso10646-base netbsd-8-base prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1 pgoyette-localcount-20170320 bouyer-socketcan-base pgoyette-localcount-20170107
# 1.51 10-Dec-2016 christos

branches: 1.51.6; 1.51.12;
Back in 1993 ${MACHINE} was a unique way to define objdirs for
every platform. Thus setting OBJMACHINE, allowed one to keep
in-tree objdirs with multiple builds. With the advent of evb*, this
has become impossible until now. Introduce OBJMACHINE_ARCH that
adds ${MACHINE_ARCH} to the objdir so that we have unique objdirs
per build again. Until we restructure things to that this is not
necessary, it is the simplest fix.


# 1.50 08-Dec-2016 christos

factor out expression.


Revision tags: netbsd-7-2-RELEASE netbsd-7-1-2-RELEASE netbsd-7-1-1-RELEASE netbsd-7-1-RELEASE netbsd-7-1-RC2 netbsd-7-nhusb-base-20170116 netbsd-7-1-RC1 pgoyette-localcount-20161104 netbsd-7-0-2-RELEASE localcount-20160914 netbsd-7-nhusb-base pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base netbsd-7-0-1-RELEASE netbsd-7-0-RELEASE netbsd-7-0-RC3 netbsd-7-0-RC2 netbsd-7-0-RC1 netbsd-6-0-6-RELEASE netbsd-6-1-5-RELEASE netbsd-7-base yamt-pagecache-base9 yamt-pagecache-tag8 netbsd-6-1-4-RELEASE netbsd-6-0-5-RELEASE tls-earlyentropy-base riastradh-xf86-video-intel-2-7-1-pre-2-21-15 riastradh-drm2-base3 netbsd-6-1-3-RELEASE netbsd-6-0-4-RELEASE netbsd-6-1-2-RELEASE netbsd-6-0-3-RELEASE netbsd-6-1-1-RELEASE riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base netbsd-6-0-2-RELEASE netbsd-6-1-RELEASE netbsd-6-1-RC4 netbsd-6-1-RC3 agc-symver-base netbsd-6-1-RC2 netbsd-6-1-RC1 yamt-pagecache-base8 netbsd-6-0-1-RELEASE yamt-pagecache-base7 matt-nb6-plus-nbase yamt-pagecache-base6 netbsd-6-0-RELEASE netbsd-6-0-RC2 tls-maxphys-base matt-nb6-plus-base netbsd-6-0-RC1 yamt-pagecache-base5 yamt-pagecache-base4 netbsd-6-base yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base cherry-xenmp-base bouyer-quota2-nbase bouyer-quota2-base matt-mips64-premerge-20101231
# 1.49 25-Jan-2010 christos

branches: 1.49.28;
PR/42658: Geoff Wing: Quote directory variables to deal with spaces in the
source pathname.


Revision tags: netbsd-5-2-3-RELEASE netbsd-5-1-5-RELEASE netbsd-5-2-2-RELEASE netbsd-5-1-4-RELEASE netbsd-5-2-1-RELEASE netbsd-5-1-3-RELEASE netbsd-5-2-RELEASE netbsd-5-2-RC1 netbsd-5-1-2-RELEASE netbsd-5-1-1-RELEASE matt-nb5-mips64-premerge-20101231 matt-nb5-pq3-base netbsd-5-1-RELEASE netbsd-5-1-RC4 matt-nb5-mips64-k15 netbsd-5-1-RC3 netbsd-5-1-RC2 netbsd-5-1-RC1 netbsd-5-0-2-RELEASE matt-nb5-mips64-premerge-20091211 matt-premerge-20091211 matt-nb5-mips64-u2-k2-k4-k7-k8-k9 matt-nb4-mips64-k7-u2a-k9b matt-nb5-mips64-u1-k1-k5 netbsd-5-0-1-RELEASE jym-xensuspend-nbase netbsd-5-0-RELEASE netbsd-5-0-RC4 netbsd-5-0-RC3 netbsd-5-0-RC2 jym-xensuspend-base netbsd-5-0-RC1 netbsd-5-base matt-mips64-base2 wrstuden-revivesa-base-3 wrstuden-revivesa-base-2 wrstuden-revivesa-base-1 yamt-pf42-base4 yamt-pf42-base3 hpcarm-cleanup-nbase yamt-pf42-baseX yamt-pf42-base2 wrstuden-revivesa-base yamt-pf42-base mjf-devfs2-base keiichi-mipv6-nbase keiichi-mipv6-base pc532-eol-2008 matt-armv6-nbase cube-autoconf-base matt-armv6-base hpcarm-cleanup-base
# 1.48 11-Dec-2007 lukem

It's "its" for possessive, not "it's".


Revision tags: netbsd-4-0-1-RELEASE wrstuden-fixsa-newbase matt-armv6-prevmlocking wrstuden-fixsa-base-1 netbsd-4-0-RELEASE netbsd-4-0-RC5 netbsd-4-0-RC4 netbsd-4-0-RC3 netbsd-4-0-RC2 netbsd-4-0-RC1 matt-mips64-base wrstuden-fixsa-base netbsd-4-base
# 1.47 26-Nov-2006 dsl

branches: 1.47.8;
Comment where make's internal copy of .OBJDIR gets changed


Revision tags: netbsd-3-1-1-RELEASE netbsd-3-0-3-RELEASE abandoned-netbsd-4-base netbsd-3-1-RELEASE netbsd-3-0-2-RELEASE netbsd-3-1-RC4 netbsd-3-1-RC3 netbsd-3-1-RC2 netbsd-3-1-RC1 netbsd-3-0-1-RELEASE netbsd-3-0-RELEASE netbsd-3-0-RC6 netbsd-3-0-RC5 netbsd-3-0-RC4 netbsd-3-0-RC3 netbsd-3-0-RC2 netbsd-3-0-RC1 netbsd-2-0-3-RELEASE netbsd-2-1-RELEASE netbsd-2-1-RC6 netbsd-2-1-RC5 netbsd-2-1-RC4 netbsd-2-1-RC3 netbsd-2-1-RC2 netbsd-2-1-RC1 netbsd-2-0-2-RELEASE netbsd-3-base netbsd-2-0-1-RELEASE netbsd-2-base netbsd-2-0-RELEASE netbsd-2-0-RC5 netbsd-2-0-RC4 netbsd-2-0-RC3 netbsd-2-0-RC2 netbsd-2-0-RC1 netbsd-2-0-base
# 1.46 04-Dec-2003 lukem

Ensure that ${TOOL_STAT} is executable before trying to run it;
it may not be available when performing "make obj" in tools/
when using BSDSRCDIR & BSDOBJDIR (instead of MAKEOBJDIR{,PREFIX}).


# 1.45 06-Nov-2003 lukem

support MAKEVERBOSE for objdir creation messages


# 1.44 28-Jul-2003 lukem

Be consistent how "multiple include protection" is implemented. I.e,

.if !defined(_BSD_foo_MK_)
_BSD_foo_MK_=1

# ...

.endif # !defined(_BSD_foo_MK_)


# 1.43 28-Jul-2003 lukem

Pull in <bsd.sys.mk> as well, for the TOOL_ variables in the
USETOOLS=never case.
Found & fixed by Anders Hjalmarsson in PR misc/22283.


# 1.42 20-Jul-2003 lukem

Use ltarg=`stat -qf '%Y' $l` to read a symlink's target (and rely upon
a non-zero exit value to indicate a missing file or non-symlink),
instead of test -h $l && ltarg=`ls -ld $l | awk '{print $NF}'`
since the former is quicker and more concise.


# 1.41 18-Jul-2003 lukem

whitespace cleanup


Revision tags: netbsd-1-6-PATCH002-RELEASE netbsd-1-6-PATCH002 netbsd-1-6-PATCH002-RC4 netbsd-1-6-PATCH002-RC3 netbsd-1-6-PATCH002-RC2 netbsd-1-6-PATCH002-RC1 netbsd-1-6-PATCH001 netbsd-1-6-PATCH001-RELEASE netbsd-1-6-PATCH001-RC3 netbsd-1-6-PATCH001-RC2 netbsd-1-6-PATCH001-RC1 fvdl_fs64_base netbsd-1-6-RELEASE netbsd-1-6-RC3 netbsd-1-6-RC2 netbsd-1-6-RC1 netbsd-1-6-base
# 1.40 14-Mar-2002 thorpej

Add a BUILDID variable, which further qualifies object directories.


# 1.39 29-Nov-2001 wiz

Remove spurious '.' in line 42, as reported by Naoto Shimazaki on
current-users on Thu, 29 Nov 2001 09:17:16.


# 1.38 28-Nov-2001 tv

Use :U successfully this time. In an expression such as ${FOO:D:Ubar}, you
end up with empty string if FOO is defined, and `bar' if it is undefined.


# 1.37 27-Nov-2001 jmc

If using MAKEOBJDIRPREFIX use the same checks as the symlink logic does below.

i.e. if the root of the object tree doesn't exist then complain and exit.

This makes both sections consistant to each other (MAKEOBJDIR specifies an
exact directory so there's no root per se to check so nothing can really be
done there).


# 1.36 20-Nov-2001 tv

:U can't be used to test for existence, as the variable may contain an
arbitrary value; change back to .if !defined(). Problem noted by
bernd@arresum.inka.de in PR toolchain/14629.


# 1.35 14-Nov-2001 tv

Turn off host-specific objdirs by default. Set MKHOSTOBJ=yes to enable.


# 1.34 12-Nov-2001 tv

Use ${__curdir} consistently.


# 1.33 11-Nov-2001 tv

Also handle the USR_OBJMACHINE case for OBJHOSTMACHINE.


# 1.32 11-Nov-2001 tv

Affix the ${HOST_OSTYPE} info to the end of the objdir name if OBJMACHINE
is set (and MAKEOBJDIR[PREFIX] is not in use). This permits multiple hosts
to compile hostprogs (not just src/tools) for a given target without
colliding with each other.

Currently restricted only to new toolchain builds, as this requires a new
make(1) in order to function properly.


# 1.31 11-Nov-2001 tv

Fix variable concatenation in previous.


# 1.30 11-Nov-2001 tv

Make the BSDSRCDIR/BSDOBJDIR symlink based objdir system work for the top
source directory. This will use BSDOBJDIR of OBJMACHINE is unset, and will
create a directory '.MACHINE' inside BSDOBJDIR if OBJMACHINE is set.

MAKEOBJDIR and MAKEOBJDIRPREFIX based objdirs already cope with the top
level directory just fine.


# 1.29 31-Oct-2001 tv

Use __curdir throughout, so MAKEOBJDIR builds see resolved paths in the
"foo -> bar" messages written to stdout.


# 1.28 14-Aug-2001 tv

Protect against multiple inclusion, and evaluate ${.CURDIR} early (to assist
the top-level toolchain bootstrap).


# 1.27 10-Jun-2001 mrg

fail `make obj' if $BSDOBJDIR doesn't exist. fixes PR#12937.


# 1.26 11-Mar-2001 cgd

"test !", rather than "! test". The former is more portable.


# 1.25 07-Jul-2000 cgd

test -h, not test -L.


Revision tags: netbsd-1-5-PATCH003 netbsd-1-5-PATCH002 netbsd-1-5-PATCH001 netbsd-1-5-RELEASE netbsd-1-5-BETA2 netbsd-1-5-BETA netbsd-1-5-ALPHA2 netbsd-1-5-base minoura-xpg4dl-base
# 1.24 18-Feb-2000 itohy

s/MAKOBJDIR/MAKEOBJDIR/
Pointed out by Katsuomi Hamajima.


# 1.23 08-Feb-2000 sjg

Fixed handling of MAKEOBJDIR so that it matches make(1)'s expectations.
Added handling of MAKEOBJDIRPREFIX.
In both cases we simply need to mkdir the appropriate path if it does not
exists.


Revision tags: wrstuden-devbsize-19991221 wrstuden-devbsize-base
# 1.22 04-Dec-1999 sommerfeld

When building obj symlinks, if there's already a link pointing at the right target,
do nothing rather than deleting and recreating an identical link.


Revision tags: comdex-fall-1999-base
# 1.21 21-Aug-1999 sommerfeld

branches: 1.21.4;
Use (if defined) instead of obj.foo or obj
when building object directories


# 1.20 10-Jun-1999 kim

Oops, PWD is really something else in most environments.
Call this variable PAWD instead.


# 1.19 10-Jun-1999 tls

Fix a typo which caused "make obj" to try to *execute* the direcroty it was in.


# 1.18 08-Jun-1999 kim

Allow "make obj" to work nicely with amd by setting
PWD=/usr/bin/pawd in /etc/mk.conf and using the amd
mount point path for BSDSRCDIR.


Revision tags: netbsd-1-4-PATCH001 netbsd-1-4-RELEASE netbsd-1-4-base
# 1.17 12-Feb-1999 lukem

branches: 1.17.2;
pull in bsd.own.mk for MKOBJ


# 1.16 12-Feb-1999 lukem

* Add support for MKDOC MKLINKLIB MKLINT MKMAN MKNLS MKOBJ MKPIC MKPICINSTALL
MKPROFILE MKSHARE, which default to `yes' unless an equivalent NOxxx
variable is defined.
* Add MKCATPAGES, which if "no" prevents catpages from being built or installed

Users should use "MKxxx=no" instead of "NOxxx=" in /etc/mk.conf, because
this allows easy override on the make(1) command line (e.g 'make MKSHARE=yes'
to override MKSHARE=no in /etc/mk.conf).


# 1.15 27-Aug-1998 tv

Rename show-objdir to print-objdir to be consistent with existing
convention.


# 1.14 27-Aug-1998 tv

Add pseudo-target "show-objdir", which will print the value of ${.OBJDIR}
and nothing else. Intended target: cleaning up the ugly "echo | make"
constructs to find files from another directory's objdir.


Revision tags: netbsd-1-3-PATCH002 netbsd-1-3-PATCH001 netbsd-1-3-RELEASE netbsd-1-3-BETA netbsd-1-3-base
# 1.13 09-May-1997 mycroft

branches: 1.13.2;
Automatically add the .c files corresponding to .l and .y files to DPSRCS.
Automatically add DPSRCS to CLEANFILES.


# 1.12 07-May-1997 mycroft

Don't use _SUBDIRUSE outside of bsd.subdir.mk.


# 1.11 06-May-1997 mycroft

Add a pile of missing .PHONYs.


# 1.10 15-Apr-1997 christos

Make the `obj' target `.PHONY', so that does not get affected by .PATH/VPATH
This is not hurting things right now, and it will help things when path
searching for target nodes is enabled for make.


Revision tags: netbsd-1-2-PATCH001 netbsd-1-2-RELEASE netbsd-1-2-BETA netbsd-1-2-base
# 1.9 10-Apr-1996 thorpej

Get the current working directory from "/bin/pwd" rather than "pwd".
Changes to the shell make the behavior of "make obj" inconsistent
with previous behavior, depending on the login shell used by the user.
See PR #2200 for details. PR remains open while further analysis is
done. This at least restores the previous semantics for us csh(1) users.


# 1.8 21-Feb-1996 pk

Use shell internal substring matching, like bsd.man.mk.


Revision tags: netbsd-1-1-PATCH001 netbsd-1-1-RELEASE netbsd-1-1-base
# 1.7 10-Jun-1995 mycroft

Explicitly remove obj link before creating it.


Revision tags: netbsd-1-0-PATCH06 netbsd-1-0-PATCH05 netbsd-1-0-PATCH04 netbsd-1-0-PATCH03 netbsd-1-0-PATCH02 netbsd-1-0-PATCH1 netbsd-1-0-PATCH0 netbsd-1-0-RELEASE netbsd-1-0-base
# 1.6 30-Jun-1994 cgd

RCSID frobbing, and minor sanity adjustments.


# 1.5 30-Jun-1994 cgd

don't be careless with _SUBDIRUSE


# 1.4 07-Nov-1993 cgd

define BSDOBJDIR and BSDSRCDIR to have make think of the src and obj
trees as rooted someplace other than /usr/src and /usr/obj.


# 1.3 23-Oct-1993 cgd

add support to make obj.${MACHINE} dirs, if the user so requests.
note that not all makefiles in the tree will work with them, yet.


# 1.2 21-Oct-1993 cgd

'obj' was missing in echo which informed of symlink creation


# 1.1 15-Aug-1993 mycroft

Create target directories with `install -d', and move `obj' targets into one
file.


Revision tags: pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226 pgoyette-compat-1126 pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906 pgoyette-compat-0728 phil-wifi-base pgoyette-compat-0625 pgoyette-compat-0521
# 1.52 19-May-2018 christos

Prevent 'make obj' creating an objdir inside an objdir. This happens the
second time we call 'make obj' in /usr/src/rescue with MAKEOBJDIR set.
XXX: pullup-8


Revision tags: pgoyette-compat-0502 pgoyette-compat-0422 netbsd-8-0-RC1 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 pgoyette-compat-base matt-nb8-mediatek-base perseant-stdc-iso10646-base netbsd-8-base prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1 pgoyette-localcount-20170320 bouyer-socketcan-base pgoyette-localcount-20170107
# 1.51 10-Dec-2016 christos

branches: 1.51.6; 1.51.12;
Back in 1993 ${MACHINE} was a unique way to define objdirs for
every platform. Thus setting OBJMACHINE, allowed one to keep
in-tree objdirs with multiple builds. With the advent of evb*, this
has become impossible until now. Introduce OBJMACHINE_ARCH that
adds ${MACHINE_ARCH} to the objdir so that we have unique objdirs
per build again. Until we restructure things to that this is not
necessary, it is the simplest fix.


# 1.50 08-Dec-2016 christos

factor out expression.


Revision tags: netbsd-7-2-RELEASE netbsd-7-1-2-RELEASE netbsd-7-1-1-RELEASE netbsd-7-1-RELEASE netbsd-7-1-RC2 netbsd-7-nhusb-base-20170116 netbsd-7-1-RC1 pgoyette-localcount-20161104 netbsd-7-0-2-RELEASE localcount-20160914 netbsd-7-nhusb-base pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base netbsd-7-0-1-RELEASE netbsd-7-0-RELEASE netbsd-7-0-RC3 netbsd-7-0-RC2 netbsd-7-0-RC1 netbsd-6-0-6-RELEASE netbsd-6-1-5-RELEASE netbsd-7-base yamt-pagecache-base9 yamt-pagecache-tag8 netbsd-6-1-4-RELEASE netbsd-6-0-5-RELEASE tls-earlyentropy-base riastradh-xf86-video-intel-2-7-1-pre-2-21-15 riastradh-drm2-base3 netbsd-6-1-3-RELEASE netbsd-6-0-4-RELEASE netbsd-6-1-2-RELEASE netbsd-6-0-3-RELEASE netbsd-6-1-1-RELEASE riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base netbsd-6-0-2-RELEASE netbsd-6-1-RELEASE netbsd-6-1-RC4 netbsd-6-1-RC3 agc-symver-base netbsd-6-1-RC2 netbsd-6-1-RC1 yamt-pagecache-base8 netbsd-6-0-1-RELEASE yamt-pagecache-base7 matt-nb6-plus-nbase yamt-pagecache-base6 netbsd-6-0-RELEASE netbsd-6-0-RC2 tls-maxphys-base matt-nb6-plus-base netbsd-6-0-RC1 yamt-pagecache-base5 yamt-pagecache-base4 netbsd-6-base yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base cherry-xenmp-base bouyer-quota2-nbase bouyer-quota2-base matt-mips64-premerge-20101231
# 1.49 25-Jan-2010 christos

branches: 1.49.28;
PR/42658: Geoff Wing: Quote directory variables to deal with spaces in the
source pathname.


Revision tags: netbsd-5-2-3-RELEASE netbsd-5-1-5-RELEASE netbsd-5-2-2-RELEASE netbsd-5-1-4-RELEASE netbsd-5-2-1-RELEASE netbsd-5-1-3-RELEASE netbsd-5-2-RELEASE netbsd-5-2-RC1 netbsd-5-1-2-RELEASE netbsd-5-1-1-RELEASE matt-nb5-mips64-premerge-20101231 matt-nb5-pq3-base netbsd-5-1-RELEASE netbsd-5-1-RC4 matt-nb5-mips64-k15 netbsd-5-1-RC3 netbsd-5-1-RC2 netbsd-5-1-RC1 netbsd-5-0-2-RELEASE matt-nb5-mips64-premerge-20091211 matt-premerge-20091211 matt-nb5-mips64-u2-k2-k4-k7-k8-k9 matt-nb4-mips64-k7-u2a-k9b matt-nb5-mips64-u1-k1-k5 netbsd-5-0-1-RELEASE jym-xensuspend-nbase netbsd-5-0-RELEASE netbsd-5-0-RC4 netbsd-5-0-RC3 netbsd-5-0-RC2 jym-xensuspend-base netbsd-5-0-RC1 netbsd-5-base matt-mips64-base2 wrstuden-revivesa-base-3 wrstuden-revivesa-base-2 wrstuden-revivesa-base-1 yamt-pf42-base4 yamt-pf42-base3 hpcarm-cleanup-nbase yamt-pf42-baseX yamt-pf42-base2 wrstuden-revivesa-base yamt-pf42-base mjf-devfs2-base keiichi-mipv6-nbase keiichi-mipv6-base pc532-eol-2008 matt-armv6-nbase cube-autoconf-base matt-armv6-base hpcarm-cleanup-base
# 1.48 11-Dec-2007 lukem

It's "its" for possessive, not "it's".


Revision tags: netbsd-4-0-1-RELEASE wrstuden-fixsa-newbase matt-armv6-prevmlocking wrstuden-fixsa-base-1 netbsd-4-0-RELEASE netbsd-4-0-RC5 netbsd-4-0-RC4 netbsd-4-0-RC3 netbsd-4-0-RC2 netbsd-4-0-RC1 matt-mips64-base wrstuden-fixsa-base netbsd-4-base
# 1.47 26-Nov-2006 dsl

branches: 1.47.8;
Comment where make's internal copy of .OBJDIR gets changed


Revision tags: netbsd-3-1-1-RELEASE netbsd-3-0-3-RELEASE abandoned-netbsd-4-base netbsd-3-1-RELEASE netbsd-3-0-2-RELEASE netbsd-3-1-RC4 netbsd-3-1-RC3 netbsd-3-1-RC2 netbsd-3-1-RC1 netbsd-3-0-1-RELEASE netbsd-3-0-RELEASE netbsd-3-0-RC6 netbsd-3-0-RC5 netbsd-3-0-RC4 netbsd-3-0-RC3 netbsd-3-0-RC2 netbsd-3-0-RC1 netbsd-2-0-3-RELEASE netbsd-2-1-RELEASE netbsd-2-1-RC6 netbsd-2-1-RC5 netbsd-2-1-RC4 netbsd-2-1-RC3 netbsd-2-1-RC2 netbsd-2-1-RC1 netbsd-2-0-2-RELEASE netbsd-3-base netbsd-2-0-1-RELEASE netbsd-2-base netbsd-2-0-RELEASE netbsd-2-0-RC5 netbsd-2-0-RC4 netbsd-2-0-RC3 netbsd-2-0-RC2 netbsd-2-0-RC1 netbsd-2-0-base
# 1.46 04-Dec-2003 lukem

Ensure that ${TOOL_STAT} is executable before trying to run it;
it may not be available when performing "make obj" in tools/
when using BSDSRCDIR & BSDOBJDIR (instead of MAKEOBJDIR{,PREFIX}).


# 1.45 06-Nov-2003 lukem

support MAKEVERBOSE for objdir creation messages


# 1.44 28-Jul-2003 lukem

Be consistent how "multiple include protection" is implemented. I.e,

.if !defined(_BSD_foo_MK_)
_BSD_foo_MK_=1

# ...

.endif # !defined(_BSD_foo_MK_)


# 1.43 28-Jul-2003 lukem

Pull in <bsd.sys.mk> as well, for the TOOL_ variables in the
USETOOLS=never case.
Found & fixed by Anders Hjalmarsson in PR misc/22283.


# 1.42 20-Jul-2003 lukem

Use ltarg=`stat -qf '%Y' $l` to read a symlink's target (and rely upon
a non-zero exit value to indicate a missing file or non-symlink),
instead of test -h $l && ltarg=`ls -ld $l | awk '{print $NF}'`
since the former is quicker and more concise.


# 1.41 18-Jul-2003 lukem

whitespace cleanup


Revision tags: netbsd-1-6-PATCH002-RELEASE netbsd-1-6-PATCH002 netbsd-1-6-PATCH002-RC4 netbsd-1-6-PATCH002-RC3 netbsd-1-6-PATCH002-RC2 netbsd-1-6-PATCH002-RC1 netbsd-1-6-PATCH001 netbsd-1-6-PATCH001-RELEASE netbsd-1-6-PATCH001-RC3 netbsd-1-6-PATCH001-RC2 netbsd-1-6-PATCH001-RC1 fvdl_fs64_base netbsd-1-6-RELEASE netbsd-1-6-RC3 netbsd-1-6-RC2 netbsd-1-6-RC1 netbsd-1-6-base
# 1.40 14-Mar-2002 thorpej

Add a BUILDID variable, which further qualifies object directories.


# 1.39 29-Nov-2001 wiz

Remove spurious '.' in line 42, as reported by Naoto Shimazaki on
current-users on Thu, 29 Nov 2001 09:17:16.


# 1.38 28-Nov-2001 tv

Use :U successfully this time. In an expression such as ${FOO:D:Ubar}, you
end up with empty string if FOO is defined, and `bar' if it is undefined.


# 1.37 27-Nov-2001 jmc

If using MAKEOBJDIRPREFIX use the same checks as the symlink logic does below.

i.e. if the root of the object tree doesn't exist then complain and exit.

This makes both sections consistant to each other (MAKEOBJDIR specifies an
exact directory so there's no root per se to check so nothing can really be
done there).


# 1.36 20-Nov-2001 tv

:U can't be used to test for existence, as the variable may contain an
arbitrary value; change back to .if !defined(). Problem noted by
bernd@arresum.inka.de in PR toolchain/14629.


# 1.35 14-Nov-2001 tv

Turn off host-specific objdirs by default. Set MKHOSTOBJ=yes to enable.


# 1.34 12-Nov-2001 tv

Use ${__curdir} consistently.


# 1.33 11-Nov-2001 tv

Also handle the USR_OBJMACHINE case for OBJHOSTMACHINE.


# 1.32 11-Nov-2001 tv

Affix the ${HOST_OSTYPE} info to the end of the objdir name if OBJMACHINE
is set (and MAKEOBJDIR[PREFIX] is not in use). This permits multiple hosts
to compile hostprogs (not just src/tools) for a given target without
colliding with each other.

Currently restricted only to new toolchain builds, as this requires a new
make(1) in order to function properly.


# 1.31 11-Nov-2001 tv

Fix variable concatenation in previous.


# 1.30 11-Nov-2001 tv

Make the BSDSRCDIR/BSDOBJDIR symlink based objdir system work for the top
source directory. This will use BSDOBJDIR of OBJMACHINE is unset, and will
create a directory '.MACHINE' inside BSDOBJDIR if OBJMACHINE is set.

MAKEOBJDIR and MAKEOBJDIRPREFIX based objdirs already cope with the top
level directory just fine.


# 1.29 31-Oct-2001 tv

Use __curdir throughout, so MAKEOBJDIR builds see resolved paths in the
"foo -> bar" messages written to stdout.


# 1.28 14-Aug-2001 tv

Protect against multiple inclusion, and evaluate ${.CURDIR} early (to assist
the top-level toolchain bootstrap).


# 1.27 10-Jun-2001 mrg

fail `make obj' if $BSDOBJDIR doesn't exist. fixes PR#12937.


# 1.26 11-Mar-2001 cgd

"test !", rather than "! test". The former is more portable.


# 1.25 07-Jul-2000 cgd

test -h, not test -L.


Revision tags: netbsd-1-5-PATCH003 netbsd-1-5-PATCH002 netbsd-1-5-PATCH001 netbsd-1-5-RELEASE netbsd-1-5-BETA2 netbsd-1-5-BETA netbsd-1-5-ALPHA2 netbsd-1-5-base minoura-xpg4dl-base
# 1.24 18-Feb-2000 itohy

s/MAKOBJDIR/MAKEOBJDIR/
Pointed out by Katsuomi Hamajima.


# 1.23 08-Feb-2000 sjg

Fixed handling of MAKEOBJDIR so that it matches make(1)'s expectations.
Added handling of MAKEOBJDIRPREFIX.
In both cases we simply need to mkdir the appropriate path if it does not
exists.


Revision tags: wrstuden-devbsize-19991221 wrstuden-devbsize-base
# 1.22 04-Dec-1999 sommerfeld

When building obj symlinks, if there's already a link pointing at the right target,
do nothing rather than deleting and recreating an identical link.


Revision tags: comdex-fall-1999-base
# 1.21 21-Aug-1999 sommerfeld

branches: 1.21.4;
Use (if defined) instead of obj.foo or obj
when building object directories


# 1.20 10-Jun-1999 kim

Oops, PWD is really something else in most environments.
Call this variable PAWD instead.


# 1.19 10-Jun-1999 tls

Fix a typo which caused "make obj" to try to *execute* the direcroty it was in.


# 1.18 08-Jun-1999 kim

Allow "make obj" to work nicely with amd by setting
PWD=/usr/bin/pawd in /etc/mk.conf and using the amd
mount point path for BSDSRCDIR.


Revision tags: netbsd-1-4-PATCH001 netbsd-1-4-RELEASE netbsd-1-4-base
# 1.17 12-Feb-1999 lukem

branches: 1.17.2;
pull in bsd.own.mk for MKOBJ


# 1.16 12-Feb-1999 lukem

* Add support for MKDOC MKLINKLIB MKLINT MKMAN MKNLS MKOBJ MKPIC MKPICINSTALL
MKPROFILE MKSHARE, which default to `yes' unless an equivalent NOxxx
variable is defined.
* Add MKCATPAGES, which if "no" prevents catpages from being built or installed

Users should use "MKxxx=no" instead of "NOxxx=" in /etc/mk.conf, because
this allows easy override on the make(1) command line (e.g 'make MKSHARE=yes'
to override MKSHARE=no in /etc/mk.conf).


# 1.15 27-Aug-1998 tv

Rename show-objdir to print-objdir to be consistent with existing
convention.


# 1.14 27-Aug-1998 tv

Add pseudo-target "show-objdir", which will print the value of ${.OBJDIR}
and nothing else. Intended target: cleaning up the ugly "echo | make"
constructs to find files from another directory's objdir.


Revision tags: netbsd-1-3-PATCH002 netbsd-1-3-PATCH001 netbsd-1-3-RELEASE netbsd-1-3-BETA netbsd-1-3-base
# 1.13 09-May-1997 mycroft

branches: 1.13.2;
Automatically add the .c files corresponding to .l and .y files to DPSRCS.
Automatically add DPSRCS to CLEANFILES.


# 1.12 07-May-1997 mycroft

Don't use _SUBDIRUSE outside of bsd.subdir.mk.


# 1.11 06-May-1997 mycroft

Add a pile of missing .PHONYs.


# 1.10 15-Apr-1997 christos

Make the `obj' target `.PHONY', so that does not get affected by .PATH/VPATH
This is not hurting things right now, and it will help things when path
searching for target nodes is enabled for make.


Revision tags: netbsd-1-2-PATCH001 netbsd-1-2-RELEASE netbsd-1-2-BETA netbsd-1-2-base
# 1.9 10-Apr-1996 thorpej

Get the current working directory from "/bin/pwd" rather than "pwd".
Changes to the shell make the behavior of "make obj" inconsistent
with previous behavior, depending on the login shell used by the user.
See PR #2200 for details. PR remains open while further analysis is
done. This at least restores the previous semantics for us csh(1) users.


# 1.8 21-Feb-1996 pk

Use shell internal substring matching, like bsd.man.mk.


Revision tags: netbsd-1-1-PATCH001 netbsd-1-1-RELEASE netbsd-1-1-base
# 1.7 10-Jun-1995 mycroft

Explicitly remove obj link before creating it.


Revision tags: netbsd-1-0-PATCH06 netbsd-1-0-PATCH05 netbsd-1-0-PATCH04 netbsd-1-0-PATCH03 netbsd-1-0-PATCH02 netbsd-1-0-PATCH1 netbsd-1-0-PATCH0 netbsd-1-0-RELEASE netbsd-1-0-base
# 1.6 30-Jun-1994 cgd

RCSID frobbing, and minor sanity adjustments.


# 1.5 30-Jun-1994 cgd

don't be careless with _SUBDIRUSE


# 1.4 07-Nov-1993 cgd

define BSDOBJDIR and BSDSRCDIR to have make think of the src and obj
trees as rooted someplace other than /usr/src and /usr/obj.


# 1.3 23-Oct-1993 cgd

add support to make obj.${MACHINE} dirs, if the user so requests.
note that not all makefiles in the tree will work with them, yet.


# 1.2 21-Oct-1993 cgd

'obj' was missing in echo which informed of symlink creation


# 1.1 15-Aug-1993 mycroft

Create target directories with `install -d', and move `obj' targets into one
file.


# 1.51 10-Dec-2016 christos

Back in 1993 ${MACHINE} was a unique way to define objdirs for
every platform. Thus setting OBJMACHINE, allowed one to keep
in-tree objdirs with multiple builds. With the advent of evb*, this
has become impossible until now. Introduce OBJMACHINE_ARCH that
adds ${MACHINE_ARCH} to the objdir so that we have unique objdirs
per build again. Until we restructure things to that this is not
necessary, it is the simplest fix.


# 1.50 08-Dec-2016 christos

factor out expression.


Revision tags: pgoyette-localcount-20161104 netbsd-7-0-2-RELEASE localcount-20160914 netbsd-7-nhusb-base pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base netbsd-7-0-1-RELEASE netbsd-7-0-RELEASE netbsd-7-0-RC3 netbsd-7-0-RC2 netbsd-7-0-RC1 netbsd-6-0-6-RELEASE netbsd-6-1-5-RELEASE netbsd-7-base yamt-pagecache-base9 yamt-pagecache-tag8 netbsd-6-1-4-RELEASE netbsd-6-0-5-RELEASE tls-earlyentropy-base riastradh-xf86-video-intel-2-7-1-pre-2-21-15 riastradh-drm2-base3 netbsd-6-1-3-RELEASE netbsd-6-0-4-RELEASE netbsd-6-1-2-RELEASE netbsd-6-0-3-RELEASE netbsd-6-1-1-RELEASE riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base netbsd-6-0-2-RELEASE netbsd-6-1-RELEASE netbsd-6-1-RC4 netbsd-6-1-RC3 agc-symver-base netbsd-6-1-RC2 netbsd-6-1-RC1 yamt-pagecache-base8 netbsd-6-0-1-RELEASE yamt-pagecache-base7 matt-nb6-plus-nbase yamt-pagecache-base6 netbsd-6-0-RELEASE netbsd-6-0-RC2 tls-maxphys-base matt-nb6-plus-base netbsd-6-0-RC1 yamt-pagecache-base5 yamt-pagecache-base4 netbsd-6-base yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base cherry-xenmp-base bouyer-quota2-nbase bouyer-quota2-base matt-mips64-premerge-20101231
# 1.49 25-Jan-2010 christos

PR/42658: Geoff Wing: Quote directory variables to deal with spaces in the
source pathname.


Revision tags: netbsd-5-2-3-RELEASE netbsd-5-1-5-RELEASE netbsd-5-2-2-RELEASE netbsd-5-1-4-RELEASE netbsd-5-2-1-RELEASE netbsd-5-1-3-RELEASE netbsd-5-2-RELEASE netbsd-5-2-RC1 netbsd-5-1-2-RELEASE netbsd-5-1-1-RELEASE matt-nb5-mips64-premerge-20101231 matt-nb5-pq3-base netbsd-5-1-RELEASE netbsd-5-1-RC4 matt-nb5-mips64-k15 netbsd-5-1-RC3 netbsd-5-1-RC2 netbsd-5-1-RC1 netbsd-5-0-2-RELEASE matt-nb5-mips64-premerge-20091211 matt-premerge-20091211 matt-nb5-mips64-u2-k2-k4-k7-k8-k9 matt-nb4-mips64-k7-u2a-k9b matt-nb5-mips64-u1-k1-k5 netbsd-5-0-1-RELEASE jym-xensuspend-nbase netbsd-5-0-RELEASE netbsd-5-0-RC4 netbsd-5-0-RC3 netbsd-5-0-RC2 jym-xensuspend-base netbsd-5-0-RC1 netbsd-5-base matt-mips64-base2 wrstuden-revivesa-base-3 wrstuden-revivesa-base-2 wrstuden-revivesa-base-1 yamt-pf42-base4 yamt-pf42-base3 hpcarm-cleanup-nbase yamt-pf42-baseX yamt-pf42-base2 wrstuden-revivesa-base yamt-pf42-base mjf-devfs2-base keiichi-mipv6-nbase keiichi-mipv6-base pc532-eol-2008 matt-armv6-nbase cube-autoconf-base matt-armv6-base hpcarm-cleanup-base
# 1.48 11-Dec-2007 lukem

It's "its" for possessive, not "it's".


Revision tags: netbsd-4-0-1-RELEASE wrstuden-fixsa-newbase matt-armv6-prevmlocking wrstuden-fixsa-base-1 netbsd-4-0-RELEASE netbsd-4-0-RC5 netbsd-4-0-RC4 netbsd-4-0-RC3 netbsd-4-0-RC2 netbsd-4-0-RC1 matt-mips64-base wrstuden-fixsa-base netbsd-4-base
# 1.47 26-Nov-2006 dsl

branches: 1.47.8;
Comment where make's internal copy of .OBJDIR gets changed


Revision tags: netbsd-3-1-1-RELEASE netbsd-3-0-3-RELEASE abandoned-netbsd-4-base netbsd-3-1-RELEASE netbsd-3-0-2-RELEASE netbsd-3-1-RC4 netbsd-3-1-RC3 netbsd-3-1-RC2 netbsd-3-1-RC1 netbsd-3-0-1-RELEASE netbsd-3-0-RELEASE netbsd-3-0-RC6 netbsd-3-0-RC5 netbsd-3-0-RC4 netbsd-3-0-RC3 netbsd-3-0-RC2 netbsd-3-0-RC1 netbsd-2-0-3-RELEASE netbsd-2-1-RELEASE netbsd-2-1-RC6 netbsd-2-1-RC5 netbsd-2-1-RC4 netbsd-2-1-RC3 netbsd-2-1-RC2 netbsd-2-1-RC1 netbsd-2-0-2-RELEASE netbsd-3-base netbsd-2-0-1-RELEASE netbsd-2-base netbsd-2-0-RELEASE netbsd-2-0-RC5 netbsd-2-0-RC4 netbsd-2-0-RC3 netbsd-2-0-RC2 netbsd-2-0-RC1 netbsd-2-0-base
# 1.46 04-Dec-2003 lukem

Ensure that ${TOOL_STAT} is executable before trying to run it;
it may not be available when performing "make obj" in tools/
when using BSDSRCDIR & BSDOBJDIR (instead of MAKEOBJDIR{,PREFIX}).


# 1.45 06-Nov-2003 lukem

support MAKEVERBOSE for objdir creation messages


# 1.44 28-Jul-2003 lukem

Be consistent how "multiple include protection" is implemented. I.e,

.if !defined(_BSD_foo_MK_)
_BSD_foo_MK_=1

# ...

.endif # !defined(_BSD_foo_MK_)


# 1.43 28-Jul-2003 lukem

Pull in <bsd.sys.mk> as well, for the TOOL_ variables in the
USETOOLS=never case.
Found & fixed by Anders Hjalmarsson in PR misc/22283.


# 1.42 20-Jul-2003 lukem

Use ltarg=`stat -qf '%Y' $l` to read a symlink's target (and rely upon
a non-zero exit value to indicate a missing file or non-symlink),
instead of test -h $l && ltarg=`ls -ld $l | awk '{print $NF}'`
since the former is quicker and more concise.


# 1.41 18-Jul-2003 lukem

whitespace cleanup


Revision tags: netbsd-1-6-PATCH002-RELEASE netbsd-1-6-PATCH002 netbsd-1-6-PATCH002-RC4 netbsd-1-6-PATCH002-RC3 netbsd-1-6-PATCH002-RC2 netbsd-1-6-PATCH002-RC1 netbsd-1-6-PATCH001 netbsd-1-6-PATCH001-RELEASE netbsd-1-6-PATCH001-RC3 netbsd-1-6-PATCH001-RC2 netbsd-1-6-PATCH001-RC1 fvdl_fs64_base netbsd-1-6-RELEASE netbsd-1-6-RC3 netbsd-1-6-RC2 netbsd-1-6-RC1 netbsd-1-6-base
# 1.40 14-Mar-2002 thorpej

Add a BUILDID variable, which further qualifies object directories.


# 1.39 29-Nov-2001 wiz

Remove spurious '.' in line 42, as reported by Naoto Shimazaki on
current-users on Thu, 29 Nov 2001 09:17:16.


# 1.38 28-Nov-2001 tv

Use :U successfully this time. In an expression such as ${FOO:D:Ubar}, you
end up with empty string if FOO is defined, and `bar' if it is undefined.


# 1.37 27-Nov-2001 jmc

If using MAKEOBJDIRPREFIX use the same checks as the symlink logic does below.

i.e. if the root of the object tree doesn't exist then complain and exit.

This makes both sections consistant to each other (MAKEOBJDIR specifies an
exact directory so there's no root per se to check so nothing can really be
done there).


# 1.36 20-Nov-2001 tv

:U can't be used to test for existence, as the variable may contain an
arbitrary value; change back to .if !defined(). Problem noted by
bernd@arresum.inka.de in PR toolchain/14629.


# 1.35 14-Nov-2001 tv

Turn off host-specific objdirs by default. Set MKHOSTOBJ=yes to enable.


# 1.34 12-Nov-2001 tv

Use ${__curdir} consistently.


# 1.33 11-Nov-2001 tv

Also handle the USR_OBJMACHINE case for OBJHOSTMACHINE.


# 1.32 11-Nov-2001 tv

Affix the ${HOST_OSTYPE} info to the end of the objdir name if OBJMACHINE
is set (and MAKEOBJDIR[PREFIX] is not in use). This permits multiple hosts
to compile hostprogs (not just src/tools) for a given target without
colliding with each other.

Currently restricted only to new toolchain builds, as this requires a new
make(1) in order to function properly.


# 1.31 11-Nov-2001 tv

Fix variable concatenation in previous.


# 1.30 11-Nov-2001 tv

Make the BSDSRCDIR/BSDOBJDIR symlink based objdir system work for the top
source directory. This will use BSDOBJDIR of OBJMACHINE is unset, and will
create a directory '.MACHINE' inside BSDOBJDIR if OBJMACHINE is set.

MAKEOBJDIR and MAKEOBJDIRPREFIX based objdirs already cope with the top
level directory just fine.


# 1.29 31-Oct-2001 tv

Use __curdir throughout, so MAKEOBJDIR builds see resolved paths in the
"foo -> bar" messages written to stdout.


# 1.28 14-Aug-2001 tv

Protect against multiple inclusion, and evaluate ${.CURDIR} early (to assist
the top-level toolchain bootstrap).


# 1.27 10-Jun-2001 mrg

fail `make obj' if $BSDOBJDIR doesn't exist. fixes PR#12937.


# 1.26 11-Mar-2001 cgd

"test !", rather than "! test". The former is more portable.


# 1.25 07-Jul-2000 cgd

test -h, not test -L.


Revision tags: netbsd-1-5-PATCH003 netbsd-1-5-PATCH002 netbsd-1-5-PATCH001 netbsd-1-5-RELEASE netbsd-1-5-BETA2 netbsd-1-5-BETA netbsd-1-5-ALPHA2 netbsd-1-5-base minoura-xpg4dl-base
# 1.24 18-Feb-2000 itohy

s/MAKOBJDIR/MAKEOBJDIR/
Pointed out by Katsuomi Hamajima.


# 1.23 08-Feb-2000 sjg

Fixed handling of MAKEOBJDIR so that it matches make(1)'s expectations.
Added handling of MAKEOBJDIRPREFIX.
In both cases we simply need to mkdir the appropriate path if it does not
exists.


Revision tags: wrstuden-devbsize-19991221 wrstuden-devbsize-base
# 1.22 04-Dec-1999 sommerfeld

When building obj symlinks, if there's already a link pointing at the right target,
do nothing rather than deleting and recreating an identical link.


Revision tags: comdex-fall-1999-base
# 1.21 21-Aug-1999 sommerfeld

branches: 1.21.4;
Use (if defined) instead of obj.foo or obj
when building object directories


# 1.20 10-Jun-1999 kim

Oops, PWD is really something else in most environments.
Call this variable PAWD instead.


# 1.19 10-Jun-1999 tls

Fix a typo which caused "make obj" to try to *execute* the direcroty it was in.


# 1.18 08-Jun-1999 kim

Allow "make obj" to work nicely with amd by setting
PWD=/usr/bin/pawd in /etc/mk.conf and using the amd
mount point path for BSDSRCDIR.


Revision tags: netbsd-1-4-PATCH001 netbsd-1-4-RELEASE netbsd-1-4-base
# 1.17 12-Feb-1999 lukem

branches: 1.17.2;
pull in bsd.own.mk for MKOBJ


# 1.16 12-Feb-1999 lukem

* Add support for MKDOC MKLINKLIB MKLINT MKMAN MKNLS MKOBJ MKPIC MKPICINSTALL
MKPROFILE MKSHARE, which default to `yes' unless an equivalent NOxxx
variable is defined.
* Add MKCATPAGES, which if "no" prevents catpages from being built or installed

Users should use "MKxxx=no" instead of "NOxxx=" in /etc/mk.conf, because
this allows easy override on the make(1) command line (e.g 'make MKSHARE=yes'
to override MKSHARE=no in /etc/mk.conf).


# 1.15 27-Aug-1998 tv

Rename show-objdir to print-objdir to be consistent with existing
convention.


# 1.14 27-Aug-1998 tv

Add pseudo-target "show-objdir", which will print the value of ${.OBJDIR}
and nothing else. Intended target: cleaning up the ugly "echo | make"
constructs to find files from another directory's objdir.


Revision tags: netbsd-1-3-PATCH002 netbsd-1-3-PATCH001 netbsd-1-3-RELEASE netbsd-1-3-BETA netbsd-1-3-base
# 1.13 09-May-1997 mycroft

branches: 1.13.2;
Automatically add the .c files corresponding to .l and .y files to DPSRCS.
Automatically add DPSRCS to CLEANFILES.


# 1.12 07-May-1997 mycroft

Don't use _SUBDIRUSE outside of bsd.subdir.mk.


# 1.11 06-May-1997 mycroft

Add a pile of missing .PHONYs.


# 1.10 15-Apr-1997 christos

Make the `obj' target `.PHONY', so that does not get affected by .PATH/VPATH
This is not hurting things right now, and it will help things when path
searching for target nodes is enabled for make.


Revision tags: netbsd-1-2-PATCH001 netbsd-1-2-RELEASE netbsd-1-2-BETA netbsd-1-2-base
# 1.9 10-Apr-1996 thorpej

Get the current working directory from "/bin/pwd" rather than "pwd".
Changes to the shell make the behavior of "make obj" inconsistent
with previous behavior, depending on the login shell used by the user.
See PR #2200 for details. PR remains open while further analysis is
done. This at least restores the previous semantics for us csh(1) users.


# 1.8 21-Feb-1996 pk

Use shell internal substring matching, like bsd.man.mk.


Revision tags: netbsd-1-1-PATCH001 netbsd-1-1-RELEASE netbsd-1-1-base
# 1.7 10-Jun-1995 mycroft

Explicitly remove obj link before creating it.


Revision tags: netbsd-1-0-PATCH06 netbsd-1-0-PATCH05 netbsd-1-0-PATCH04 netbsd-1-0-PATCH03 netbsd-1-0-PATCH02 netbsd-1-0-PATCH1 netbsd-1-0-PATCH0 netbsd-1-0-RELEASE netbsd-1-0-base
# 1.6 30-Jun-1994 cgd

RCSID frobbing, and minor sanity adjustments.


# 1.5 30-Jun-1994 cgd

don't be careless with _SUBDIRUSE


# 1.4 07-Nov-1993 cgd

define BSDOBJDIR and BSDSRCDIR to have make think of the src and obj
trees as rooted someplace other than /usr/src and /usr/obj.


# 1.3 23-Oct-1993 cgd

add support to make obj.${MACHINE} dirs, if the user so requests.
note that not all makefiles in the tree will work with them, yet.


# 1.2 21-Oct-1993 cgd

'obj' was missing in echo which informed of symlink creation


# 1.1 15-Aug-1993 mycroft

Create target directories with `install -d', and move `obj' targets into one
file.