History log of /freebsd-current/share/mk/bsd.obj.mk
Revision Date Author Comments
# d0b2dbfa 16-Aug-2023 Warner Losh <imp@FreeBSD.org>

Remove $FreeBSD$: one-line sh pattern

Remove /^\s*#[#!]?\s*\$FreeBSD\$.*$\n/


# 33ae1ff7 07-Apr-2020 Bryan Drewery <bdrewery@FreeBSD.org>

NO_OBJ: Always fix .OBJDIR regardless of AUTO_OBJ.

Sponsored by: Dell EMC
MFC after: 2 weeks


# b00a5bd5 06-Dec-2017 Bryan Drewery <bdrewery@FreeBSD.org>

AUTO_OBJ: Don't create nested OBJDIRS with print-dir or make -n.

Sponsored by: Dell EMC


# fa65e3a5 09-Nov-2017 Bryan Drewery <bdrewery@FreeBSD.org>

Handle some .OBJDIR == .CURDIR cases.

- If OBJROOT is SRCTOP then don't add on TARGET.TARGET_ARCH. This
only happens at the top-level, and for sub-directories when the
user is clever with MAKEOBJDIRPREFIX=/.
- Don't bother checking 'test -w' on .CURDIR.
- Properly set OBJTOP/OBJROOT to SRCTOP in various needed cases.
- Check if the OBJDIR is writable even for *clean* targets since it
determines which .OBJDIR the user gets; If they cannot write to an
existing eligible .OBJDIR then it needs to clean in .CURDIR instead.
- Add guard to cleanworld/cleanuniverse from removing SRCTOP.
- Ensure OBJTOP is proper for .OBJDIR=.CURDIR which fixes finding
libraries since src.libnames.mk is based on OBJTOP.
- Avoid some chdir(2) for modifying .OBJDIR

Sponsored by: Dell EMC Isilon


# 13ea0779 09-Nov-2017 Bryan Drewery <bdrewery@FreeBSD.org>

Mark targets .PHONY.

This avoids the obvious of not running the target when expected, but
also avoids META_MODE from showing 'Building'. This is mostly only
a problem when directly including bsd.obj.mk as many of these targets
were already .PHONY via bsd.sys.mk.

Sponsored by: Dell EMC Isilon


# c6d98d62 05-Nov-2017 Bryan Drewery <bdrewery@FreeBSD.org>

Follow-up r325405: Fix assertion still for kernel module builds.

Apparently they have SRCTOP set, but won't have RELDIR set since they are
not in-tree.

Pointyhat to: bdrewery
Reported by: O. Hartmann <ohartmann@walstatt.org>, dhw
Tested by: dhw
Sponsored by: Dell EMC Isilon


# b284f322 04-Nov-2017 Bryan Drewery <bdrewery@FreeBSD.org>

AUTO_OBJ: Allow 'make cleandir obj all' combinations.

The cleanobj target will not really remove the OBJDIR in this case,
it will only remove the OBJDIR if only clean targets are ran.

Sponsored by: Dell EMC Isilon


# aba77ddd 04-Nov-2017 Bryan Drewery <bdrewery@FreeBSD.org>

AUTO_OBJ: Set .OBJDIR=.CURDIR earlier for NO_OBJ Makefiles.

auto.obj.mk is loaded before the Makefile which may have NO_OBJ set inside of
it. In that case we can't avoid creating the OBJDIR but we do need to avoid
using it. Fixing .OBJDIR in bsd.init.mk at least fixes all of the build .mk
files to have a proper .OBJDIR. It does not fix the Makefile itself but
usually if they have NO_OBJ set they are not inspecting ${.OBJDIR} anyhow.

It is ideal to only have this in bsd.init.mk and to remove it from bsd.obj.mk,
but then bsd.obj.mk would need to include bsd.init.mk. Doing something like
that would require more testing. It has been proposed that bsd.obj.mk not be
included directly but it has been possible for too long to do so to change it
at this point.

Note too that it may make sense to fix .OBJDIR even when AUTO_OBJ is not
enabled but the historical behavior has always been that NO_OBJ just avoids
running 'make obj', so .OBJDIR should already be .CURDIR.

