diff options
author | Wolfram Schneider <wosch@FreeBSD.org> | 1996-04-22 23:31:39 +0000 |
---|---|---|
committer | Wolfram Schneider <wosch@FreeBSD.org> | 1996-04-22 23:31:39 +0000 |
commit | 44d97e5b4227dd28aaf383376863fca0d3137a76 (patch) | |
tree | 0a960ab14ac847918a2a45a90c5948f94971a968 /share/mk/bsd.obj.mk | |
parent | b34b86510b1a88c9a25824607057bd0085ff947d (diff) | |
download | src-44d97e5b4227dd28aaf383376863fca0d3137a76.tar.gz src-44d97e5b4227dd28aaf383376863fca0d3137a76.zip |
Notes
Diffstat (limited to 'share/mk/bsd.obj.mk')
-rw-r--r-- | share/mk/bsd.obj.mk | 55 |
1 files changed, 46 insertions, 9 deletions
diff --git a/share/mk/bsd.obj.mk b/share/mk/bsd.obj.mk index e5f3d883bde9..133c194bafef 100644 --- a/share/mk/bsd.obj.mk +++ b/share/mk/bsd.obj.mk @@ -1,15 +1,46 @@ -# $Id: bsd.obj.mk,v 1.1 1996/03/24 22:49:16 wosch Exp $ +# $Id: bsd.obj.mk,v 1.2 1996/04/09 22:43:33 wosch Exp $ +# +# The include file <bsd.obj.mk> handles creating 'obj' directory +# and cleaning up object files, log files etc. +# +# +# +++ variables +++ +# +# BSDSRCDIR The real path to the system sources, so that 'make obj' +# will work correctly. [/usr/src] +# +# BSDOBJDIR The real path to the system 'obj' tree, so that 'make obj' +# will work correctly. [/usr/obj] +# +# MAKEOBJDIR A file name to the directory where the targets +# are built. [obj] +# +# NOOBJ Do not create 'obj' directory if defined. [not set] +# +# NOOBJLINK Create 'obj' directory in current directory instead +# a symbolic link to the 'obj' tree if defined. [not set] +# +# +# +++ targets +++ +# +# clean: +# remove a.out Errs errs mklog ${CLEANFILES} +# +# cleandir: +# remove all of the files removed by the target clean, +# cleandepend (see bsd.dep.mk) and 'obj' directory. +# +# obj: +# create 'obj' directory. +# -# _SUBDIRUSE: -# BSDSRCDIR?=/usr/src -# BSDOBJDIR?=/usr/obj .if defined(MAKEOBJDIR) && !empty(MAKEOBJDIR) __objdir = ${MAKEOBJDIR} .else .if defined(MACHINE) && !empty(MACHINE) -__objdir = obj.${MACHINE} +__objdir = obj # obj.${MACHINE} .else __objdir = obj .endif @@ -22,17 +53,24 @@ obj: .else obj: _SUBDIRUSE cleanobj - @cd ${.CURDIR}; here=${.CURDIR}; \ - dest=${BSDOBJDIR}`echo $$here | sed "s,^${BSDSRCDIR},,"`/${__objdir}; \ - if test -d ${BSDOBJDIR}; then \ +.if defined(NOOBJLINK) + mkdir ${.CURDIR}/${__objdir} +.else + @if test -d ${BSDOBJDIR}; then \ + cd ${.CURDIR}; here=${.CURDIR}; \ + dest=${BSDOBJDIR}`echo $$here | \ + sed "s,^${BSDSRCDIR},,"`/${__objdir}; \ ${ECHO} "$$here/${__objdir} -> $$dest"; \ ln -s $$dest ${__objdir}; \ if test ! -d $$dest; then \ mkdir -p $$dest; \ fi; \ + else \ + ${ECHO} "obj tree \"${BSDOBJDIR}\" does not exist."; \ fi .endif .endif +.endif # # cleanup @@ -48,7 +86,6 @@ cleanfiles: cleandepend: .endif - .if !target(clean) clean: _SUBDIRUSE cleanfiles .endif |