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.
This commit is contained in:
Bruce Evans 1997-12-19 18:48:45 +00:00
parent 5a76e22406
commit 939d5a3dd8
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=31859

View File

@ -1,7 +1,7 @@
# $Id: bsd.obj.mk,v 1.19 1997/02/22 13:56:12 peter Exp $
# $Id: bsd.obj.mk,v 1.20 1997/04/30 17:04:11 bde Exp $
#
# The include file <bsd.obj.mk> handles creating the 'obj' directory
# and cleaning up object files, log files etc.
# and cleaning up object files, etc.
#
#
# +++ variables +++
@ -32,7 +32,7 @@
# +++ targets +++
#
# clean:
# remove a.out Errs errs mklog ${CLEANFILES}
# remove ${CLEANFILES}
#
# cleandir:
# remove the build directory (and all its contents) created by obj
@ -108,9 +108,6 @@ whereobj:
@cd ${.CURDIR}; ${MAKE} -V .OBJDIR
.endif
#
# cleanup
#
cleanobj:
@if [ -d ${CANONICALOBJDIR}/ ]; then \
rm -rf ${CANONICALOBJDIR}; \
@ -119,30 +116,31 @@ cleanobj:
fi
@if [ -h ${.CURDIR}/obj ]; then rm -f ${.CURDIR}/obj; fi
.if !target(cleanfiles)
cleanfiles:
rm -f a.out Errs errs mklog ${CLEANFILES}
.endif
# see bsd.dep.mk
.if !target(cleandepend)
cleandepend:
@rm -f .depend
.endif
.if !target(clean)
clean: cleanfiles _SUBDIR
clean: _SUBDIR
.if defined(CLEANFILES) && !empty(CLEANFILES)
rm -f ${CLEANFILES}
.endif
.endif
.if !target(checkdpadd)
checkdpadd: _SUBDIR
.if (defined(DPADD) || defined(LDADD))
checkdpadd:
.if ${BINFORMAT} != aout
@if [ "${DPADD:S;^/usr/lib/lib;-l;S;.a$;;}" != "${LDADD}" ] ; then \
echo ${.CURDIR} ; \
echo "DPADD -> " ${DPADD:S;^/usr/lib/lib;-l;S;.a$;;} ; \
echo "LDADD = " ${LDADD} ; \
fi
.else
@dpadd=`echo \`ld -Bstatic -f ${LDDESTDIR} ${LDADD}\`` ; \
if [ "$$dpadd" != "${DPADD}" ] ; then \
echo ${.CURDIR} ; \
echo "LDADD -> " $$dpadd ; \
echo "DPADD = " ${DPADD} ; \
fi
.endif
.endif
.endif