Also while NO_OBJ seems like it should be removed at this point, it is not
always possible to fix Makefiles to properly use an .OBJDIR. The cost of
keeping NO_OBJ support is minimal.

Sponsored by: Dell EMC Isilon


# d949e92a 04-Nov-2017 Bryan Drewery <bdrewery@FreeBSD.org>

Follow-up r325405: Only enable assertion for in-tree src builds.

Pointyhat to: bdrewery
Reported by: O. Hartmann <ohartmann@walstatt.org>
Sponsored by: Dell EMC Isilon


# 968be8a7 04-Nov-2017 Bryan Drewery <bdrewery@FreeBSD.org>

Add an assertion to avoid the 'rm -rf /etc' case from cleanobj fixed in r325404.

Sponsored by: Dell EMC Isilon


# dfa09989 01-Nov-2017 Bryan Drewery <bdrewery@FreeBSD.org>

Add option UNIFIED_OBJDIR, on by default, which moves the default build OBJDIR.

This changes the build OBJDIR from the older style of /usr/obj/<srcdir> for
native builds, and /usr/obj/<target>.<target_arch>/<srcdir> for cross builds to
a new simpler format of /usr/obj/<srcdir>/<target>.<target_arch>. This
new format is used regardless of cross or native build. It allows
easier management of multiple source tree object directories.

The UNIFIED_OBJDIR option will be removed and its feature made permanent
for the 12.0 release.

