diff options
Diffstat (limited to 'share/mk')
-rw-r--r-- | share/mk/Makefile | 4 | ||||
-rw-r--r-- | share/mk/bsd.dep.mk | 34 | ||||
-rw-r--r-- | share/mk/bsd.doc.mk | 26 | ||||
-rw-r--r-- | share/mk/bsd.info.mk | 39 | ||||
-rw-r--r-- | share/mk/bsd.kmod.mk | 32 | ||||
-rw-r--r-- | share/mk/bsd.lib.mk | 57 | ||||
-rw-r--r-- | share/mk/bsd.obj.mk | 99 | ||||
-rw-r--r-- | share/mk/bsd.own.mk | 16 | ||||
-rw-r--r-- | share/mk/bsd.port.mk | 31 | ||||
-rw-r--r-- | share/mk/bsd.prog.mk | 61 | ||||
-rw-r--r-- | share/mk/bsd.sgml.mk | 6 |
11 files changed, 126 insertions, 279 deletions
diff --git a/share/mk/Makefile b/share/mk/Makefile index ae856da7b137..fc9bd75bd987 100644 --- a/share/mk/Makefile +++ b/share/mk/Makefile @@ -1,4 +1,4 @@ -# $Id: Makefile,v 1.9 1995/09/08 19:27:48 jfieber Exp $ +# $Id: Makefile,v 1.10 1996/04/12 11:13:29 wosch Exp $ # From: @(#)Makefile 8.1 (Berkeley) 6/8/93 FILES= bsd.README @@ -11,7 +11,7 @@ NOOBJ= noobj all clean cleandir depend lint tags: afterinstall: - ${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 444 ${FILES} \ + cd ${.CURDIR} && ${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 444 ${FILES} \ ${DESTDIR}${BINDIR}/mk .include <bsd.prog.mk> diff --git a/share/mk/bsd.dep.mk b/share/mk/bsd.dep.mk index 5bf3c3b0cae0..4330e2d399cc 100644 --- a/share/mk/bsd.dep.mk +++ b/share/mk/bsd.dep.mk @@ -1,4 +1,4 @@ -# $Id: bsd.dep.mk,v 1.3 1996/04/01 18:58:28 wosch Exp $ +# $Id: bsd.dep.mk,v 1.4 1996/05/25 23:09:46 wosch Exp $ # # The include file <bsd.dep.mk> handles Makefile dependencies. # @@ -33,7 +33,7 @@ DEPENDFILE?= .depend # some of the rules involve .h sources, so remove them from mkdep line .if !target(depend) -depend: beforedepend ${DEPENDFILE} afterdepend ${_DEPSUBDIR} +depend: beforedepend ${DEPENDFILE} afterdepend _SUBDIR .if defined(SRCS) # .if defined ${SRCS:M*.[sS]} does not work @@ -58,7 +58,7 @@ ${DEPENDFILE}: ${SRCS} .endif .else -${DEPENDFILE}: ${_DEPSUBDIR} +${DEPENDFILE}: _SUBDIR .endif .if !target(beforedepend) beforedepend: @@ -70,17 +70,33 @@ afterdepend: .if !target(tags) .if defined(SRCS) -tags: ${SRCS} +tags: ${SRCS} _SUBDIR -cd ${.CURDIR}; ctags -f /dev/stdout ${.ALLSRC:N*.h} | \ sed "s;\${.CURDIR}/;;" > tags .else -tags: +tags: _SUBDIR .endif .endif .if defined(SRCS) -clean: -cleandir: cleandepend -cleandepend: - rm -f ${DEPENDFILE} ${.CURDIR}/tags +.if !target(clean) +clean: _SUBDIR +.endif +.if !target(cleandepend) +cleandepend: _SUBDIR + rm -f ${DEPENDFILE} tags +.endif +.endif + +_SUBDIR: .USE +.if defined(SUBDIR) && !empty(SUBDIR) + @for entry in ${SUBDIR}; do \ + (${ECHODIR} "===> ${DIRPRFX}$$entry"; \ + if test -d ${.CURDIR}/$${entry}.${MACHINE}; then \ + cd ${.CURDIR}/$${entry}.${MACHINE}; \ + else \ + cd ${.CURDIR}/$${entry}; \ + fi; \ + ${MAKE} ${.TARGET:S/realinstall/install/:S/.depend/depend/} DIRPRFX=${DIRPRFX}$$entry/); \ + done .endif diff --git a/share/mk/bsd.doc.mk b/share/mk/bsd.doc.mk index 2d460f557ddc..833b821cdea7 100644 --- a/share/mk/bsd.doc.mk +++ b/share/mk/bsd.doc.mk @@ -1,5 +1,5 @@ # from: @(#)bsd.doc.mk 5.3 (Berkeley) 1/2/91 -# $Id: bsd.doc.mk,v 1.23 1995/11/29 16:05:08 bde Exp $ +# $Id: bsd.doc.mk,v 1.24 1996/03/09 23:48:53 wosch Exp $ PRINTER?= ascii @@ -70,29 +70,10 @@ print: ${DFILE} .endif .endif -.if !target(obj) -.if defined(NOOBJ) -obj: -.else -obj: - @cd ${.CURDIR}; rm -f obj; \ - here=`pwd`; dest=/usr/obj`echo $$here | sed 's,^/usr/src,,'`; \ - ${ECHO} "$$here -> $$dest"; ln -s $$dest obj; \ - if test -d /usr/obj -a ! -d $$dest; then \ - mkdir -p $$dest; \ - else \ - true; \ - fi; -.endif -.endif - clean: rm -f ${DOC}.${PRINTER} ${DOC}.ps ${DOC}.ascii \ ${DOC}.ps.gz ${DOC}.ascii.gz Errs errs mklog ${CLEANFILES} -cleandir: clean - cd ${.CURDIR}; rm -rf obj - FILES?= ${SRCS} realinstall: @if [ ! -d "${DESTDIR}${BINDIR}/${VOLUME}" ]; then \ @@ -151,10 +132,11 @@ ${DFILE}: ${DOC}.${PRINTER} .if !target(depend) depend: - .endif .if !target(maninstall) maninstall: - .endif + +.include <bsd.dep.mk> +.include <bsd.obj.mk> diff --git a/share/mk/bsd.info.mk b/share/mk/bsd.info.mk index 9b4f0a3c7782..a6b032461f8e 100644 --- a/share/mk/bsd.info.mk +++ b/share/mk/bsd.info.mk @@ -1,4 +1,4 @@ -# $Id: bsd.info.mk,v 1.16 1996/02/08 18:27:07 mpp Exp $ +# $Id: bsd.info.mk,v 1.17 1996/03/07 23:39:45 wosch Exp $ BINMODE= 444 BINDIR?= /usr/share/info @@ -17,10 +17,10 @@ MAKEINFOFLAGS+= --no-split # simplify some things, e.g., compression .if !defined(NOINFOCOMPRESS) IFILES= ${INFO:S/$/.info.gz/g} -all: ${IFILES} +all: ${IFILES} _SUBDIR .else IFILES= ${INFO:S/$/.info/g} -all: ${IFILES} +all: ${IFILES} _SUBDIR .endif GZIPCMD?= gzip @@ -37,7 +37,7 @@ DISTRIBUTION= info .endif .if !target(distribute) -distribute: +distribute: _SUBDIR cd ${.CURDIR} ; $(MAKE) install DESTDIR=${DISTDIR}/${DISTRIBUTION} SHARED=copies .endif @@ -46,32 +46,13 @@ ${INFO}.info: ${SRCS} ${MAKEINFO} ${MAKEINFOFLAGS} -I ${.CURDIR} ${SRCS:S/^/${.CURDIR}\//g} -o ${INFO}.info .endif -depend: +depend: _SUBDIR @echo -n -.if !target(obj) -.if defined(NOOBJ) -obj: -.else -obj: - @cd ${.CURDIR}; rm -f obj; \ - here=`pwd`; dest=/usr/obj`echo $$here | sed 's,^/usr/src,,'`; \ - ${ECHO} "$$here -> $$dest"; ln -s $$dest obj; \ - if test -d /usr/obj -a ! -d $$dest; then \ - mkdir -p $$dest; \ - else \ - true; \ - fi; -.endif -.endif - -clean: +clean: _SUBDIR rm -f ${INFO:S/$/.info*/g} Errs errs mklog ${CLEANFILES} -cleandir: clean - cd ${.CURDIR}; rm -rf obj - -install: +install: _SUBDIR @if [ ! -d "${DESTDIR}${BINDIR}" ]; then \ /bin/rm -f ${DESTDIR}${BINDIR} ; \ mkdir -p ${DESTDIR}${BINDIR} ; \ @@ -84,6 +65,8 @@ install: ${IFILES} ${DESTDIR}${BINDIR} .if !target(maninstall) -maninstall: - +maninstall: _SUBDIR .endif + +.include <bsd.dep.mk> +.include <bsd.obj.mk> diff --git a/share/mk/bsd.kmod.mk b/share/mk/bsd.kmod.mk index dde7ea09ecd8..258b8858b2e5 100644 --- a/share/mk/bsd.kmod.mk +++ b/share/mk/bsd.kmod.mk @@ -1,5 +1,5 @@ # From: @(#)bsd.prog.mk 5.26 (Berkeley) 6/25/91 -# $Id: bsd.kmod.mk,v 1.21 1996/05/25 23:09:47 wosch Exp $ +# $Id: bsd.kmod.mk,v 1.22 1996/06/17 15:11:10 bde Exp $ # # The include file <bsd.kmod.mk> handles installing Loadable Kernel Modules. # <bsd.kmod.mk> includes the file named "../Makefile.inc" if it exists, @@ -134,25 +134,12 @@ MAN1= ${KMOD}.4 .endif .elif !target(maninstall) -maninstall: +maninstall: _SUBDIR all-man: .endif -_PROGSUBDIR: .USE -.if defined(SUBDIR) && !empty(SUBDIR) - @for entry in ${SUBDIR}; do \ - (${ECHODIR} "===> $$entry"; \ - if test -d ${.CURDIR}/$${entry}.${MACHINE}; then \ - cd ${.CURDIR}/$${entry}.${MACHINE}; \ - else \ - cd ${.CURDIR}/$${entry}; \ - fi; \ - ${MAKE} ${.TARGET:S/realinstall/install/:S/.depend/depend/}); \ - done -.endif - .MAIN: all -all: ${PROG} all-man _PROGSUBDIR +all: ${PROG} all-man _SUBDIR CLEANFILES+=${PROG} ${OBJS} @@ -164,7 +151,7 @@ beforeinstall: afterinstall: .endif -realinstall: _PROGSUBDIR +realinstall: _SUBDIR ${INSTALL} ${COPY} -o ${KMODOWN} -g ${KMODGRP} -m ${KMODMODE} \ ${INSTALLFLAGS} ${PROG} ${DESTDIR}${KMODDIR} .if defined(LINKS) && !empty(LINKS) @@ -180,7 +167,7 @@ realinstall: _PROGSUBDIR done; true .endif -install: afterinstall +install: afterinstall _SUBDIR .if !defined(NOMAN) afterinstall: realinstall maninstall .else @@ -191,12 +178,12 @@ realinstall: beforeinstall DISTRIBUTION?= bin .if !target(distribute) -distribute: +distribute: _SUBDIR cd ${.CURDIR} ; $(MAKE) install DESTDIR=${DISTDIR}/${DISTRIBUTION} SHARED=copies .endif .if !target(tags) -tags: ${SRCS} _PROGSUBDIR +tags: ${SRCS} _SUBDIR .if defined(PROG) -cd ${.CURDIR}; ctags -f /dev/stdout ${.ALLSRC} | \ sed "s;\${.CURDIR}/;;" > tags @@ -221,8 +208,5 @@ vnode_if.h: ${KERN}/vnode_if.sh ${KERN}/vnode_if.src ./vnode_if.h: vnode_if.h -_DEPSUBDIR= _PROGSUBDIR -_SUBDIRUSE: _PROGSUBDIR -.include <bsd.obj.mk> .include <bsd.dep.mk> - +.include <bsd.obj.mk> diff --git a/share/mk/bsd.lib.mk b/share/mk/bsd.lib.mk index 7fd8d070faf5..1df5d8c89eca 100644 --- a/share/mk/bsd.lib.mk +++ b/share/mk/bsd.lib.mk @@ -1,5 +1,5 @@ # from: @(#)bsd.lib.mk 5.26 (Berkeley) 5/2/91 -# $Id: bsd.lib.mk,v 1.34 1996/06/03 13:23:31 jfieber Exp $ +# $Id: bsd.lib.mk,v 1.35 1996/06/17 15:59:51 phk Exp $ # .if exists(${.CURDIR}/../Makefile.inc) @@ -124,20 +124,7 @@ _LIBS+=lib${LIB}_pic.a PICFLAG=-fpic .endif -_LIBSUBDIR: .USE -.if defined(SUBDIR) && !empty(SUBDIR) - @for entry in ${SUBDIR}; do \ - (${ECHODIR} "===> ${DIRPRFX}$$entry"; \ - if test -d ${.CURDIR}/$${entry}.${MACHINE}; then \ - cd ${.CURDIR}/$${entry}.${MACHINE}; \ - else \ - cd ${.CURDIR}/$${entry}; \ - fi; \ - ${MAKE} ${.TARGET:S/realinstall/install/:S/.depend/depend/} DIRPRFX=${DIRPRFX}$$entry/); \ - done -.endif - -all: ${_LIBS} all-man _LIBSUBDIR # llib-l${LIB}.ln +all: ${_LIBS} all-man _SUBDIR # llib-l${LIB}.ln OBJS+= ${SRCS:N*.h:R:S/$/.o/g} @@ -184,29 +171,15 @@ llib-l${LIB}.ln: ${SRCS} ${LINT} -C${LIB} ${CFLAGS} ${.ALLSRC:M*.c} .if !target(clean) -clean: _LIBSUBDIR - rm -f a.out Errs errs mklog ${CLEANFILES} ${OBJS} - rm -f lib${LIB}.a llib-l${LIB}.ln - rm -f ${POBJS} profiled/*.o lib${LIB}_p.a - rm -f ${SOBJS} shared/*.o - rm -f lib${LIB}.so.*.* lib${LIB}_pic.a -.if defined(CLEANDIRS) - rm -rf ${CLEANDIRS} -.endif -.endif - -.if !target(cleandir) -cleandir: _LIBSUBDIR +clean: _SUBDIR rm -f a.out Errs errs mklog ${CLEANFILES} ${OBJS} rm -f lib${LIB}.a llib-l${LIB}.ln - rm -f ${.CURDIR}/tags .depend rm -f ${POBJS} profiled/*.o lib${LIB}_p.a rm -f ${SOBJS} shared/*.o rm -f lib${LIB}.so.*.* lib${LIB}_pic.a .if defined(CLEANDIRS) rm -rf ${CLEANDIRS} .endif - cd ${.CURDIR}; rm -rf obj; .endif .if defined(SRCS) @@ -259,7 +232,7 @@ realinstall: beforeinstall done; true .endif -install: afterinstall _LIBSUBDIR +install: afterinstall _SUBDIR .if !defined(NOMAN) afterinstall: realinstall maninstall .else @@ -269,7 +242,7 @@ afterinstall: realinstall DISTRIBUTION?= bin .if !target(distribute) -distribute: _LIBSUBDIR +distribute: _SUBDIR cd ${.CURDIR} ; $(MAKE) install DESTDIR=${DISTDIR}/${DISTRIBUTION} SHARED=copies .endif @@ -278,7 +251,7 @@ lint: .endif .if !target(tags) -tags: ${SRCS} +tags: ${SRCS} _SUBDIR -cd ${.CURDIR}; ctags -f /dev/stdout ${.ALLSRC:M*.c} | \ sed "s;\${.CURDIR}/;;" > tags .endif @@ -290,21 +263,5 @@ maninstall: all-man: .endif -.if !target(obj) -.if defined(NOOBJ) -obj: _LIBSUBDIR -.else -obj: _LIBSUBDIR - @cd ${.CURDIR}; rm -rf obj; \ - here=`pwd`; dest=/usr/obj`echo $$here | sed 's,^/usr/src,,'`; \ - ${ECHO} "$$here -> $$dest"; ln -s $$dest obj; \ - if test -d /usr/obj -a ! -d $$dest; then \ - mkdir -p $$dest; \ - else \ - true; \ - fi; -.endif -.endif - -_DEPSUBDIR= _LIBSUBDIR .include <bsd.dep.mk> +.include <bsd.obj.mk> diff --git a/share/mk/bsd.obj.mk b/share/mk/bsd.obj.mk index 200434cb5851..1612344d4d4a 100644 --- a/share/mk/bsd.obj.mk +++ b/share/mk/bsd.obj.mk @@ -1,4 +1,4 @@ -# $Id: bsd.obj.mk,v 1.3 1996/04/22 23:31:39 wosch Exp $ +# $Id: bsd.obj.mk,v 1.4 1996/05/27 23:05:54 wosch Exp $ # # The include file <bsd.obj.mk> handles creating 'obj' directory # and cleaning up object files, log files etc. @@ -6,26 +6,19 @@ # # +++ 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] -# # CLEANFILES Additional files to remove for the clean and cleandir targets. # -# MAKEOBJDIR A file name to the directory where the targets -# are built. Note: MAKEOBJDIR is an *enviroment* variable +# MAKEOBJDIR Specify somewhere other than /usr/obj to root the object +# tree. Note: MAKEOBJDIR is an *enviroment* variable # and does work proper only if set as enviroment variable, # not as global or command line variable! [obj] # -# E.g. use `env MAKEOBJDIR=obj-amd make' -# -# NOOBJ Do not create 'obj' directory if defined. [not set] +# E.g. use `env MAKEOBJDIR=/somewhere/obj make' # -# NOOBJLINK Create 'obj' directory in current directory instead -# a symbolic link to the 'obj' tree if defined. [not set] +# NOOBJ Do not create build directory in object tree. # +# OBJLINK Create a symbolic link from ${.TARGETOBJDIR} to ${.CURDIR}/obj +# Note: This BREAKS the read-only src tree rule! # # +++ targets +++ # @@ -33,67 +26,77 @@ # 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. +# remove the build directory (and all its contents) created by obj # # obj: -# create 'obj' directory. +# create build directory. # -.if defined(MAKEOBJDIR) && !empty(MAKEOBJDIR) -__objdir = ${MAKEOBJDIR} -.else - -.if defined(MACHINE) && !empty(MACHINE) -__objdir = obj # obj.${MACHINE} -.else -__objdir = obj -.endif -.endif - - .if !target(obj) .if defined(NOOBJ) obj: .else - -obj: _SUBDIRUSE cleanobj -.if defined(NOOBJLINK) - mkdir ${.CURDIR}/${__objdir} +.if !defined(OBJLINK) +obj: _SUBDIR + @if ! test -d ${.TARGETOBJDIR}; then \ + mkdir -p ${.TARGETOBJDIR}; \ + if ! test -d ${.TARGETOBJDIR}; then \ + ${ECHO} "Unable to create ${.TARGETOBJDIR}."; \ + exit 1; \ + fi; \ + ${ECHO} "${.TARGETOBJDIR} created for ${.CURDIR}"; \ + fi .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."; \ +obj: _SUBDIR + @if ! test -d ${.TARGETOBJDIR}; then \ + mkdir -p ${.TARGETOBJDIR}; \ + if ! test -d ${.TARGETOBJDIR}; then \ + ${ECHO} "Unable to create ${.TARGETOBJDIR}."; \ + exit 1; \ + fi; \ + ln -fs ${.TARGETOBJDIR} ${.CURDIR}/obj; \ + ${ECHO} "${.CURDIR} -> ${.TARGETOBJDIR}"; \ fi .endif .endif .endif +.if !target(objlink) +objlink: _SUBDIR + @if test -d ${.TARGETOBJDIR}; then \ + ln -fs ${.TARGETOBJDIR} ${.CURDIR}/obj; \ + else \ + echo "No ${.TARGETOBJDIR} to link to - do a make obj."; \ + fi +.endif + # # cleanup # -cleanobj: - rm -f -r ${.CURDIR}/${__objdir} +cleanobj: + @if [ -d ${.TARGETOBJDIR} ]; then \ + rm -rf ${.TARGETOBJDIR}; \ + else \ + cd ${.CURDIR} && ${MAKE} clean cleandepend; \ + fi +.if defined(OBJLINK) + @if [ -h ${.CURDIR}/obj ]; then rm -f ${.CURDIR}/obj; fi +.endif +.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: _SUBDIRUSE cleanfiles +clean: cleanfiles _SUBDIR .endif -cleandir: _SUBDIRUSE cleanfiles cleandepend cleanobj +cleandir: cleanobj _SUBDIR diff --git a/share/mk/bsd.own.mk b/share/mk/bsd.own.mk index a33b87614a00..de022f5fdd41 100644 --- a/share/mk/bsd.own.mk +++ b/share/mk/bsd.own.mk @@ -1,4 +1,4 @@ -# $Id: bsd.own.mk,v 1.5 1996/03/31 23:15:17 wosch Exp $ +# $Id: bsd.own.mk,v 1.6 1996/05/25 23:09:49 wosch Exp $ # # The include file <bsd.own.mk> set common variables for owner, # group, mode, and directories. Defaults are in brackets. @@ -6,16 +6,6 @@ # # +++ variables +++ # -# where the system object and source trees are kept; can be configurable -# by the user in case they want them in ~/foosrc and ~/fooobj, for example -# where the system object and source trees are kept; can be configurable -# by the user in case they want them in ~/foosrc and ~/fooobj, for example -# BSDOBJDIR The real path to the system 'obj' tree, so that 'make obj' -# will work correctly. [/usr/obj] -# -# BSDSRCDIR The real path to the system sources, so that 'make obj' -# will work correctly. [/usr/src] -# # DESTDIR Change the tree where the file gets installed. [not set] # # DISTDIR Change the tree where the file for a distribution @@ -117,10 +107,6 @@ # -BSDSRCDIR?= /usr/src -BSDOBJDIR?= /usr/obj - - # Binaries BINOWN?= bin BINGRP?= bin diff --git a/share/mk/bsd.port.mk b/share/mk/bsd.port.mk index dd18305fe44a..c5d228114af2 100644 --- a/share/mk/bsd.port.mk +++ b/share/mk/bsd.port.mk @@ -3,7 +3,7 @@ # bsd.port.mk - 940820 Jordan K. Hubbard. # This file is in the public domain. # -# $Id: bsd.port.mk,v 1.212 1996/06/20 23:52:45 jkh Exp $ +# $Id: bsd.port.mk,v 1.213 1996/06/22 21:20:56 gpalmer Exp $ # # Please view me with 4 column tabs! @@ -210,8 +210,8 @@ # Support for an encapsulation in /usr/src - these are essentially simplied ports # and have a number of defaults we can presume right off the bat. .if defined(SRC_ENCAPSULATION) -.if exists (${.CURDIR}/obj) -WRKDIR=${.CURDIR}/obj +.if exists (${BSDOBJDIR}/${.CURDIR}) +WRKDIR=${BSDOBJDIR}/${.CURDIR} .else NO_WRKDIR= yes .endif @@ -226,28 +226,7 @@ describe: # Finally, give us working obj and cleandir targets to make us more compatible # with "traditional" /usr/src ports. -.if !target(obj) -.if defined(NOOBJ) -obj: - @${DO_NADA} -.else -obj: - @cd ${.CURDIR}; rm -rf obj; here=`pwd`; \ - dest=/usr/obj`echo $$here | sed 's,^/usr/src,,'`; ${ECHO} "$$here -> $$dest"; \ - ln -s $$dest obj; if test -d /usr/obj -a ! -d $$dest; then mkdir -p $$dest; fi -.endif -.endif - -.if !target(cleandir) -.if defined(NOCLEANDIR) -cleandir: - @${DO_NADA} -.else -cleandir: clean - @if [ "${WRKDIR}" != "${.CURDIR}" ]; then ${RM} -rf ${WRKDIR}/; fi - @rm -f ${.CURDIR}/obj -.endif -.endif +.include <bsd.obj.mk> .if !target(distribute) distribute: @@ -1002,7 +981,7 @@ pre-clean: .if !target(clean) clean: pre-clean @${ECHO_MSG} "===> Cleaning for ${PKGNAME}" -.if !defined(NO_WRKDIR) && !exists(${.CURDIR}/obj) +.if !defined(NO_WRKDIR) @${RM} -rf ${WRKDIR} .else @${RM} -f ${WRKDIR}/.*_done diff --git a/share/mk/bsd.prog.mk b/share/mk/bsd.prog.mk index c14c57c7f6d2..a8275a0017cf 100644 --- a/share/mk/bsd.prog.mk +++ b/share/mk/bsd.prog.mk @@ -1,5 +1,5 @@ # from: @(#)bsd.prog.mk 5.26 (Berkeley) 6/25/91 -# $Id: bsd.prog.mk,v 1.32 1996/06/17 15:59:52 phk Exp $ +# $Id: bsd.prog.mk,v 1.33 1996/06/22 06:01:57 phk Exp $ .if exists(${.CURDIR}/../Makefile.inc) .include "${.CURDIR}/../Makefile.inc" @@ -130,53 +130,27 @@ MAN1= ${PROG}.1 .endif .endif -_PROGSUBDIR: .USE -.if defined(SUBDIR) && !empty(SUBDIR) - @for entry in ${SUBDIR}; do \ - (${ECHODIR} "===> ${DIRPRFX}$$entry"; \ - if test -d ${.CURDIR}/$${entry}.${MACHINE}; then \ - cd ${.CURDIR}/$${entry}.${MACHINE}; \ - else \ - cd ${.CURDIR}/$${entry}; \ - fi; \ - ${MAKE} ${.TARGET:S/realinstall/install/:S/.depend/depend/} DIRPRFX=${DIRPRFX}$$entry/); \ - done -.endif - # XXX I think MANDEPEND is only used for groff. It should be named more # generally and perhaps not be in the maninstall dependencies now it is # here (or does maninstall always work when nothing is made?), .MAIN: all -all: ${PROG} all-man _PROGSUBDIR +all: ${PROG} all-man _SUBDIR .if !target(clean) -clean: _PROGSUBDIR +clean: _SUBDIR rm -f a.out Errs errs mklog ${PROG} ${OBJS} ${CLEANFILES} .if defined(CLEANDIRS) rm -rf ${CLEANDIRS} .endif .endif -.if !target(cleandir) -cleandir: _PROGSUBDIR - rm -f a.out Errs errs mklog ${PROG} ${OBJS} ${CLEANFILES} - rm -f ${.CURDIR}/tags .depend -.if defined(CLEANDIRS) - rm -rf ${CLEANDIRS} -.endif - cd ${.CURDIR}; rm -rf obj; -.endif - .if !target(install) .if !target(beforeinstall) beforeinstall: .endif -.if !target(afterinstall) -afterinstall: -.endif -realinstall: _PROGSUBDIR +realinstall: beforeinstall .if defined(PROG) ${INSTALL} ${COPY} ${STRIP} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} \ ${INSTALLFLAGS} ${PROG} ${DESTDIR}${BINDIR} @@ -198,46 +172,29 @@ realinstall: _PROGSUBDIR done; true .endif -install: afterinstall +install: afterinstall _SUBDIR .if !defined(NOMAN) afterinstall: realinstall maninstall .else afterinstall: realinstall .endif -realinstall: beforeinstall .endif DISTRIBUTION?= bin .if !target(distribute) -distribute: +distribute: _SUBDIR cd ${.CURDIR} ; $(MAKE) install DESTDIR=${DISTDIR}/${DISTRIBUTION} SHARED=copies .endif .if !target(lint) -lint: ${SRCS} _PROGSUBDIR +lint: ${SRCS} _SUBDIR .if defined(PROG) @${LINT} ${LINTFLAGS} ${CFLAGS} ${.ALLSRC} | more 2>&1 .endif .endif -.if !target(obj) -.if defined(NOOBJ) -obj: _PROGSUBDIR -.else -obj: _PROGSUBDIR - @cd ${.CURDIR}; rm -rf obj; \ - here=`pwd`; dest=/usr/obj`echo $$here | sed 's,^/usr/src,,'`; \ - ${ECHO} "$$here -> $$dest"; ln -s $$dest obj; \ - if test -d /usr/obj -a ! -d $$dest; then \ - mkdir -p $$dest; \ - else \ - true; \ - fi; -.endif -.endif - .if !target(tags) -tags: ${SRCS} _PROGSUBDIR +tags: ${SRCS} _SUBDIR .if defined(PROG) -cd ${.CURDIR}; ctags -f /dev/stdout ${.ALLSRC} | \ sed "s;\${.CURDIR}/;;" > tags @@ -251,5 +208,5 @@ maninstall: all-man: .endif -_DEPSUBDIR= _PROGSUBDIR .include <bsd.dep.mk> +.include <bsd.obj.mk> diff --git a/share/mk/bsd.sgml.mk b/share/mk/bsd.sgml.mk index db32879f9608..e8e845d2fd00 100644 --- a/share/mk/bsd.sgml.mk +++ b/share/mk/bsd.sgml.mk @@ -1,7 +1,7 @@ # bsd.sgml.mk - 8 Sep 1995 John Fieber # This file is in the public domain. # -# $Id: bsd.sgml.mk,v 1.7 1996/04/29 15:59:01 wosch Exp $ +# $Id: bsd.sgml.mk,v 1.5 1996/05/27 23:12:15 wosch Exp $ # # The include file <bsd.sgml.mk> handles installing sgml documents. # <bsd.prog.mk> includes the file named "../Makefile.inc" if it exists, @@ -81,7 +81,6 @@ realinstall: ${FORMATS:S/^/install-/g} .if !target(print) print: ${FORMATS:S/^/print-/g} - .endif spell: ${SRCS} @@ -146,10 +145,11 @@ CLEANFILES+= ${DOC}.${_FORMAT} .endfor -.for __target in beforeinstall afterinstall maninstall depend _SUBDIRUSE +.for __target in beforeinstall afterinstall maninstall depend _SUBDIR .if !target(__target) ${__target}: .endif .endfor +.include <bsd.dep.mk> .include <bsd.obj.mk> |