Relnotes: yes (don't note UNIFIED_OBJDIR option since it will be removed)
Prior work: D3711 D874
Reviewed by: gjb, sjg
Discussed at: https://lists.freebsd.org/pipermail/freebsd-arch/2016-May/017805.html
Discussed with: emaste
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D12840


# 01ba2b63 24-Jul-2017 Bryan Drewery <bdrewery@FreeBSD.org>

cleandir: Fix ESTALE errors from parallel removals.

This fixes 'make cleandir' to use the same ordering as 'make cleanobj'.
Meaning that SUBDIR will be recursed before the current directory is
handled. This avoids an 'rm -rf /usr/obj/usr/src/lib/libc' while
a child 'rm -rf /usr/obj/usr/src/lib/libc/tests' is being ran next,
or even removing the current directory and then recursing into a child
and using the 'missing OBJDIR' logic to remove files rather than the
directory.

The most ideal ordering here would be for 'cleanobj' and 'cleandir' to
simply remove the .OBJDIR and then not recurse at all. This is only
safe if it is guaranteed that all children directories have no orphaned
files in their source checkout and are only using obj directories. This
is usually safe from the top-level build targets and when using
WITH_AUTO_OBJ. Improving the build for those cases is coming.

Reported by: cperciva, scottl
X-MFC-With: r321427
MFC after: 2 weeks
Sponsored by: Dell EMC Isilon


# 13353986 24-Jul-2017 Bryan Drewery <bdrewery@FreeBSD.org>

PROGS: Fix ESTALE errors on NFS while cleaning in directories with PROGS.

- Only recurse on cleanobj/cleandir if there is no .OBJDIR being used.
If we don't recurse then bsd.obj.mk will just rm -rf the OBJDIR dir.
- When recursing on cleanobj/cleandir don't remove dependfiles/dirs
redundantly from the child and main processes. Meaning '.depend', and
'tags', and '.depend.*' will now only be removed from the main
process.
- Stop recursing on 'cleandepend' since the main process can handle
removing all files via the default glob patterns in CLEANDEPENDFILES.
- This reverts r288201, by readding recursion on 'cleanobj', due to
r291635 changing how bsd.subdir.mk handles recursion.

This is primarily targeting ESTALE NFS errors from rm(1) during a
buildworld but is also a performance optimization as both issues fixed
were redundant anyway.

Reported by: cperciva, scottl
MFC after: 2 weeks
Sponsored by: Dell EMC Isilon


# 2ae97682 24-Jul-2017 Bryan Drewery <bdrewery@FreeBSD.org>

cleanobj: Unhide removal of directory.

MFC after: 2 weeks
Sponsored by: Dell EMC Isilon


# 85ec5050 21-Jun-2017 Bryan Drewery <bdrewery@FreeBSD.org>

objwarn should be .PHONY.

Otherwise in META_MODE it may create an objwarn.meta if only bsd.obj.mk
is included; bsd.sys.mk already had .PHONY: objwarn.

MFC after: 3 days
Sponsored by: Dell EMC Isilon


# 82d38881 30-Aug-2016 Bryan Drewery <bdrewery@FreeBSD.org>

AUTO_OBJ: Support SRCS/DPSRCS that contain '/' and require a nested OBJDIR.

This is to be used by the new clang3.9 build and extends functionality
added to 'make obj' in r279980.

MFC after: 2 weeks
Sponsored by: EMC / Isilon Storage Division


# 190348ae 29-Aug-2016 Bryan Drewery <bdrewery@FreeBSD.org>

Allow parallelizing clean/cleandepend/depend with all.

This now makes 'make -jX clean all install' safe.

MFC after: 3 days
Sponsored by: EMC / Isilon Storage Division


# 10757290 23-Aug-2016 Dimitry Andric <dim@FreeBSD.org>

In addition to creating subdirectories under .OBJDIR for SRCS with
relative paths, also create them for DPSRCS. This is needed for builds
that generate files during the depend stage, which cannot be compiled by
themselves, since those have to be put in DPSRCS.


# 1bd4272f 15-Feb-2016 Bryan Drewery <bdrewery@FreeBSD.org>

Consolidate common beforebuild logic.

Sponsored by: EMC / Isilon Storage Division


# 11ffa20f 25-Nov-2015 Bryan Drewery <bdrewery@FreeBSD.org>

Standardize on OBJTOP in and outside of META MODE.

Sponsored by: EMC / Isilon Storage Division


# e5b44e37 11-Jun-2015 Simon J. Gerraty <sjg@FreeBSD.org>

With MK_AUTO_OBJ=yes objdir is created during sys.mk

If a makefile sets NO_OBJ, we should honor that by setting
.OBJDIR back to .CURDIR


# dccf7ced 10-Jun-2015 Simon J. Gerraty <sjg@FreeBSD.org>

combine two comments


# 940a3032 10-Jun-2015 Simon J. Gerraty <sjg@FreeBSD.org>

Explain in a nutshell why we destroy


# 4cc6b839 10-Jun-2015 Simon J. Gerraty <sjg@FreeBSD.org>

If MK_AUTO_OBJ==yes, it is done before bsd.obj.mk included


# cee9be49 13-Mar-2015 Dimitry Andric <dim@FreeBSD.org>

Allow relative pathnames in SRCS, so as to enable building software
which includes more than one file with the same name, in different
directories.

For example, setting:

SRCS+= foo/foo.c bar/foo.c baz/foo.c

will now create separate objdirs 'foo', 'bar' and 'baz' for each of the
sources in the list, and use those objdirs for the corresponding object
files.

Reviewed by: brooks, imp
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D1984


# bd808d41 06-Nov-2014 Warner Losh <imp@FreeBSD.org>

Ignore errors from rm -rf to support high -j builds. This is, at best,
a kludge. However, it also effectively works around the issues for
high -j builds on systems that do not have the rm fixes.

A better fix would be to rmdir here, and fix the places where we're
sloppy and not list all the files we create in CLEANFILES, should
anybody have the time to chase them all to ground.


# 49217bc5 21-Jul-2014 Simon J. Gerraty <sjg@FreeBSD.org>

bsd.lib.mk does not add OBJS etc to CLEANFILES so does not automatically
get them flagged as .NOPATH. This hurts people who don't use obj dirs.
Since its clean target seprate rm's for things, use NOPATH_FILES as list
to collect things that need .NOPATH.

bsd.obj.mk will add CLEANFILES to NOPATH_FILES and do the deed if needed.

Reviewed by: sbruno


# 005cfa50 09-May-2014 Simon J. Gerraty <sjg@FreeBSD.org>

Don't make wildcards .PHONY
Add pseudo machines host and common to machine list for destroy


# 09cd1cf1 05-May-2014 Simon J. Gerraty <sjg@FreeBSD.org>

If doing destroy-all and at top-level whack stage tree too.


# 47f881af 01-May-2014 Simon J. Gerraty <sjg@FreeBSD.org>

Add 'destroy' target to efficiently rm -rf objtree

Reviewed by: obrien


# 0815243c 06-Oct-2012 Marcel Moolenaar <marcel@FreeBSD.org>

Add support for bmake. This includes:
1. Don't do upgrade_checks when using bmake. As long as we have WITH_BMAKE,
there's a bootstrap complication in ths respect. Avoid it. Make the
necessary changes to have upgrade_checks work wth bmake anyway.
2. Remove the use of -E. It's not needed in our build because we use ?= for
the respective variables, which means that we'll take the environment
value (if any) anyway.
3. Properly declare phony targets as phony as bmake is a lot smarter (and
thus agressive) about build avoidance.
4. Make sure CLEANFILES is complete and use it on .NOPATH. bmake is a lot
smarter about build avoidance and should not find files we generate in
the source tree. We should not have files in the repository we want to
generate, but this is an easier way to cross this hurdle.
5. Have behavior under bmake the same as it is under make with respect to
halting when sub-commands fail. Add "set -e" to compound commands so
that bmake is informed when sub-commands fail.
6. Make sure crunchgen uses the same make as the rest of the build. This
is important when the make utility isn't called make (but bmake for
example).
7. While here, add support for using MAKEOBJDIR to set the object tree
location. It's the second alternative bmake looks for when determining
the actual object directory (= .OBJDIR).

Submitted by: Simon Gerraty <sjg@juniper.net>
Submitted by: John Van Horne <jvanhorne@juniper.net>


# 7750ad47 22-Aug-2012 Marcel Moolenaar <marcel@FreeBSD.org>

Sync FreeBSD's bmake branch with Juniper's internal bmake branch.

Requested by: Simon Gerraty <sjg@juniper.net>


# a7d5f7eb 19-Oct-2010 Jamie Gritton <jamie@FreeBSD.org>

A new jail(8) with a configuration file, to replace the work currently done
by /etc/rc.d/jail.


# fe0506d7 09-Mar-2010 Marcel Moolenaar <marcel@FreeBSD.org>

Create the altix project branch. The altix project will add support
for the SGI Altix 350 to FreeBSD/ia64. The hardware used for porting
is a two-module system, consisting of a base compute module and a
CPU expansion module. SGI's NUMAFlex architecture can be an excellent
platform to test CPU affinity and NUMA-aware features in FreeBSD.


# d7f03759 19-Oct-2008 Ulf Lilleengen <lulf@FreeBSD.org>

- Import the HEAD csup code which is the basis for the cvsmode work.


# 84aac273 11-Apr-2005 Hartmut Brandt <harti@FreeBSD.org>

Make sure the only thing that follows .endif or .else is a comment.


# d966048e 06-Jan-2005 Kirill Ponomarev <krion@FreeBSD.org>

Remove trailing spaces.


# e653b48c 21-Dec-2004 Ruslan Ermilov <ru@FreeBSD.org>

Start the dreaded NOFOO -> NO_FOO conversion.

OK'ed by: core


# b5db19d0 12-Apr-2004 Ruslan Ermilov <ru@FreeBSD.org>

Mark the "obj" target with the .PHONY attribute.


# 2fc19708 01-Jan-2004 Brian Feldman <green@FreeBSD.org>

Fix a very corner case when you want to make cleandir SUBDIRs which
are built using a ${MAKE} that's not just "make".

Test by: make universe (followed by cleandirs)


# b5cdcc00 30-Aug-2002 Kris Kennaway <kris@FreeBSD.org>

test -h is deprecated; use -L instead.

Submitted by: april <april@oublinet.net>
PR: misc/38724 (part of)
MFC after: 3 days


# 8f463ff4 12-Jul-2002 Ruslan Ermilov <ru@FreeBSD.org>

Moved the `distribute' target from bsd.obj.mk to bsd.subdir.mk,
to make it call `install' in the bsd.subdir.mk-driven makefiles
too. (share/examples/Makefile,v 1.29 changed the bsd.prog.mk
to bsd.subdir.mk and many stuff was lost during "make release".
I then merged this change in rev. 1.28.2.2 to work around the
namespace pollution (FILES) in this makefile.)

There was an added complexity here. Both the `distribute' and
`install' targets are recursive (they propagate to SUBDIRs).
So `distribute' first calls `install' in the ${.CURDIR}, then
calls `distribute' in each SUBDIR, etc. The problem is that
`install' (being also recursive) causes the stuff from SUBDIR
to be installed twice, first time thru `install' in ${.CURDIR}
triggered by `distribute', second time by `distribute' run in
the SUBDIR. This problem is not new, but it became apparent
only after I moved the `distribute' target from bsd.obj.mk to
bsd.subdir.mk. My first attempt testing the fix failed due to
this, because the whole world was distributed twice, causing
all the imaginable mess (kerberos5 stuff was installed into both
"base" and "krb5" dists, there was /sbin/init.bak, etc.)
I say the problem is not new because bsd.prog.mk and bsd.lib.mk
makefiles with SUBDIR (even without this fix) had this problem
for years. Try e.g. running ``make distribute DISTDIR=/foo''
from usr.bin/bzip2 or from lib/libcom_err (without the fix) and
watch the output.

So the solution was to make `install' behave non-recursive when
executed by `distribute'. My first attempt in passing SUBDIR=
to the `install' in the `distribute' body failed because of the
way how src/Makefile and src/Makefile.inc1 communicate with each
other. SUBDIR='s assignment precedence on the "make install
SUBDIR=" command line is lowered after src/Makefile wrapper calls
"make ... -f ${.CURDIR}/Makefile.inc1 install" because SUBDIR=
is moved into environment, and Makefile.inc1's assignments now
take higher precedence. This may be fixed someday when we merge
Makefile with Makefile.inc1. For now, this is implemented as a
NO_SUBDIR knob.

Spotted by: Dmitry Pryanishnikov <dmitry@atlantis.dp.ua>
Prodded by: des
MFC after: 3 days


# 6e02167b 02-Jul-2002 Ruslan Ermilov <ru@FreeBSD.org>

Moved checkdpadd target to where it logically belongs.


# 93329c3c 01-Jul-2002 Ruslan Ermilov <ru@FreeBSD.org>

Fixed typos.


# c1c9929e 21-Jun-2002 Ruslan Ermilov <ru@FreeBSD.org>

Quiet ``make objlink'' when NOOBJ is defined.

PR: bin/21142
Submitted by: Craig Leres <leres@ee.lbl.gov>


# c5234b56 24-Apr-2002 Ruslan Ermilov <ru@FreeBSD.org>

Abuse bsd.obj.mk for defining default distribute target.


# b25a566d 23-Apr-2002 Ruslan Ermilov <ru@FreeBSD.org>

Merge bsd.obj.mk's version of the _SUBDIR target with bsd.subdir.mk.

Ensure all standard targets honor SUBDIR. Now `make obj' descends into
SUBDIRs even if NOOBJ is set (some descendants may still need an object
directory, but we do not have such precedents). Now `make install' in
non-bsd.subdir.mk makefiles runs `afterinstall' target _after_ `install'
in SUBDIRs, like we do in bsd.subdir.mk. Nothing depended on the wrong
order anyway.

Fixed `distribute' targets (except for the bsd.subdir.mk version) so that
they do not depend on _SUBDIR; `distribute' calls `install' which already
depends on _SUBDIR.

De-standardize `maninstall', otherwise manpages would be installed twice.
(To be revised later.)


# 939a04b9 22-Apr-2002 Ruslan Ermilov <ru@FreeBSD.org>

Fixed _SUBDIR.

Obtained from: bsd.subdir.mk


# 2bdaf7e8 17-Apr-2002 Ruslan Ermilov <ru@FreeBSD.org>

Don't include bsd.own.mk from sys.mk, this makes it impossible
to use ``.if defined()'' inside bsd.own.mk to test for defines
in individual makefiles. For example, setting DEBUG_FLAGS in
Makefile didn't take the desired effect on the STRIP assignment.

Added bsd.init.mk (like in NetBSD) that handles the inclusion
of ../Makefile.inc and bsd.own.mk from all bsd.*.mk files that
"build something".

Back out bsd.own.mk,v 1.15: moved OBJFORMAT initialization back
to sys.mk (several source tree makefiles want to check it early)
and removed MACHINE_ARCH initialization (it's hard to see from
looking at the commitlogs what the problem was at the time, but
now it serves no purpose).

Prohibit the direct inclusion of bsd.man.mk and bsd.libnames.mk.

Protect bsd.obj.mk from repetitive inclusion. Prohibiting the
direct inclusion of bsd.obj.mk might be a good idea too.


# de0d6977 11-Apr-2002 Ruslan Ermilov <ru@FreeBSD.org>

Really finish the removal of ${LDDESTDIR} in bsd.lib.mk,v 1.55.
bsd.lib.mk,v 1.101 only did that partly.


# 539eb783 06-Feb-2002 Ruslan Ermilov <ru@FreeBSD.org>

Neither .depend nor ${DEPENDFILE} depend on _SUBDIR.
(One step closer to _SUBDIR <-> _SUBDIRUSE merge.)


# 2b1f35a9 19-May-2001 Ruslan Ermilov <ru@FreeBSD.org>

Fixed `objwarn' so that it doesn't issue spurious warnings,
especially now that ${.OBJDIR} is canonicalized by make(1).

Urged by: bde
Reviewed by: bde


# d79f28bb 26-Apr-2001 Ruslan Ermilov <ru@FreeBSD.org>

... and do it make(1) way.


# 7841ac2f 23-Apr-2001 Ruslan Ermilov <ru@FreeBSD.org>

Fix the fix in rev.1.34.

Makes `cleandir' DTRT if MAKEOBJDIRPREFIX set and not empty,
like in `buildworld' case.


# 5558b041 01-Nov-2000 David E. O'Brien <obrien@FreeBSD.org>

Use test -z rather than -n.

Submitted by: bde


# 9f0c6741 18-Aug-2000 Mark Murray <markm@FreeBSD.org>

Fix the arguments to [(1) (AKA test(1)). If the string being tested
by -n is nonexistant, then the following -d was misinterpreted with
a strange error. By putting double quotes (") around the argument,
we can be sure there is _something_ there that we can check a zero
length against.


# ae361066 17-Aug-2000 Sheldon Hearn <sheldonh@FreeBSD.org>

The previous delta was wrong; an empty MAKEOBJDIRPREFIX should
cause the working directory to be used. Make it so.

When we're more convinced that it'll work, we might try this
to avoid a shell invocation:

.if defined(MAKEOBJDIRPREFIX) && !empty(MAKEOBJDIRPREFIX) &&
exists(${CANONICALOBJDIR}/)

Reported by: bde


# 4a5b9b00 16-Aug-2000 Sheldon Hearn <sheldonh@FreeBSD.org>

Do not allow the cleandir target to blow away the entire source
directory when MAKEOBJDIRPREFIX is defined but empty.

Reported by: Vernon Schryver <vjs@calcite.rhyolite.com>


# 0917704b 14-Nov-1999 Marcel Moolenaar <marcel@FreeBSD.org>

${MACHINE} -> ${MACHINE_ARCH}

All Makefiles now use MACHINE_ARCH for the target architecture.
Unification is required for cross-building.

Tags added to:
sys/boot/Makefile
sys/boot/arc/loader/Makefile
sys/kern/Makefile
usr.bin/cpp/Makefile
usr.bin/gcore/Makefile
usr.bin/truss/Makefile

usr.bin/gcore/Makefile:
fixed typo: MACHINDE -> MACHINE_ARCH


# 7f3dea24 27-Aug-1999 Peter Wemm <peter@FreeBSD.org>

$Id$ -> $FreeBSD$


# 760a0960 20-Mar-1999 Bruce Evans <bde@FreeBSD.org>

Restored objlink. The previous commit was confused about the difference
between OBJLINK and objlink.


# 5beaada3 14-Mar-1999 Mark Murray <markm@FreeBSD.org>

Bitrot. Remove objlink as it is not pleasant to be downwind.

PR: 8071
Reviewed by: Sheldon Hearn <sheldonh@iafrica.com>


# cdaa52cf 30-Aug-1998 John Birrell <jb@FreeBSD.org>

BINFORMAT -> OBJFORMAT ready for E-day.


# 0b3f8389 04-Jun-1998 Peter Wemm <peter@FreeBSD.org>

Make the whereobj target print it's output without the overhead of
starting another make..
Besides, make -V is broken, since it will print unexpanded variables.


# 5a9eee48 06-May-1998 Bruce Evans <bde@FreeBSD.org>

Only include bsd.dep.mk in `mk'files that handle C sources. Abuse
bsd.obj.mk instead of bsd.dep.mk for defining the _SUBDIR target
and a default tags target. Abuse bsd.obj.mk for defining default
cleandepend and depend targets.


# fe9ce45a 14-Mar-1998 Bruce Evans <bde@FreeBSD.org>

Improved comparison of ${DPADD} with ${LDADD} for the checkdpadd target.
`BINFORMAT=foo make checkdpadd' in /usr/src now reports only 2 false
negatives (in libss and init). (BINFORMAT=foo is to turn off better
handling of the a.out case.)


# 0f608029 24-Feb-1998 Bruce Evans <bde@FreeBSD.org>

Remove ${CLEANDIRS} in the default clean rule, so that bsd.prog.mk can
use the default without losing any (currently unused) features.
(CLEANDIRS is only used by for libgmp and libmp via bsd.lib.mk, and
only documented everywhere it is supported except of course where it
is actually used.)


# 939d5a3d 19-Dec-1997 Bruce Evans <bde@FreeBSD.org>

Only remove ${CLEANFILES} in the default clean rule. In particular,
don't remove a.out explicitly. a.out should only be generated for
libraries and is removed in the non-default rule in bsd.lib.mk.

Removed undocumented cleanfiles target. It was the same as the
default clean target except it didn't descend into subdirs. It was
different from special clean targets in other ways. This feature
hasn't been missed for more important targets.

Removed unused default cleandepend target. bsd.dep.mk has a better
version which is always used.

Use a better rule for checkdpadd in the BINFORMAT=aout case. This
mainly checks that ld -f is working correctly. The old rule is
still available via `make BINFORMAT=foo checkdpadd' and should be
used to check for regressions under 2.2 where ld -f is not available.


# 409ac84c 30-Apr-1997 Bruce Evans <bde@FreeBSD.org>

Added trailing slash to ${CANONICALOBJDIR} in tests for directories,
so that /usr/obj can be a symlink to an existing directory.


# b97fa2ef 22-Feb-1997 Peter Wemm <peter@FreeBSD.org>

Revert $FreeBSD$ to $Id$


# 26100387 13-Feb-1997 John Polstra <jdp@FreeBSD.org>

In the "cleanobj" target, always remove the old-style "${.CURDIR}/obj"
links if they exist. The old-style links confused make and caused
problems when upgrading from a 2.1.5 or 2.1.6 system.

I will merge this into -2.2.


# 1130b656 14-Jan-1997 Jordan K. Hubbard <jkh@FreeBSD.org>

Make the long-awaited change from $Id$ to $FreeBSD$

This will make a number of things easier in the future, as well as (finally!)
avoiding the Id-smashing problem which has plagued developers for so long.

Boy, I'm glad we're not using sup anymore. This update would have been
insane otherwise.


# 2986df98 29-Sep-1996 Bruce Evans <bde@FreeBSD.org>

Don't warn about non-canonical object directories if they have been
forced in any of the standard ways (MAKEOBJDIR was lost in the
previous commit). Simplified the conditionals for this.

Restored comment about MAKEOBJDIR from rev.1.4.

Improved English in comments.


# 7fc738cf 28-Sep-1996 Nate Williams <nate@FreeBSD.org>

The warning was triggering off the unused variable MAKEOBJDIR, instead
of the variable OBJLINK which is used in /etc/make.conf to build 'obj'
links in the current directory. This caused lots of useless warnings
since if OBJLINK is defined ./obj will be created and used.


# 55c8be64 23-Sep-1996 Andrey A. Chernov <ache@FreeBSD.org>

Back out my brackets change, it is definitely make bug, (recently
introduced) because old make version I check do the right job.


# 4400af91f 23-Sep-1996 Andrey A. Chernov <ache@FreeBSD.org>

Add brackets to change bogus make expression priority, i.e.
!defined(X) && $(A) != $(B)
parsed as
(!defined(X) && $(A)) != $(B)
and not as
!defined(X) && ($(A) != $(B))
Probably it should be fixed in make


# 373fdd96 20-Sep-1996 Bruce Evans <bde@FreeBSD.org>

Added a `checkdpadd' target to help check that ${DPADD} is consistent with
${LDADD}. It doesn't handle internal libraries very well yet.


# 6a2c9543 20-Sep-1996 Bruce Evans <bde@FreeBSD.org>

Fixed and simplified `whereobj' rule. Use the not-so-new -V feature.
Echoing ${.OBJDIR} would work. but -V is more general.


# 32b11525 19-Sep-1996 Peter Wemm <peter@FreeBSD.org>

disable the objwarn warning if NOOBJ is set.. We have quite a few places
in the tree that use things like bsd.prog.mk just to get the default
targets like install, tags, obj, clean, cleandir, cleandepend, but do not
actually build anything there.


# b3618bcf 18-Sep-1996 Steven Wallace <swallace@FreeBSD.org>

.TARGETOBJDIR has been removed from make and CANONICALOBJDIR set in
bsd.obj.mk. Also, a make target called objwarn checks to see
if ${.OBJDIR} != ${.CURDIR} and ${.OBJDIR} != ${CANONICALOBJDIR}
and outputs a warning. (No warning for the latter if MAKEOBJDIR or MAKEOBJDIRP
REFIX is set). objwarn is called from all targets in bsd.prog.mk, bsd.kmod.mk,
and bsd.lib.mk.

Reviewed by: bde


# 833e6661 05-Sep-1996 Bruce Evans <bde@FreeBSD.org>

Fixed `make objlink' (and `make obj' in the (non-default) OBJLINK case).
Running them twice usually destroyed the target binary. E.g., the
second `make objlink' in `make objlink; make; make objlink' replaced
the `cat' binary by a symlink cat@ -> /usr/obj/usr/src/bin/cat.

`ln -fs' is unusable when the target might be a symlink that resolves
to a directory. Then -f applies to a file in the directory and not
to the symlink. This seems to be the standard (and sometimes useful)
behaviour.


# fb547ee2 14-Jul-1996 Peter Wemm <peter@FreeBSD.org>

Fix the recently added whereobj target.

Add missing end-of-line backslash
Remove two extra @ characters


# 120a0656 12-Jul-1996 Paul Traina <pst@FreeBSD.org>

Add whereobj target to find that pesky obj dir


# cd9a2f5c 23-Jun-1996 Jordan K. Hubbard <jkh@FreeBSD.org>

Bring in my changes for removing the pestilent obj links (unless you
really want them) from /usr/src. This is the final version of the
patches, incorporating the feedback I've received from -current.


# 125e8ffd 27-May-1996 Wolfram Schneider <wosch@FreeBSD.org>

Add a note that MAKEOBJDIR is an enviroment variable
and does work proper only if set as enviroment variable,
not as global or command line variable.


# 44d97e5b 22-Apr-1996 Wolfram Schneider <wosch@FreeBSD.org>

New variable NOOBJLINK
Create 'obj' directory in current directory instead
a symbolic link to the 'obj' tree if defined. [not set]

Print a warning if 'obj' tree (/usr/obj) does not exist.

Change default 'obj' directory from ``obj.${MACHINE}'' back to
``obj'', unfortunately many Makefiles are wired with the name ``obj''.

Add some comments for variables and targets.


# fe51f270 09-Apr-1996 Wolfram Schneider <wosch@FreeBSD.org>

Add targets cleanfiles/clean, cleandir


# accb7faf 24-Mar-1996 Wolfram Schneider <wosch@FreeBSD.org>

Obtained from: NetBSD

"obj" directory stuff work