Improve readability and reduce redundant redundancy in share/mk; add some
descriptive comments. The guts of hostprog, lib, and prog are mostly unchanged; this will be done in another pass. Make several things work properly with UNPRIVILEGED set, and make the install-time "cmp" logic work for MANZ. Also reimplement INCS{DIR,NAME}_foo (requested by wiz) in a backwards compatible way. Reviewed by christos.
This commit is contained in:
parent
153d16f7b1
commit
1129ed4afe
@ -1,4 +1,4 @@
|
||||
# $NetBSD: mi,v 1.391 2001/10/24 09:01:47 enami Exp $
|
||||
# $NetBSD: mi,v 1.392 2001/11/02 05:21:47 tv Exp $
|
||||
./sys comp-sysutil-root
|
||||
./usr/bin/addr2line comp-debug-bin
|
||||
./usr/bin/ar comp-util-bin
|
||||
@ -5684,12 +5684,12 @@
|
||||
./usr/share/misc/style comp-c-share
|
||||
./usr/share/mk/bsd.README comp-util-share
|
||||
./usr/share/mk/bsd.dep.mk comp-util-share
|
||||
./usr/share/mk/bsd.depall.mk comp-util-share
|
||||
./usr/share/mk/bsd.doc.mk comp-util-share
|
||||
./usr/share/mk/bsd.files.mk comp-util-share
|
||||
./usr/share/mk/bsd.hostprog.mk comp-util-share
|
||||
./usr/share/mk/bsd.inc.mk comp-util-share
|
||||
./usr/share/mk/bsd.info.mk comp-util-share
|
||||
./usr/share/mk/bsd.init.mk comp-util-share
|
||||
./usr/share/mk/bsd.kernobj.mk comp-util-share
|
||||
./usr/share/mk/bsd.kinc.mk comp-util-share
|
||||
./usr/share/mk/bsd.kmod.mk comp-util-share
|
||||
|
@ -1,4 +1,4 @@
|
||||
# $NetBSD: obsolete.mi,v 1.57 2001/10/31 19:57:18 gmcgarry Exp $
|
||||
# $NetBSD: obsolete.mi,v 1.58 2001/11/02 05:21:48 tv Exp $
|
||||
/usr/bin/genclass
|
||||
/usr/bin/gettextize
|
||||
/usr/include/bfd
|
||||
@ -780,5 +780,6 @@
|
||||
/usr/share/misc/gprof.callg
|
||||
/usr/share/misc/gprof.flat
|
||||
/usr/share/mk/bsd.crypto.mk
|
||||
/usr/share/mk/bsd.depall.mk
|
||||
/usr/share/mk/bsd.port.mk
|
||||
/usr/share/mk/bsd.port.subdir.mk
|
||||
|
@ -1,11 +1,11 @@
|
||||
# $NetBSD: Makefile,v 1.29 2000/06/20 06:00:35 thorpej Exp $
|
||||
# $NetBSD: Makefile,v 1.30 2001/11/02 05:21:49 tv Exp $
|
||||
# @(#)Makefile 8.1 (Berkeley) 6/8/93
|
||||
|
||||
.include <bsd.own.mk>
|
||||
|
||||
.if ${MKSHARE} != "no"
|
||||
FILES= bsd.README bsd.doc.mk bsd.dep.mk bsd.depall.mk bsd.files.mk \
|
||||
bsd.hostprog.mk bsd.inc.mk bsd.info.mk bsd.kernobj.mk bsd.kinc.mk \
|
||||
FILES= bsd.README bsd.doc.mk bsd.dep.mk bsd.files.mk bsd.hostprog.mk \
|
||||
bsd.inc.mk bsd.info.mk bsd.init.mk bsd.kernobj.mk bsd.kinc.mk \
|
||||
bsd.kmod.mk bsd.lib.mk bsd.links.mk bsd.man.mk bsd.nls.mk \
|
||||
bsd.obj.mk bsd.own.mk bsd.prog.mk bsd.subdir.mk bsd.sys.mk sys.mk
|
||||
|
||||
|
@ -1,15 +1,21 @@
|
||||
# $NetBSD: bsd.dep.mk,v 1.32 2001/08/14 07:02:13 tv Exp $
|
||||
# $NetBSD: bsd.dep.mk,v 1.33 2001/11/02 05:21:49 tv Exp $
|
||||
|
||||
##### Basic targets
|
||||
.PHONY: cleandepend
|
||||
cleandir: cleandepend
|
||||
realdepend: beforedepend .depend afterdepend
|
||||
.ORDER: beforedepend .depend afterdepend
|
||||
|
||||
beforedepend .depend afterdepend: # ensure existence
|
||||
|
||||
##### Default values
|
||||
MKDEP?= mkdep
|
||||
|
||||
##### Build rules
|
||||
# some of the rules involve .h sources, so remove them from mkdep line
|
||||
realdepend: beforedepend
|
||||
|
||||
.if defined(SRCS)
|
||||
realdepend: .depend
|
||||
.NOPATH: .depend
|
||||
.NOPATH: .depend
|
||||
.depend: ${SRCS} ${DPSRCS}
|
||||
@rm -f .depend
|
||||
@files="${.ALLSRC:M*.s} ${.ALLSRC:M*.S}"; \
|
||||
@ -41,22 +47,19 @@ realdepend: .depend
|
||||
${MKDEP} -a ${MKDEPFLAGS} \
|
||||
${CXXFLAGS:M-[ID]*} ${CPPFLAGS} $$files; \
|
||||
fi
|
||||
cleandepend:
|
||||
rm -f .depend ${.CURDIR}/tags ${CLEANDEPEND}
|
||||
.else
|
||||
cleandepend:
|
||||
.endif
|
||||
realdepend: afterdepend
|
||||
.endif # defined(SRCS)
|
||||
|
||||
beforedepend:
|
||||
afterdepend:
|
||||
|
||||
.if !target(tags)
|
||||
##### Clean rules
|
||||
cleandepend:
|
||||
.if defined(SRCS)
|
||||
rm -f .depend ${.CURDIR}/tags ${CLEANDEPEND}
|
||||
.endif
|
||||
|
||||
##### Custom rules
|
||||
.if !target(tags)
|
||||
tags: ${SRCS}
|
||||
.if defined(SRCS)
|
||||
-cd ${.CURDIR}; ctags -f /dev/stdout ${.ALLSRC:N*.h} | \
|
||||
sed "s;\${.CURDIR}/;;" > tags
|
||||
.else
|
||||
tags:
|
||||
.endif
|
||||
.endif
|
||||
|
@ -1,5 +0,0 @@
|
||||
# $NetBSD: bsd.depall.mk,v 1.3 2001/05/14 03:20:10 sommerfeld Exp $
|
||||
|
||||
dependall: realdepend .MAKE
|
||||
@cd ${.CURDIR}; \
|
||||
${MAKE} realall
|
@ -1,21 +1,14 @@
|
||||
# $NetBSD: bsd.doc.mk,v 1.52 2001/08/14 10:38:27 tv Exp $
|
||||
# $NetBSD: bsd.doc.mk,v 1.53 2001/11/02 05:21:50 tv Exp $
|
||||
# @(#)bsd.doc.mk 8.1 (Berkeley) 8/14/93
|
||||
|
||||
.if !target(__initialized__)
|
||||
__initialized__:
|
||||
.if exists(${.CURDIR}/../Makefile.inc)
|
||||
.include "${.CURDIR}/../Makefile.inc"
|
||||
.endif
|
||||
.include <bsd.own.mk>
|
||||
.MAIN: all
|
||||
.endif
|
||||
.include <bsd.init.mk>
|
||||
|
||||
##### Basic targets
|
||||
.PHONY: cleandoc docinstall print spell
|
||||
.if ${MKSHARE} != "no"
|
||||
realinstall: docinstall
|
||||
.endif
|
||||
clean: cleandoc
|
||||
realinstall: docinstall
|
||||
|
||||
##### Default values
|
||||
BIB?= bib
|
||||
EQN?= eqn
|
||||
GREMLIN?= grn
|
||||
@ -27,58 +20,55 @@ ROFF?= groff -Tps
|
||||
SOELIM?= soelim
|
||||
TBL?= tbl
|
||||
|
||||
.if !target(all)
|
||||
.if ${MKSHARE} != "no"
|
||||
realall: paper.ps
|
||||
.else
|
||||
realall:
|
||||
.endif
|
||||
.endif
|
||||
|
||||
##### Build rules
|
||||
.if !target(paper.ps)
|
||||
paper.ps: ${SRCS}
|
||||
${ROFF} ${MACROS} ${PAGES} ${.ALLSRC} > ${.TARGET}
|
||||
.endif
|
||||
|
||||
.if ${MKSHARE} != "no"
|
||||
realall: paper.ps
|
||||
.endif
|
||||
|
||||
##### Install rules
|
||||
docinstall:: # ensure existence
|
||||
.if ${MKDOC} != "no"
|
||||
|
||||
__docinstall: .USE
|
||||
${INSTALL_FILE} -o ${DOCOWN} -g ${DOCGRP} -m ${DOCMODE} \
|
||||
${.ALLSRC} ${.TARGET}
|
||||
|
||||
FILES?= ${SRCS}
|
||||
|
||||
.for F in Makefile ${FILES:O:u} ${EXTRA}
|
||||
_F:= ${DESTDIR}${DOCDIR}/${DIR}/${F} # installed path
|
||||
|
||||
${_F}: ${F} __docinstall # install rule
|
||||
docinstall:: ${_F}
|
||||
.PRECIOUS: ${_F} # keep if install fails
|
||||
.PHONY: ${UPDATE:U${_F}} # clobber unless UPDATE
|
||||
.if !defined(BUILD) && !make(all) && !make(${F})
|
||||
${_F}: .MADE # no build at install
|
||||
.endif
|
||||
.endfor
|
||||
|
||||
.undef _F
|
||||
.endif # ${MKDOC} != "no"
|
||||
|
||||
##### Clean rules
|
||||
cleandoc:
|
||||
rm -f paper.* [eE]rrs mklog ${CLEANFILES}
|
||||
|
||||
##### Custom rules
|
||||
.if !target(print)
|
||||
print: paper.ps
|
||||
lpr -P${PRINTER} ${.ALLSRC}
|
||||
.endif
|
||||
|
||||
cleandoc:
|
||||
rm -f paper.* [eE]rrs mklog ${CLEANFILES}
|
||||
|
||||
.if ${MKDOC} != "no"
|
||||
FILES?=${SRCS}
|
||||
ALLFILES=Makefile ${FILES} ${EXTRA}
|
||||
|
||||
docinstall:: ${ALLFILES:@F@${DESTDIR}${DOCDIR}/${DIR}/${F}@}
|
||||
.PRECIOUS: ${ALLFILES:@F@${DESTDIR}${DOCDIR}/${DIR}/${F}@}
|
||||
.if !defined(UPDATE)
|
||||
.PHONY: ${ALLFILES:@F@${DESTDIR}${DOCDIR}/${DIR}/${F}@}
|
||||
.endif
|
||||
|
||||
__docinstall: .USE
|
||||
${INSTALL} ${RENAME} ${PRESERVE} ${INSTPRIV} -c -o ${DOCOWN} \
|
||||
-g ${DOCGRP} -m ${DOCMODE} ${.ALLSRC} ${.TARGET}
|
||||
|
||||
.for F in ${ALLFILES:O:u}
|
||||
.if !defined(BUILD) && !make(all) && !make(${F})
|
||||
${DESTDIR}${DOCDIR}/${DIR}/${F}: .MADE
|
||||
.endif
|
||||
${DESTDIR}${DOCDIR}/${DIR}/${F}: ${F} __docinstall
|
||||
.endfor
|
||||
.endif
|
||||
|
||||
.if !target(docinstall)
|
||||
docinstall::
|
||||
.endif
|
||||
|
||||
spell: ${SRCS}
|
||||
spell ${.ALLSRC} | sort | comm -23 - spell.ok > paper.spell
|
||||
|
||||
depend includes lint obj tags:
|
||||
|
||||
dependall: all
|
||||
|
||||
##### Pull in related .mk logic
|
||||
.include <bsd.obj.mk>
|
||||
|
||||
${TARGETS}: # ensure existence
|
||||
|
@ -1,40 +1,47 @@
|
||||
# $NetBSD: bsd.files.mk,v 1.15 2001/05/08 03:19:52 sommerfeld Exp $
|
||||
# $NetBSD: bsd.files.mk,v 1.16 2001/11/02 05:21:50 tv Exp $
|
||||
|
||||
.if !target(__fileinstall)
|
||||
# This file can be included multiple times. It clears the definition of
|
||||
# FILES at the end so that this is possible.
|
||||
|
||||
##### Basic targets
|
||||
.PHONY: filesinstall
|
||||
realinstall: filesinstall
|
||||
|
||||
.if defined(FILES) && !empty(FILES)
|
||||
FILESDIR?=${BINDIR}
|
||||
FILESOWN?=${BINOWN}
|
||||
FILESGRP?=${BINGRP}
|
||||
FILESMODE?=${NONBINMODE}
|
||||
##### Default values
|
||||
FILESDIR?= ${BINDIR}
|
||||
FILESOWN?= ${BINOWN}
|
||||
FILESGRP?= ${BINGRP}
|
||||
FILESMODE?= ${NONBINMODE}
|
||||
|
||||
filesinstall:: ${FILES:@F@${DESTDIR}${FILESDIR_${F}:U${FILESDIR}}/${FILESNAME_${F}:U${FILESNAME:U${F:T}}}@}
|
||||
.PRECIOUS: ${FILES:@F@${DESTDIR}${FILESDIR_${F}:U${FILESDIR}}/${FILESNAME_${F}:U${FILESNAME:U${F:T}}}@}
|
||||
.if !defined(UPDATE)
|
||||
.PHONY: ${FILES:@F@${DESTDIR}${FILESDIR_${F}:U${FILESDIR}}/${FILESNAME_${F}:U${FILESNAME:U${F:T}}}@}
|
||||
.endif
|
||||
##### Install rules
|
||||
filesinstall:: # ensure existence
|
||||
|
||||
__fileinstall: .USE
|
||||
${INSTALL} ${RENAME} ${PRESERVE} ${COPY} ${INSTPRIV} \
|
||||
${INSTALL_FILE} \
|
||||
-o ${FILESOWN_${.ALLSRC:T}:U${FILESOWN}} \
|
||||
-g ${FILESGRP_${.ALLSRC:T}:U${FILESGRP}} \
|
||||
-m ${FILESMODE_${.ALLSRC:T}:U${FILESMODE}} \
|
||||
${.ALLSRC} ${.TARGET}
|
||||
|
||||
.endif # !target(__fileinstall)
|
||||
|
||||
.for F in ${FILES:O:u}
|
||||
_FDIR:= ${FILESDIR_${F}:U${FILESDIR}} # dir override
|
||||
_FNAME:= ${FILESNAME_${F}:U${FILESNAME:U${F:T}}} # name override
|
||||
_F:= ${DESTDIR}${_FDIR}/${_FNAME} # installed path
|
||||
|
||||
${_F}: ${F} __fileinstall # install rule
|
||||
filesinstall:: ${_F}
|
||||
.PRECIOUS: ${_F} # keep if install fails
|
||||
.PHONY: ${UPDATE:U${_F}} # clobber unless UPDATE
|
||||
.if !defined(BUILD) && !make(all) && !make(${F})
|
||||
${DESTDIR}${FILESDIR_${F}:U${FILESDIR}}/${FILESNAME_${F}:U${FILESNAME:U${F:T}}}: .MADE
|
||||
${_F}: .MADE # no build at install
|
||||
.endif
|
||||
${DESTDIR}${FILESDIR_${F}:U${FILESDIR}}/${FILESNAME_${F}:U${FILESNAME:U${F:T}}}: ${F} __fileinstall
|
||||
.endfor
|
||||
.endif
|
||||
|
||||
.if !target(filesinstall)
|
||||
filesinstall::
|
||||
.endif
|
||||
.undef _FDIR
|
||||
.undef _FNAME
|
||||
.undef _F
|
||||
|
||||
FILES:=
|
||||
FILES:= # reset to empty
|
||||
|
@ -1,22 +1,13 @@
|
||||
# $NetBSD: bsd.hostprog.mk,v 1.16 2001/10/25 13:48:50 thorpej Exp $
|
||||
\# $NetBSD: bsd.hostprog.mk,v 1.17 2001/11/02 05:21:50 tv Exp $
|
||||
# @(#)bsd.prog.mk 8.2 (Berkeley) 4/2/94
|
||||
|
||||
.if !target(__initialized__)
|
||||
__initialized__:
|
||||
.if exists(${.CURDIR}/../Makefile.inc)
|
||||
.include "${.CURDIR}/../Makefile.inc"
|
||||
.endif
|
||||
.include <bsd.own.mk>
|
||||
.include <bsd.obj.mk>
|
||||
.include <bsd.depall.mk>
|
||||
.MAIN: all
|
||||
.endif
|
||||
.include <bsd.init.mk>
|
||||
|
||||
##### Basic targets
|
||||
.PHONY: cleanprog
|
||||
clean: cleanprog
|
||||
|
||||
CFLAGS+= ${COPTS}
|
||||
|
||||
##### Default values
|
||||
LIBBZ2?= /usr/lib/libbz2.a
|
||||
LIBC?= /usr/lib/libc.a
|
||||
LIBC_PIC?= /usr/lib/libc_pic.a
|
||||
@ -56,6 +47,9 @@ LIBWRAP?= /usr/lib/libwrap.a
|
||||
LIBY?= /usr/lib/liby.a
|
||||
LIBZ?= /usr/lib/libz.a
|
||||
|
||||
CFLAGS+= ${COPTS}
|
||||
|
||||
##### Build rules
|
||||
.if defined(SHAREDSTRINGS)
|
||||
CLEANFILES+=strings
|
||||
.c.lo:
|
||||
@ -123,6 +117,7 @@ lint: ${LOBJS}
|
||||
${LINT} ${LINTFLAGS} ${LDFLAGS:M-L*} ${LOBJS} ${LDADD}
|
||||
.endif
|
||||
|
||||
##### Pull in related .mk logic
|
||||
.include <bsd.man.mk>
|
||||
.include <bsd.nls.mk>
|
||||
.include <bsd.files.mk>
|
||||
@ -131,5 +126,4 @@ lint: ${LOBJS}
|
||||
.include <bsd.dep.mk>
|
||||
.include <bsd.sys.mk>
|
||||
|
||||
# Make sure all of the standard targets are defined, even if they do nothing.
|
||||
regress:
|
||||
${TARGETS}: # ensure existence
|
||||
|
@ -1,28 +1,31 @@
|
||||
# $NetBSD: bsd.inc.mk,v 1.19 2001/10/31 21:15:41 tv Exp $
|
||||
# $NetBSD: bsd.inc.mk,v 1.20 2001/11/02 05:21:50 tv Exp $
|
||||
|
||||
##### Basic targets
|
||||
.PHONY: incinstall
|
||||
includes: ${INCS} incinstall
|
||||
|
||||
.if defined(INCS)
|
||||
incinstall:: ${INCS:@I@${DESTDIR}${INCSDIR}/$I@}
|
||||
.PRECIOUS: ${INCS:@I@${DESTDIR}${INCSDIR}/$I@}
|
||||
.if !defined(UPDATE)
|
||||
.PHONY: ${INCS:@I@${DESTDIR}${INCSDIR}/$I@}
|
||||
.endif
|
||||
##### Install rules
|
||||
incinstall:: # ensure existence
|
||||
|
||||
# -c is forced on here, in order to preserve modtimes for "make depend"
|
||||
__incinstall: .USE
|
||||
@cmp -s ${.ALLSRC} ${.TARGET} > /dev/null 2>&1 || \
|
||||
(echo "${INSTALL} ${RENAME} ${PRESERVE} ${INSTPRIV} -c \
|
||||
-o ${BINOWN} -g ${BINGRP} -m ${NONBINMODE} ${.ALLSRC} \
|
||||
${.TARGET}" && \
|
||||
${INSTALL} ${RENAME} ${PRESERVE} ${INSTPRIV} -c -o ${BINOWN} \
|
||||
-g ${BINGRP} -m ${NONBINMODE} ${.ALLSRC} ${.TARGET})
|
||||
(echo "${INSTALL_FILE:N-c} -c -o ${BINOWN} -g ${BINGRP} \
|
||||
-m ${NONBINMODE} ${.ALLSRC} ${.TARGET}" && \
|
||||
${INSTALL_FILE:N-c} -c -o ${BINOWN} -g ${BINGRP} \
|
||||
-m ${NONBINMODE} ${.ALLSRC} ${.TARGET})
|
||||
|
||||
.for I in ${INCS:O:u}
|
||||
${DESTDIR}${INCSDIR}/$I: $I __incinstall
|
||||
.for F in ${INCS:O:u}
|
||||
_FDIR:= ${INCSDIR_${F:C,/,_,g}:U${INCSDIR}} # dir override
|
||||
_FNAME:= ${INCSNAME_${F:C,/,_,g}:U${INCSNAME:U${F}}} # name override
|
||||
_F:= ${DESTDIR}${_FDIR}/${_FNAME} # installed path
|
||||
|
||||
${_F}: ${F} __incinstall # install rule
|
||||
incinstall:: ${_F}
|
||||
.PRECIOUS: ${_F} # keep if install fails
|
||||
.PHONY: ${UPDATE:U${_F}} # clobber unless UPDATE
|
||||
.endfor
|
||||
.endif
|
||||
|
||||
.if !target(incinstall)
|
||||
incinstall::
|
||||
.endif
|
||||
.undef _FDIR
|
||||
.undef _FNAME
|
||||
.undef _F
|
||||
|
@ -1,64 +1,73 @@
|
||||
# $NetBSD: bsd.info.mk,v 1.22 2001/08/14 07:02:13 tv Exp $
|
||||
# $NetBSD: bsd.info.mk,v 1.23 2001/11/02 05:21:50 tv Exp $
|
||||
|
||||
.if !target(__initialized__)
|
||||
__initialized__:
|
||||
.if exists(${.CURDIR}/../Makefile.inc)
|
||||
.include "${.CURDIR}/../Makefile.inc"
|
||||
.endif
|
||||
.include <bsd.own.mk>
|
||||
.include <bsd.obj.mk>
|
||||
.include <bsd.depall.mk>
|
||||
.MAIN: all
|
||||
.endif
|
||||
|
||||
MAKEINFO?= makeinfo
|
||||
INFOFLAGS?=
|
||||
INSTALL_INFO?= install-info
|
||||
.include <bsd.init.mk>
|
||||
|
||||
##### Basic targets
|
||||
.PHONY: infoinstall cleaninfo
|
||||
cleandir: cleaninfo
|
||||
realinstall: infoinstall
|
||||
|
||||
##### Default values
|
||||
MAKEINFO?= makeinfo
|
||||
INFOFLAGS?=
|
||||
INSTALL_INFO?= install-info
|
||||
|
||||
INFOFILES?=
|
||||
|
||||
##### Build rules
|
||||
.if ${MKINFO} != "no"
|
||||
|
||||
INFOFILES= ${TEXINFO:C/\.te?xi(nfo)?$/.info/}
|
||||
|
||||
realall: ${INFOFILES}
|
||||
.NOPATH: ${INFOFILES}
|
||||
|
||||
.SUFFIXES: .txi .texi .texinfo .info
|
||||
|
||||
.txi.info .texi.info .texinfo.info:
|
||||
${MAKEINFO} ${INFOFLAGS} --no-split -o $@ $<
|
||||
|
||||
.if defined(TEXINFO) && !empty(TEXINFO)
|
||||
INFOFILES= ${TEXINFO:C/\.te?xi(nfo)?$/.info/}
|
||||
.NOPATH: ${INFOFILES}
|
||||
.endif # ${MKINFO} != "no"
|
||||
|
||||
##### Install rules
|
||||
infoinstall:: # ensure existence
|
||||
.if ${MKINFO} != "no"
|
||||
realinstall: infoinstall
|
||||
realall: ${INFOFILES}
|
||||
.endif
|
||||
|
||||
cleaninfo:
|
||||
rm -f ${INFOFILES}
|
||||
|
||||
infoinstall:: ${INFOFILES:@F@${DESTDIR}${INFODIR_${F}:U${INFODIR}}/${INFONAME_${F}:U${INFONAME:U${F:T}}}@}
|
||||
.PRECIOUS: ${INFOFILES:@F@${DESTDIR}${INFODIR_${F}:U${INFODIR}}/${INFONAME_${F}:U${INFONAME:U${F:T}}}@}
|
||||
.if !defined(UPDATE)
|
||||
.PHONY: ${INFOFILES:@F@${DESTDIR}${INFODIR_${F}:U${INFODIR}}/${INFONAME_${F}:U${INFONAME:U${F:T}}}@}
|
||||
.endif
|
||||
|
||||
__infoinstall: .USE
|
||||
${INSTALL} ${RENAME} ${PRESERVE} ${COPY} ${INSTPRIV} \
|
||||
${INSTALL_FILE} \
|
||||
-o ${INFOOWN_${.ALLSRC:T}:U${INFOOWN}} \
|
||||
-g ${INFOGRP_${.ALLSRC:T}:U${INFOGRP}} \
|
||||
-m ${INFOMODE_${.ALLSRC:T}:U${INFOMODE}} \
|
||||
${.ALLSRC} ${.TARGET}
|
||||
@${INSTALL_INFO} --remove --info-dir=${DESTDIR}${INFODIR} ${.TARGET}
|
||||
@${INSTALL_INFO} --remove --info-dir=${DESTDIR}${INFODIR} ${.TARGET} 2>/dev/null
|
||||
${INSTALL_INFO} --info-dir=${DESTDIR}${INFODIR} ${.TARGET}
|
||||
|
||||
.for F in ${INFOFILES:O:u}
|
||||
_FDIR:= ${INFODIR_${F}:U${INFODIR}} # dir overrides
|
||||
_FNAME:= ${INFONAME_${F}:U${INFONAME:U${F:T}}} # name overrides
|
||||
_F:= ${DESTDIR}${_FDIR}/${_FNAME} # installed path
|
||||
|
||||
${_F}: ${F} __infoinstall # install rule
|
||||
infoinstall:: ${_F}
|
||||
.PRECIOUS: ${_F} # keep if install fails
|
||||
.PHONY: ${UPDATE:U${_F}} # clobber unless UPDATE
|
||||
.if !defined(BUILD) && !make(all) && !make(${F})
|
||||
${DESTDIR}${INFODIR_${F}:U${INFODIR}}/${INFONAME_${F}:U${INFONAME:U${F:T}}}: .MADE
|
||||
${_F}: .MADE # no build at install
|
||||
.endif
|
||||
${DESTDIR}${INFODIR_${F}:U${INFODIR}}/${INFONAME_${F}:U${INFONAME:U${F:T}}}: ${F} __infoinstall
|
||||
.endfor
|
||||
.else
|
||||
|
||||
.undef _FDIR
|
||||
.undef _FNAME
|
||||
.undef _F
|
||||
.endif # ${MKINFO} != "no"
|
||||
|
||||
##### Clean rules
|
||||
cleaninfo:
|
||||
.if !empty(INFOFILES)
|
||||
rm -f ${INFOFILES}
|
||||
.endif
|
||||
|
||||
# Make sure all of the standard targets are defined, even if they do nothing.
|
||||
clean depend includes lint regress tags:
|
||||
##### Pull in related .mk logic
|
||||
.include <bsd.obj.mk>
|
||||
|
||||
${TARGETS}: # ensure existence
|
||||
|
11
share/mk/bsd.init.mk
Normal file
11
share/mk/bsd.init.mk
Normal file
@ -0,0 +1,11 @@
|
||||
# $NetBSD: bsd.init.mk,v 1.1 2001/11/02 05:21:50 tv Exp $
|
||||
|
||||
# <bsd.init.mk> includes Makefile.inc and <bsd.own.mk>; this is used at the
|
||||
# top of all <bsd.*.mk> files which actually "build something".
|
||||
|
||||
.if !target(__initialized__)
|
||||
__initialized__:
|
||||
.-include "${.CURDIR}/../Makefile.inc"
|
||||
.include <bsd.own.mk>
|
||||
.MAIN: all
|
||||
.endif
|
@ -1,4 +1,4 @@
|
||||
# $NetBSD: bsd.kinc.mk,v 1.18 2001/05/08 03:19:52 sommerfeld Exp $
|
||||
# $NetBSD: bsd.kinc.mk,v 1.19 2001/11/02 05:21:50 tv Exp $
|
||||
|
||||
# System configuration variables:
|
||||
#
|
||||
@ -29,15 +29,13 @@
|
||||
# directories.
|
||||
#
|
||||
|
||||
.if !target(__initialized__)
|
||||
__initialized__:
|
||||
.if exists(${.CURDIR}/../Makefile.inc)
|
||||
.include "${.CURDIR}/../Makefile.inc"
|
||||
.endif
|
||||
.include <bsd.own.mk>
|
||||
.MAIN: all
|
||||
.endif
|
||||
.include <bsd.init.mk>
|
||||
|
||||
##### Basic targets
|
||||
.PHONY: incinstall
|
||||
includes: ${INCS} incinstall
|
||||
|
||||
##### Default values
|
||||
# Change SYS_INCLUDE in bsd.own.mk or /etc/mk.conf to "symlinks" if you
|
||||
# don't want copies
|
||||
SYS_INCLUDE?= copies
|
||||
@ -47,84 +45,57 @@ SYS_INCLUDE?= copies
|
||||
SYS_INCLUDE= copies
|
||||
.endif
|
||||
|
||||
|
||||
.PHONY: incinstall
|
||||
includes: ${INCS} incinstall
|
||||
|
||||
##### Install rules
|
||||
incinstall:: # ensure existence
|
||||
|
||||
.if ${SYS_INCLUDE} == "symlinks"
|
||||
|
||||
# don't install includes, just make symlinks.
|
||||
|
||||
.if defined(KDIR)
|
||||
SYMLINKS+= ${KDIR} ${INCSDIR}
|
||||
.endif
|
||||
|
||||
.else # not symlinks
|
||||
.else # ${SYS_INCLUDE} != "symlinks"
|
||||
|
||||
# make sure the directory is OK, and install includes.
|
||||
|
||||
incinstall:: ${DESTDIR}${INCSDIR}
|
||||
.PRECIOUS: ${DESTDIR}${INCSDIR}
|
||||
.PHONY: ${DESTDIR}${INCSDIR}
|
||||
incinstall:: ${DESTDIR}${INCSDIR}
|
||||
.PRECIOUS: ${DESTDIR}${INCSDIR}
|
||||
.PHONY: ${DESTDIR}${INCSDIR}
|
||||
|
||||
${DESTDIR}${INCSDIR}:
|
||||
@if [ ! -d ${.TARGET} ] || [ -h ${.TARGET} ] ; then \
|
||||
echo creating ${.TARGET}; \
|
||||
/bin/rm -rf ${.TARGET}; \
|
||||
${INSTALL} ${INSTPRIV} -d -o ${BINOWN} -g ${BINGRP} -m 755 \
|
||||
${.TARGET}; \
|
||||
${INSTALL_DIR} -o ${BINOWN} -g ${BINGRP} -m 755 ${.TARGET}; \
|
||||
fi
|
||||
|
||||
.if defined(INCS)
|
||||
incinstall:: ${INCS:@I@${DESTDIR}${INCSDIR}/$I@}
|
||||
.PRECIOUS: ${INCS:@I@${DESTDIR}${INCSDIR}/$I@}
|
||||
.if !defined(UPDATE)
|
||||
.PHONY: ${INCS:@I@${DESTDIR}${INCSDIR}/$I@}
|
||||
.endif
|
||||
|
||||
# -c is forced on here, in order to preserve modtimes for "make depend"
|
||||
__incinstall: .USE
|
||||
@cmp -s ${.ALLSRC} ${.TARGET} > /dev/null 2>&1 || \
|
||||
(echo "${INSTALL} ${RENAME} ${PRESERVE} ${INSTPRIV} -c \
|
||||
-o ${BINOWN} -g ${BINGRP} -m ${NONBINMODE} ${.ALLSRC} \
|
||||
${.TARGET}" && \
|
||||
${INSTALL} ${RENAME} ${PRESERVE} ${INSTPRIV} -c -o ${BINOWN} \
|
||||
-g ${BINGRP} -m ${NONBINMODE} ${.ALLSRC} ${.TARGET})
|
||||
|
||||
.for I in ${INCS:O:u}
|
||||
${DESTDIR}${INCSDIR}/$I: $I __incinstall
|
||||
.endfor
|
||||
.endif
|
||||
|
||||
.if defined(DEPINCS)
|
||||
incinstall:: ${DEPINCS:@I@${DESTDIR}${INCSDIR}/$I@}
|
||||
.PRECIOUS: ${DEPINCS:@I@${DESTDIR}${INCSDIR}/$I@}
|
||||
.if !defined(UPDATE)
|
||||
.PHONY: ${DEPINCS:@I@${DESTDIR}${INCSDIR}/$I@}
|
||||
.endif
|
||||
|
||||
__depincinstall: .USE
|
||||
@cmp -s ${.ALLSRC} ${.TARGET} > /dev/null 2>&1 || \
|
||||
(echo "${INSTALL} ${RENAME} ${PRESERVE} -c -o ${BINOWN} \
|
||||
-g ${BINGRP} -m ${NONBINMODE} ${.ALLSRC} ${.TARGET}" && \
|
||||
${INSTALL} ${RENAME} ${PRESERVE} -c -o ${BINOWN} -g ${BINGRP} \
|
||||
(echo "${INSTALL_FILE:N-c} -c -o ${BINOWN} -g ${BINGRP} \
|
||||
-m ${NONBINMODE} ${.ALLSRC} ${.TARGET}" && \
|
||||
${INSTALL_FILE:N-c} -c -o ${BINOWN} -g ${BINGRP} \
|
||||
-m ${NONBINMODE} ${.ALLSRC} ${.TARGET})
|
||||
|
||||
.for I in ${DEPINCS:O:u}
|
||||
${DESTDIR}${INCSDIR}/$I: $I __depincinstall
|
||||
.endfor
|
||||
.endif
|
||||
.for F in ${INCS:O:u} ${DEPINCS:O:u}
|
||||
_F:= ${DESTDIR}${INCSDIR}/${F} # installed path
|
||||
|
||||
.endif # not symlinks
|
||||
${_F}: ${F} __incinstall # install rule
|
||||
incinstall:: ${_F}
|
||||
.PRECIOUS: ${_F} # keep if install fails
|
||||
.PHONY: ${UPDATE:U${_F}} # clobber unless UPDATE
|
||||
.endfor
|
||||
|
||||
.undef _F
|
||||
|
||||
.endif # ${SYS_INCLUDE} ?= "symlinks"
|
||||
|
||||
.if defined(SYMLINKS) && !empty(SYMLINKS)
|
||||
incinstall::
|
||||
@(set ${SYMLINKS}; \
|
||||
while test $$# -ge 2; do \
|
||||
l=$$1; \
|
||||
shift; \
|
||||
t=${DESTDIR}$$1; \
|
||||
shift; \
|
||||
l=$$1; shift; \
|
||||
t=${DESTDIR}$$1; shift; \
|
||||
if [ -h $$t ]; then \
|
||||
cur=`ls -ld $$t | awk '{print $$NF}'` ; \
|
||||
if [ "$$cur" = "$$l" ]; then \
|
||||
@ -136,8 +107,5 @@ incinstall::
|
||||
done; )
|
||||
.endif
|
||||
|
||||
.if !target(incinstall)
|
||||
incinstall::
|
||||
.endif
|
||||
|
||||
##### Pull in related .mk logic
|
||||
.include <bsd.subdir.mk>
|
||||
|
@ -1,87 +1,73 @@
|
||||
# $NetBSD: bsd.kmod.mk,v 1.42 2001/10/05 15:30:06 simonb Exp $
|
||||
# $NetBSD: bsd.kmod.mk,v 1.43 2001/11/02 05:21:50 tv Exp $
|
||||
|
||||
.if !target(__initialized__)
|
||||
__initialized__:
|
||||
.if exists(${.CURDIR}/../Makefile.inc)
|
||||
.include "${.CURDIR}/../Makefile.inc"
|
||||
.endif
|
||||
.include <bsd.own.mk>
|
||||
.include <bsd.obj.mk>
|
||||
.include <bsd.depall.mk>
|
||||
.MAIN: all
|
||||
.endif
|
||||
.include <bsd.init.mk>
|
||||
|
||||
##### Basic targets
|
||||
.PHONY: cleankmod kmodinstall load unload
|
||||
realinstall: kmodinstall
|
||||
beforedepend: machine-links
|
||||
clean: cleankmod
|
||||
realinstall: kmodinstall
|
||||
|
||||
##### Default values
|
||||
S?= /sys
|
||||
KERN= $S/kern
|
||||
|
||||
CFLAGS+= ${COPTS} -D_KERNEL -D_LKM -I. -I${.CURDIR} -I$S -I$S/arch
|
||||
|
||||
DPSRCS+= ${SRCS:M*.l:.l=.c} ${SRCS:M*.y:.y=.c}
|
||||
CLEANFILES+= ${DPSRCS}
|
||||
.if defined(YHEADER)
|
||||
CLEANFILES+= ${SRCS:M*.y:.y=.h}
|
||||
.endif
|
||||
CLEANFILES+= ${DPSRCS} ${YHEADER:D${SRCS:M*.y:.y=.h}} \
|
||||
machine ${MACHINE_CPU}
|
||||
|
||||
OBJS+= ${SRCS:N*.h:N*.sh:R:S/$/.o/g}
|
||||
PROG?= ${KMOD}.o
|
||||
MAN?= ${KMOD}.4
|
||||
|
||||
.if !defined(PROG)
|
||||
PROG= ${KMOD}.o
|
||||
.endif
|
||||
##### Build rules
|
||||
realall: machine-links ${PROG}
|
||||
.ORDER: machine-links ${PROG}
|
||||
|
||||
${PROG}: ${DPSRCS} ${OBJS} ${DPADD}
|
||||
${LD} -r ${LDFLAGS} -o tmp.o ${OBJS}
|
||||
mv tmp.o ${.TARGET}
|
||||
|
||||
.if !defined(MAN)
|
||||
MAN= ${KMOD}.4
|
||||
# XXX. This should be done a better way. It's @'d to reduce visual spew.
|
||||
machine-links:
|
||||
@rm -f machine && \
|
||||
ln -s $S/arch/${MACHINE}/include machine
|
||||
@rm -f ${MACHINE_CPU} && \
|
||||
ln -s $S/arch/${MACHINE_CPU}/include ${MACHINE_CPU}
|
||||
|
||||
##### Install rules
|
||||
.if !target(kmodinstall)
|
||||
_PROG:= ${DESTDIR}${KMODDIR}/${PROG} # installed path
|
||||
|
||||
${_PROG}: ${PROG} # install rule
|
||||
${INSTALL_FILE} -o ${KMODOWN} -g ${KMODGRP} -m ${KMODMODE} \
|
||||
${.ALLSRC} ${.TARGET}
|
||||
|
||||
kmodinstall:: ${_PROG}
|
||||
.PRECIOUS: ${_PROG} # keep if install fails
|
||||
.PHONY: ${UPDATE:U${_PROG}} # clobber unless UPDATE
|
||||
.if !defined(BUILD) && !make(all) && !make(${PROG})
|
||||
${_PROG}: .MADE # no build at install
|
||||
.endif
|
||||
|
||||
realall: machine-links ${PROG}
|
||||
|
||||
.PHONY: machine-links
|
||||
beforedepend: machine-links
|
||||
machine-links:
|
||||
-rm -f machine && \
|
||||
ln -s $S/arch/${MACHINE}/include machine
|
||||
-rm -f ${MACHINE_CPU} && \
|
||||
ln -s $S/arch/${MACHINE_CPU}/include ${MACHINE_CPU}
|
||||
CLEANFILES+=machine ${MACHINE_CPU}
|
||||
.undef _PROG
|
||||
.endif # !target(kmodinstall)
|
||||
|
||||
##### Clean rules
|
||||
cleankmod:
|
||||
rm -f a.out [Ee]rrs mklog core *.core \
|
||||
${PROG} ${OBJS} ${LOBJS} ${CLEANFILES}
|
||||
|
||||
#
|
||||
# define various install targets
|
||||
#
|
||||
.if !target(kmodinstall)
|
||||
kmodinstall:: ${DESTDIR}${KMODDIR}/${PROG}
|
||||
.PRECIOUS: ${DESTDIR}${KMODDIR}/${PROG}
|
||||
.if !defined(UPDATE)
|
||||
.PHONY: ${DESTDIR}${KMODDIR}/${PROG}
|
||||
.endif
|
||||
|
||||
__kmodinstall: .USE
|
||||
${INSTALL} ${RENAME} ${PRESERVE} ${COPY} ${INSTPRIV} -o ${KMODOWN} \
|
||||
-g ${KMODGRP} -m ${KMODMODE} ${.ALLSRC} ${.TARGET}
|
||||
|
||||
.if !defined(BUILD) && !make(all) && !make(${PROG})
|
||||
${DESTDIR}${KMODDIR}/${PROG}: .MADE
|
||||
.endif
|
||||
${DESTDIR}${KMODDIR}/${PROG}: ${PROG} __kmodinstall
|
||||
.endif
|
||||
|
||||
##### Custom rules
|
||||
lint: ${LOBJS}
|
||||
.if defined(LOBJS) && !empty(LOBJS)
|
||||
${LINT} ${LINTFLAGS} ${LDFLAGS:M-L*} ${LOBJS} ${LDADD}
|
||||
.endif
|
||||
|
||||
.if !target(load)
|
||||
load: ${PROG}
|
||||
load: ${PROG}
|
||||
/sbin/modload ${KMOD_LOADFLAGS} -o ${KMOD} ${PROG}
|
||||
.endif
|
||||
|
||||
@ -90,6 +76,7 @@ unload:
|
||||
/sbin/modunload -n ${KMOD}
|
||||
.endif
|
||||
|
||||
##### Pull in related .mk logic
|
||||
.include <bsd.man.mk>
|
||||
.include <bsd.links.mk>
|
||||
.include <bsd.dep.mk>
|
||||
|
@ -1,21 +1,14 @@
|
||||
# $NetBSD: bsd.lib.mk,v 1.187 2001/10/25 19:32:15 nathanw Exp $
|
||||
# $NetBSD: bsd.lib.mk,v 1.188 2001/11/02 05:21:50 tv Exp $
|
||||
# @(#)bsd.lib.mk 8.3 (Berkeley) 4/22/94
|
||||
|
||||
.if !target(__initialized__)
|
||||
__initialized__:
|
||||
.if exists(${.CURDIR}/../Makefile.inc)
|
||||
.include "${.CURDIR}/../Makefile.inc"
|
||||
.endif
|
||||
.include <bsd.own.mk>
|
||||
.include <bsd.obj.mk>
|
||||
.include <bsd.depall.mk>
|
||||
.MAIN: all
|
||||
.endif
|
||||
.include <bsd.init.mk>
|
||||
|
||||
##### Basic targets
|
||||
.PHONY: checkver cleanlib libinstall
|
||||
realinstall: checkver libinstall
|
||||
clean: cleanlib
|
||||
|
||||
##### Build and install rules
|
||||
.if !defined(SHLIB_MAJOR) && exists(${SHLIB_VERSION_FILE})
|
||||
SHLIB_MAJOR != . ${SHLIB_VERSION_FILE} ; echo $$major
|
||||
SHLIB_MINOR != . ${SHLIB_VERSION_FILE} ; echo $$minor
|
||||
@ -349,10 +342,11 @@ __archivebuild: .USE
|
||||
${RANLIB} ${.TARGET}
|
||||
|
||||
__archiveinstall: .USE
|
||||
${INSTALL} ${RENAME} ${PRESERVE} ${COPY} ${INSTPRIV} -o ${LIBOWN} \
|
||||
-g ${LIBGRP} -m 600 ${.ALLSRC} ${.TARGET}
|
||||
${INSTALL_FILE} -o ${LIBOWN} -g ${LIBGRP} -m 600 ${.ALLSRC} ${.TARGET}
|
||||
${RANLIB} -t ${.TARGET}
|
||||
.if !defined(UNPRIVILEGED)
|
||||
chmod ${LIBMODE} ${.TARGET}
|
||||
.endif
|
||||
|
||||
DPSRCS+= ${SRCS:M*.[ly]:C/..$/.c/}
|
||||
CLEANFILES+= ${DPSRCS} ${YHEADER:D${SRCS:M*.y:.y=.h}}
|
||||
@ -473,8 +467,8 @@ libinstall:: ${DESTDIR}${LIBDIR}/lib${LIB}.so.${SHLIB_FULLVERSION}
|
||||
${DESTDIR}${LIBDIR}/lib${LIB}.so.${SHLIB_FULLVERSION}: .MADE
|
||||
.endif
|
||||
${DESTDIR}${LIBDIR}/lib${LIB}.so.${SHLIB_FULLVERSION}: lib${LIB}.so.${SHLIB_FULLVERSION}
|
||||
${INSTALL} ${RENAME} ${PRESERVE} ${COPY} ${INSTPRIV} -o ${LIBOWN} \
|
||||
-g ${LIBGRP} -m ${LIBMODE} ${.ALLSRC} ${.TARGET}
|
||||
${INSTALL_FILE} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \
|
||||
${.ALLSRC} ${.TARGET}
|
||||
.if ${OBJECT_FMT} == "a.out" && !defined(DESTDIR)
|
||||
/sbin/ldconfig -m ${LIBDIR}
|
||||
.endif
|
||||
@ -503,11 +497,12 @@ libinstall:: ${DESTDIR}${LINTLIBDIR}/llib-l${LIB}.ln
|
||||
${DESTDIR}${LINTLIBDIR}/llib-l${LIB}.ln: .MADE
|
||||
.endif
|
||||
${DESTDIR}${LINTLIBDIR}/llib-l${LIB}.ln: llib-l${LIB}.ln
|
||||
${INSTALL} ${RENAME} ${PRESERVE} ${COPY} ${INSTPRIV} -o ${LIBOWN} \
|
||||
-g ${LIBGRP} -m ${LIBMODE} ${.ALLSRC} ${DESTDIR}${LINTLIBDIR}
|
||||
${INSTALL_FILE} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \
|
||||
${.ALLSRC} ${DESTDIR}${LINTLIBDIR}
|
||||
.endif
|
||||
.endif
|
||||
|
||||
##### Pull in related .mk logic
|
||||
.include <bsd.man.mk>
|
||||
.include <bsd.nls.mk>
|
||||
.include <bsd.files.mk>
|
||||
@ -516,5 +511,4 @@ ${DESTDIR}${LINTLIBDIR}/llib-l${LIB}.ln: llib-l${LIB}.ln
|
||||
.include <bsd.dep.mk>
|
||||
.include <bsd.sys.mk>
|
||||
|
||||
# Make sure all of the standard targets are defined, even if they do nothing.
|
||||
lint regress:
|
||||
${TARGETS}: # ensure existence
|
||||
|
@ -1,16 +1,20 @@
|
||||
# $NetBSD: bsd.links.mk,v 1.14 2000/07/07 04:35:36 cgd Exp $
|
||||
# $NetBSD: bsd.links.mk,v 1.15 2001/11/02 05:21:51 tv Exp $
|
||||
|
||||
##### Basic targets
|
||||
.PHONY: linksinstall
|
||||
realinstall: linksinstall
|
||||
|
||||
.if defined(SYMLINKS) && !empty(SYMLINKS)
|
||||
##### Default values
|
||||
LINKS?=
|
||||
SYMLINKS?=
|
||||
|
||||
##### Install rules
|
||||
linksinstall::
|
||||
.if !empty(SYMLINKS)
|
||||
@(set ${SYMLINKS}; \
|
||||
while test $$# -ge 2; do \
|
||||
l=$$1; \
|
||||
shift; \
|
||||
t=${DESTDIR}$$1; \
|
||||
shift; \
|
||||
l=$$1; shift; \
|
||||
t=${DESTDIR}$$1; shift; \
|
||||
if [ -h $$t ]; then \
|
||||
cur=`ls -ld $$t | awk '{print $$NF}'` ; \
|
||||
if [ "$$cur" = "$$l" ]; then \
|
||||
@ -21,15 +25,12 @@ linksinstall::
|
||||
rm -rf $$t; ln -s $$l $$t; \
|
||||
done; )
|
||||
.endif
|
||||
.if defined(LINKS) && !empty(LINKS)
|
||||
linksinstall::
|
||||
.if !empty(LINKS)
|
||||
@(set ${LINKS}; \
|
||||
echo ".include <bsd.own.mk>"; \
|
||||
while test $$# -ge 2; do \
|
||||
l=${DESTDIR}$$1; \
|
||||
shift; \
|
||||
t=${DESTDIR}$$1; \
|
||||
shift; \
|
||||
l=${DESTDIR}$$1; shift; \
|
||||
t=${DESTDIR}$$1; shift; \
|
||||
echo "realall: $$t"; \
|
||||
echo ".PHONY: $$t"; \
|
||||
echo "$$t:"; \
|
||||
@ -38,7 +39,3 @@ linksinstall::
|
||||
done; \
|
||||
) | ${MAKE} -f- all
|
||||
.endif
|
||||
|
||||
.if !target(linksinstall)
|
||||
linksinstall:
|
||||
.endif
|
||||
|
@ -1,23 +1,14 @@
|
||||
# $NetBSD: bsd.man.mk,v 1.63 2001/08/14 07:02:13 tv Exp $
|
||||
# $NetBSD: bsd.man.mk,v 1.64 2001/11/02 05:21:51 tv Exp $
|
||||
# @(#)bsd.man.mk 8.1 (Berkeley) 6/8/93
|
||||
|
||||
.if !target(__initialized__)
|
||||
__initialized__:
|
||||
.if exists(${.CURDIR}/../Makefile.inc)
|
||||
.include "${.CURDIR}/../Makefile.inc"
|
||||
.endif
|
||||
.include <bsd.own.mk>
|
||||
.include <bsd.obj.mk>
|
||||
.include <bsd.depall.mk>
|
||||
.MAIN: all
|
||||
.endif
|
||||
.include <bsd.init.mk>
|
||||
|
||||
.PHONY: catinstall maninstall catpages manpages catlinks manlinks cleanman html installhtml cleanhtml
|
||||
.if ${MKMAN} != "no"
|
||||
##### Basic targets
|
||||
.PHONY: catinstall maninstall catpages manpages catlinks manlinks \
|
||||
cleanman html installhtml cleanhtml
|
||||
realinstall: ${MANINSTALL}
|
||||
.endif
|
||||
cleandir: cleanman
|
||||
|
||||
##### Default values
|
||||
TMACDIR?= ${DESTDIR}/usr/share/tmac
|
||||
HTMLDIR?= ${DESTDIR}/usr/share/man
|
||||
CATDEPS?= ${TMACDIR}/tmac.andoc \
|
||||
@ -29,175 +20,167 @@ CATDEPS?= ${TMACDIR}/tmac.andoc \
|
||||
MANTARGET?= cat
|
||||
NROFF?= nroff -Tascii
|
||||
GROFF?= groff -Tascii
|
||||
GROFF_HTML?= groff -Tlatin1 -mdoc2html -P-b -P-o -P-u
|
||||
TBL?= tbl
|
||||
|
||||
MAN?=
|
||||
MLINKS?=
|
||||
_MNUMBERS= 1 2 3 4 5 6 7 8 9
|
||||
.SUFFIXES: ${_MNUMBERS:@N@.$N@}
|
||||
|
||||
.SUFFIXES: .1 .2 .3 .4 .5 .6 .7 .8 .9 \
|
||||
.cat1 .cat2 .cat3 .cat4 .cat5 .cat6 .cat7 .cat8 .cat9 \
|
||||
.html1 .html2 .html3 .html4 .html5 .html6 .html7 .html8 .html9
|
||||
MANCOMPRESS?= ${MANZ:Dgzip -cf}
|
||||
MANSUFFIX?= ${MANZ:D.gz}
|
||||
|
||||
.9.cat9 .8.cat8 .7.cat7 .6.cat6 .5.cat5 .4.cat4 .3.cat3 .2.cat2 .1.cat1: \
|
||||
${CATDEPS}
|
||||
.if !defined(USETBL)
|
||||
@echo "${NROFF} -mandoc ${.IMPSRC} > ${.TARGET}"
|
||||
@${NROFF} -mandoc ${.IMPSRC} > ${.TARGET} || \
|
||||
(rm -f ${.TARGET}; false)
|
||||
.else
|
||||
@echo "${TBL} ${.IMPSRC} | ${NROFF} -mandoc > ${.TARGET}"
|
||||
@${TBL} ${.IMPSRC} | ${NROFF} -mandoc > ${.TARGET} || \
|
||||
(rm -f ${.TARGET}; false)
|
||||
# make MANCOMPRESS a filter, so it can be inserted on an as-needed basis
|
||||
.if !empty(MANCOMPRESS)
|
||||
MANCOMPRESS:= | ${MANCOMPRESS}
|
||||
.endif
|
||||
|
||||
.9.html9 .8.html8 .7.html7 .6.html6 .5.html5 .4.html4 .3.html3 .2.html2 .1.html1: \
|
||||
${CATDEPS}
|
||||
.if !defined(USETBL)
|
||||
@echo "${GROFF} -mdoc2html -P-b -P-u -P-o ${.IMPSRC} > ${.TARGET}"
|
||||
@${GROFF} -mdoc2html -P-b -P-u -P-o ${.IMPSRC} > ${.TARGET} || \
|
||||
(rm -f ${.TARGET}; false)
|
||||
.else
|
||||
@echo "${TBL} ${.IMPSRC} | ${GROFF} -mdoc2html -P-b -P-u -P-o > ${.TARGET}"
|
||||
@cat ${.IMPSRC} | ${GROFF} -mdoc2html -P-b -P-u -P-o > ${.TARGET} || \
|
||||
(rm -f ${.TARGET}; false)
|
||||
.endif
|
||||
|
||||
.if defined(MAN) && !empty(MAN)
|
||||
MANPAGES= ${MAN}
|
||||
CATPAGES= ${MANPAGES:C/(.*).([1-9])/\1.cat\2/}
|
||||
.NOPATH: ${CATPAGES}
|
||||
.if !defined(NOHTML)
|
||||
HTMLPAGES= ${MANPAGES:C/(.*).([1-9])/\1.html\2/}
|
||||
.endif
|
||||
.endif
|
||||
|
||||
MINSTALL= ${INSTALL} ${RENAME} ${PRESERVE} ${COPY} ${INSTPRIV} \
|
||||
-o ${MANOWN} -g ${MANGRP} -m ${MANMODE}
|
||||
|
||||
.if defined(MANZ)
|
||||
# chown and chmod are done afterward automatically
|
||||
MCOMPRESS= gzip -cf
|
||||
MCOMPRESSSUFFIX= .gz
|
||||
.endif
|
||||
|
||||
catinstall: catlinks
|
||||
maninstall: manlinks
|
||||
|
||||
__installpage: .USE
|
||||
.if defined(MCOMPRESS) && !empty(MCOMPRESS)
|
||||
@rm -f ${.TARGET}
|
||||
${MCOMPRESS} ${.ALLSRC} > ${.TARGET}
|
||||
@chown ${MANOWN}:${MANGRP} ${.TARGET}
|
||||
@chmod ${MANMODE} ${.TARGET}
|
||||
.else
|
||||
@cmp -s ${.ALLSRC} ${.TARGET} > /dev/null 2>&1 || \
|
||||
(echo "${MINSTALL} ${.ALLSRC} ${.TARGET}" && \
|
||||
${MINSTALL} ${.ALLSRC} ${.TARGET})
|
||||
(echo "${INSTALL_FILE} -o ${MANOWN} -g ${MANGRP} -m ${MANMODE} \
|
||||
${.ALLSRC} ${.TARGET}" && \
|
||||
${INSTALL_FILE} -o ${MANOWN} -g ${MANGRP} -m ${MANMODE} \
|
||||
${.ALLSRC} ${.TARGET})
|
||||
|
||||
##### Build and install rules (source form pages)
|
||||
|
||||
.if ${MKMAN} != "no"
|
||||
maninstall: manlinks
|
||||
manpages:: # ensure target exists
|
||||
MANPAGES= ${MAN:C/$/${MANSUFFIX}/}
|
||||
|
||||
.if !empty(MANSUFFIX)
|
||||
realall: ${MANPAGES}
|
||||
.NOPATH: ${MANPAGES}
|
||||
.SUFFIXES: ${_MNUMBERS:@N@.$N${MANSUFFIX}@}
|
||||
|
||||
${_MNUMBERS:@N@.$N.$N${MANSUFFIX}@}: # build rule
|
||||
cat ${.IMPSRC} ${MANCOMPRESS} > ${.TARGET}
|
||||
.endif # !empty(MANSUFFIX)
|
||||
|
||||
.for F in ${MANPAGES:S/${MANSUFFIX}$//:O:u}
|
||||
_F:= ${DESTDIR}${MANDIR}/man${F:T:E}${MANSUBDIR}/${F}${MANSUFFIX}
|
||||
|
||||
${_F}: ${F}${MANSUFFIX} __installpage # install rule
|
||||
manpages:: ${_F}
|
||||
.PRECIOUS: ${_F} # keep if install fails
|
||||
.PHONY: ${UPDATE:U${_F}} # clobber unless UPDATE
|
||||
.if !defined(BUILD) && !make(all) && !make(${F})
|
||||
${_F}: .MADE # no build at install
|
||||
.endif
|
||||
|
||||
|
||||
# Rules for cat'ed man page installation
|
||||
.if defined(CATPAGES) && !empty(CATPAGES) && ${MKCATPAGES} != "no"
|
||||
catpages:: ${CATPAGES:@P@${DESTDIR}${MANDIR}/${P:T:E}${MANSUBDIR}/${P:T:R}.0${MCOMPRESSSUFFIX}@}
|
||||
.PRECIOUS: ${CATPAGES:@P@${DESTDIR}${MANDIR}/${P:T:E}${MANSUBDIR}/${P:T:R}.0${MCOMPRESSSUFFIX}@}
|
||||
.if !defined(UPDATE)
|
||||
.PHONY: ${CATPAGES:@P@${DESTDIR}${MANDIR}/${P:T:E}${MANSUBDIR}/${P:T:R}.0${MCOMPRESSSUFFIX}@}
|
||||
.endif
|
||||
|
||||
. for P in ${CATPAGES:O:u}
|
||||
. if !defined(BUILD) && !make(all) && !make(${P})
|
||||
${DESTDIR}${MANDIR}/${P:T:E}${MANSUBDIR}/${P:T:R}.0${MCOMPRESSSUFFIX}: .MADE
|
||||
. endif
|
||||
${DESTDIR}${MANDIR}/${P:T:E}${MANSUBDIR}/${P:T:R}.0${MCOMPRESSSUFFIX}: ${P} __installpage
|
||||
. endfor
|
||||
.else
|
||||
catpages::
|
||||
.endif
|
||||
|
||||
# Rules for source page installation
|
||||
.if defined(MANPAGES) && !empty(MANPAGES)
|
||||
manpages:: ${MANPAGES:@P@${DESTDIR}${MANDIR}/man${P:T:E}${MANSUBDIR}/${P}${MCOMPRESSSUFFIX}@}
|
||||
.PRECIOUS: ${MANPAGES:@P@${DESTDIR}${MANDIR}/man${P:T:E}${MANSUBDIR}/${P}${MCOMPRESSSUFFIX}@}
|
||||
.if !defined(UPDATE)
|
||||
.PHONY: ${MANPAGES:@P@${DESTDIR}${MANDIR}/man${P:T:E}${MANSUBDIR}/${P}${MCOMPRESSSUFFIX}@}
|
||||
.endif
|
||||
|
||||
. for P in ${MANPAGES:O:u}
|
||||
${DESTDIR}${MANDIR}/man${P:T:E}${MANSUBDIR}/${P}${MCOMPRESSSUFFIX}: ${P} __installpage
|
||||
. endfor
|
||||
.else
|
||||
manpages::
|
||||
.endif
|
||||
|
||||
.if ${MKCATPAGES} != "no"
|
||||
catlinks: catpages
|
||||
.if defined(MLINKS) && !empty(MLINKS)
|
||||
@set ${MLINKS}; \
|
||||
while test $$# -ge 2; do \
|
||||
name=$$1; \
|
||||
shift; \
|
||||
dir=${DESTDIR}${MANDIR}/cat$${name##*.}; \
|
||||
l=$${dir}${MANSUBDIR}/$${name%.*}.0${MCOMPRESSSUFFIX}; \
|
||||
name=$$1; \
|
||||
shift; \
|
||||
dir=${DESTDIR}${MANDIR}/cat$${name##*.}; \
|
||||
t=$${dir}${MANSUBDIR}/$${name%.*}.0${MCOMPRESSSUFFIX}; \
|
||||
if test $$l -nt $$t -o ! -f $$t; then \
|
||||
echo $$t -\> $$l; \
|
||||
ln -f $$l $$t; \
|
||||
fi; \
|
||||
done
|
||||
.endif
|
||||
.else
|
||||
catlinks:
|
||||
.endif
|
||||
|
||||
manlinks: manpages
|
||||
.if defined(MLINKS) && !empty(MLINKS)
|
||||
@set ${MLINKS}; \
|
||||
while test $$# -ge 2; do \
|
||||
name=$$1; \
|
||||
shift; \
|
||||
dir=${DESTDIR}${MANDIR}/man$${name##*.}; \
|
||||
l=$${dir}${MANSUBDIR}/$${name}${MCOMPRESSSUFFIX}; \
|
||||
name=$$1; \
|
||||
shift; \
|
||||
dir=${DESTDIR}${MANDIR}/man$${name##*.}; \
|
||||
t=$${dir}${MANSUBDIR}/$${name}${MCOMPRESSSUFFIX}; \
|
||||
if test $$l -nt $$t -o ! -f $$t; then \
|
||||
echo $$t -\> $$l; \
|
||||
ln -f $$l $$t; \
|
||||
fi; \
|
||||
done
|
||||
.endif
|
||||
|
||||
# Html rules
|
||||
html: ${HTMLPAGES}
|
||||
|
||||
.if defined(HTMLPAGES) && !empty(HTMLPAGES)
|
||||
.for P in ${HTMLPAGES:O:u}
|
||||
${HTMLDIR}/${P:T:E}/${P:T:R}.html: ${P}
|
||||
${MINSTALL} ${.ALLSRC} ${.TARGET}
|
||||
.endfor
|
||||
|
||||
manlinks: manpages # symlink install
|
||||
.if !empty(MLINKS)
|
||||
@set ${MLINKS}; \
|
||||
while test $$# -ge 2; do \
|
||||
name=$$1; shift; \
|
||||
dir=${DESTDIR}${MANDIR}/man$${name##*.}; \
|
||||
l=$${dir}${MANSUBDIR}/$${name}${MANSUFFIX}; \
|
||||
name=$$1; shift; \
|
||||
dir=${DESTDIR}${MANDIR}/man$${name##*.}; \
|
||||
t=$${dir}${MANSUBDIR}/$${name}${MANSUFFIX}; \
|
||||
if test $$l -nt $$t -o ! -f $$t; then \
|
||||
echo $$t -\> $$l; \
|
||||
ln -f $$l $$t; \
|
||||
fi; \
|
||||
done
|
||||
.endif
|
||||
installhtml: ${HTMLPAGES:@P@${HTMLDIR}/${P:T:E}/${P:T:R}.html@}
|
||||
.endif # ${MKMAN} != "no"
|
||||
|
||||
##### Build and install rules (plaintext pages)
|
||||
|
||||
.if (${MKCATPAGES} != "no") && (${MKMAN} != "no")
|
||||
catinstall: catlinks
|
||||
catpages:: # ensure target exists
|
||||
CATPAGES= ${MAN:C/\.([1-9])$/.cat\1${MANSUFFIX}/}
|
||||
|
||||
realall: ${CATPAGES}
|
||||
.NOPATH: ${CATPAGES}
|
||||
.SUFFIXES: ${_MNUMBERS:@N@.cat$N${MANSUFFIX}@}
|
||||
|
||||
${_MNUMBERS:@N@.$N.cat$N${MANSUFFIX}@}: ${CATDEPS} # build rule
|
||||
.if defined(USETBL)
|
||||
${TBL} ${.IMPSRC} | ${NROFF} -mandoc ${MANCOMPRESS} > ${.TARGET}
|
||||
.else
|
||||
${NROFF} -mandoc ${.IMPSRC} ${MANCOMPRESS} > ${.TARGET}
|
||||
.endif
|
||||
|
||||
.for F in ${CATPAGES:S/${MANSUFFIX}$//:O:u}
|
||||
_F:= ${DESTDIR}${MANDIR}/${F:T:E}${MANSUBDIR}/${F:R}.0${MANSUFFIX}
|
||||
${_F}: ${F}${MANSUFFIX} __installpage # install rule
|
||||
catpages:: ${_F}
|
||||
.PRECIOUS: ${_F} # keep if install fails
|
||||
.PHONY: ${UPDATE:U${_F}} # noclobber install
|
||||
.if !defined(BUILD) && !make(all) && !make(${F})
|
||||
${_F}: .MADE # no build at install
|
||||
.endif
|
||||
.endfor
|
||||
|
||||
catlinks: catpages # symlink install
|
||||
.if !empty(MLINKS)
|
||||
@set ${MLINKS}; \
|
||||
while test $$# -ge 2; do \
|
||||
name=$$1; shift; \
|
||||
dir=${DESTDIR}${MANDIR}/cat$${name##*.}; \
|
||||
l=$${dir}${MANSUBDIR}/$${name%.*}.0${MANSUFFIX}; \
|
||||
name=$$1; shift; \
|
||||
dir=${DESTDIR}${MANDIR}/cat$${name##*.}; \
|
||||
t=$${dir}${MANSUBDIR}/$${name%.*}.0${MANSUFFIX}; \
|
||||
if test $$l -nt $$t -o ! -f $$t; then \
|
||||
echo $$t -\> $$l; \
|
||||
ln -f $$l $$t; \
|
||||
fi; \
|
||||
done
|
||||
.endif
|
||||
.endif # (${MKCATPAGES} != "no") && (${MKMAN} != "no")
|
||||
|
||||
##### Build and install rules (HTML pages)
|
||||
|
||||
.if !defined(NOHTML)
|
||||
installhtml: htmlpages
|
||||
htmlpages:: # ensure target exists
|
||||
HTMLPAGES= ${MAN:C/\.([1-9])$/.html\1/}
|
||||
|
||||
html: ${HTMLPAGES}
|
||||
.NOPATH: ${HTMLPAGES}
|
||||
.SUFFIXES: ${_MNUMBERS:@N@.html$N@}
|
||||
|
||||
${_MNUMBERS:@N@.$N.html$N@}: ${CATDEPS} # build rule
|
||||
${GROFF_HTML} ${.IMPSRC} > ${.TARGET}
|
||||
|
||||
.for F in ${HTMLPAGES:O:u}
|
||||
_F:= ${HTMLDIR}/${F:T:E}/${F:R}.html # installed path
|
||||
${_F}: ${F} __installpage # install rule
|
||||
htmlpages:: ${_F}
|
||||
.PRECIOUS: ${_F} # keep if install fails
|
||||
.PHONY: ${UPDATE:U${_F}} # noclobber install
|
||||
.if !defined(BUILD) && !make(all) && !make(${F})
|
||||
${_F}: .MADE # no build at install
|
||||
.endif
|
||||
.endfor
|
||||
|
||||
cleanhtml:
|
||||
.if defined(HTMLPAGES) && !empty(HTMLPAGES)
|
||||
rm -f ${HTMLPAGES}
|
||||
.endif
|
||||
.endif # !defined(NOHTML)
|
||||
|
||||
##### Clean rules
|
||||
.undef _F
|
||||
|
||||
.if defined(CATPAGES)
|
||||
.if ${MKCATPAGES} != "no" && ${MKMAN} != "no"
|
||||
realall: ${CATPAGES}
|
||||
.else
|
||||
realall:
|
||||
.endif
|
||||
|
||||
cleandir: cleanman
|
||||
cleanman:
|
||||
.if !empty(MAN) && (${MKMAN} != "no")
|
||||
.if (${MKCATPAGES} != "no")
|
||||
rm -f ${CATPAGES}
|
||||
.else
|
||||
cleanman:
|
||||
.endif
|
||||
.if !empty(MANSUFFIX)
|
||||
rm -f ${MANPAGES} ${CATPAGES:S/${MANSUFFIX}$//}
|
||||
.endif
|
||||
.endif
|
||||
# (XXX ${CATPAGES:S...} cleans up old .catN files where .catN.gz now used)
|
||||
|
||||
# Make sure all of the standard targets are defined, even if they do nothing.
|
||||
clean depend includes lint regress tags:
|
||||
##### Pull in related .mk logic
|
||||
.include <bsd.obj.mk>
|
||||
|
||||
${TARGETS} catinstall maninstall: # ensure existence
|
||||
|
@ -1,17 +1,25 @@
|
||||
# $NetBSD: bsd.nls.mk,v 1.30 2001/08/14 08:28:24 tv Exp $
|
||||
# $NetBSD: bsd.nls.mk,v 1.31 2001/11/02 05:21:51 tv Exp $
|
||||
|
||||
.if !target(__initialized__)
|
||||
__initialized__:
|
||||
.if exists(${.CURDIR}/../Makefile.inc)
|
||||
.include "${.CURDIR}/../Makefile.inc"
|
||||
.endif
|
||||
.MAIN: all
|
||||
.endif
|
||||
.include <bsd.init.mk>
|
||||
|
||||
##### Basic targets
|
||||
.PHONY: cleannls nlsinstall
|
||||
cleandir: cleannls
|
||||
realinstall: nlsinstall
|
||||
|
||||
##### Default values
|
||||
GENCAT?= gencat
|
||||
NLSNAME?= ${PROG:Ulib${LIB}}
|
||||
|
||||
NLS?=
|
||||
|
||||
##### Build rules
|
||||
.if ${MKNLS} != "no"
|
||||
|
||||
NLSALL= ${NLS:.msg=.cat}
|
||||
|
||||
realall: ${NLSALL}
|
||||
.NOPATH: ${NLSALL}
|
||||
|
||||
.SUFFIXES: .cat .msg
|
||||
|
||||
@ -19,23 +27,15 @@ GENCAT?= gencat
|
||||
@rm -f ${.TARGET}
|
||||
${GENCAT} ${.TARGET} ${.IMPSRC}
|
||||
|
||||
.if defined(NLS) && !empty(NLS)
|
||||
NLSALL= ${NLS:.msg=.cat}
|
||||
.NOPATH: ${NLSALL}
|
||||
|
||||
NLSNAME?=${PROG:Ulib${LIB}}
|
||||
.endif # ${MKNLS} != "no"
|
||||
|
||||
##### Install rules
|
||||
nlsinstall:: # ensure existence
|
||||
.if ${MKNLS} != "no"
|
||||
realinstall: nlsinstall
|
||||
realall: ${NLSALL}
|
||||
.endif
|
||||
|
||||
cleannls:
|
||||
rm -f ${NLSALL}
|
||||
|
||||
nlsinstall:: ${DESTDIR}${NLSDIR}
|
||||
.PRECIOUS:: ${DESTDIR}${NLSDIR}
|
||||
.PHONY:: ${DESTDIR}${NLSDIR}
|
||||
nlsinstall:: ${DESTDIR}${NLSDIR}
|
||||
.PRECIOUS: ${DESTDIR}${NLSDIR}
|
||||
.PHONY: ${DESTDIR}${NLSDIR}
|
||||
|
||||
${DESTDIR}${NLSDIR}:
|
||||
@if [ ! -d ${.TARGET} ] || [ -h ${.TARGET} ] ; then \
|
||||
@ -45,23 +45,28 @@ ${DESTDIR}${NLSDIR}:
|
||||
${.TARGET}; \
|
||||
fi
|
||||
|
||||
nlsinstall:: ${NLSALL:@F@${DESTDIR}${NLSDIR}/${F:T:R}/${NLSNAME}.cat@}
|
||||
.PRECIOUS: ${NLSALL:@F@${DESTDIR}${NLSDIR}/${F:T:R}/${NLSNAME}.cat@}
|
||||
.if !defined(UPDATE)
|
||||
.PHONY: ${NLSALL:@F@${DESTDIR}${NLSDIR}/${F:T:R}/${NLSNAME}.cat@}
|
||||
.endif
|
||||
|
||||
__nlsinstall: .USE
|
||||
${INSTALL} ${INSTPRIV} -d -o ${NLSOWN} -g ${NLSGRP} ${.TARGET:H}
|
||||
${INSTALL} ${RENAME} ${PRESERVE} ${COPY} ${INSTPRIV} -o ${NLSOWN} \
|
||||
-g ${NLSGRP} -m ${NLSMODE} ${.ALLSRC} ${.TARGET}
|
||||
|
||||
.for F in ${NLSALL:O:u}
|
||||
_F:= ${DESTDIR}${NLSDIR}/${F:T:R}/${NLSNAME}.cat # installed path
|
||||
|
||||
${_F}: ${F} __nlsinstall # install rule
|
||||
nlsinstall:: ${_F}
|
||||
.PRECIOUS: ${_F} # keep if install fails
|
||||
.PHONY: ${UPDATE:U${_F}} # noclobber install
|
||||
.if !defined(BUILD) && !make(all) && !make(${F})
|
||||
${DESTDIR}${NLSDIR}/${F:T:R}/${NLSNAME}.cat: .MADE
|
||||
${_F}: .MADE # no build at install
|
||||
.endif
|
||||
${DESTDIR}${NLSDIR}/${F:T:R}/${NLSNAME}.cat: ${F} __nlsinstall
|
||||
.endfor
|
||||
.else
|
||||
|
||||
.undef _F
|
||||
.endif # ${MKNLS} != "no"
|
||||
|
||||
##### Clean rules
|
||||
cleannls:
|
||||
.if !empty(NLS)
|
||||
rm -f ${NLSALL}
|
||||
.endif
|
||||
|
@ -1,13 +1,10 @@
|
||||
# $NetBSD: bsd.own.mk,v 1.204 2001/10/31 17:46:08 tv Exp $
|
||||
# $NetBSD: bsd.own.mk,v 1.205 2001/11/02 05:21:51 tv Exp $
|
||||
|
||||
.if !defined(_BSD_OWN_MK_)
|
||||
_BSD_OWN_MK_=1
|
||||
|
||||
MAKECONF?= /etc/mk.conf
|
||||
|
||||
.if exists(${MAKECONF})
|
||||
.include "${MAKECONF}"
|
||||
.endif
|
||||
.-include "${MAKECONF}"
|
||||
|
||||
# Temporary; this will become default when all platforms have migrated.
|
||||
.if defined(USE_NEW_TOOLCHAIN) && ${USE_NEW_TOOLCHAIN} == "no"
|
||||
@ -178,6 +175,9 @@ RENAME?= -r
|
||||
INSTPRIV?= ${UNPRIVILEGED:D-U}
|
||||
STRIPFLAG?= -s
|
||||
|
||||
INSTALL_DIR?= ${INSTALL} ${INSTPRIV} -d
|
||||
INSTALL_FILE?= ${INSTALL} ${COPY} ${PRESERVE} ${RENAME} ${INSTPRIV}
|
||||
|
||||
# Define SYS_INCLUDE to indicate whether you want symbolic links to the system
|
||||
# source (``symlinks''), or a separate copy (``copies''); (latter useful
|
||||
# in environments where it's not possible to keep /sys publicly readable)
|
||||
@ -291,6 +291,9 @@ subdir-depend: .NOTMAIN
|
||||
realdepend: .NOTMAIN
|
||||
distclean: .NOTMAIN cleandir
|
||||
cleandir: .NOTMAIN clean
|
||||
|
||||
dependall: .NOTMAIN realdepend .MAKE
|
||||
@cd ${.CURDIR}; ${MAKE} realall
|
||||
.endif
|
||||
|
||||
# Define MKxxx variables (which are either yes or no) for users
|
||||
@ -303,8 +306,6 @@ MKCATPAGES?=yes
|
||||
|
||||
.if defined(NODOC)
|
||||
MKDOC=no
|
||||
#.elif !defined(MKDOC)
|
||||
#MKDOC=yes
|
||||
.else
|
||||
MKDOC?=yes
|
||||
.endif
|
||||
|
@ -1,21 +1,14 @@
|
||||
# $NetBSD: bsd.prog.mk,v 1.137 2001/10/19 15:55:52 tv Exp $
|
||||
# $NetBSD: bsd.prog.mk,v 1.138 2001/11/02 05:21:51 tv Exp $
|
||||
# @(#)bsd.prog.mk 8.2 (Berkeley) 4/2/94
|
||||
|
||||
.if !target(__initialized__)
|
||||
__initialized__:
|
||||
.if exists(${.CURDIR}/../Makefile.inc)
|
||||
.include "${.CURDIR}/../Makefile.inc"
|
||||
.endif
|
||||
.include <bsd.own.mk>
|
||||
.include <bsd.obj.mk>
|
||||
.include <bsd.depall.mk>
|
||||
.MAIN: all
|
||||
.endif
|
||||
.include <bsd.init.mk>
|
||||
|
||||
##### Basic targets
|
||||
.PHONY: cleanprog proginstall scriptsinstall
|
||||
realinstall: proginstall scriptsinstall
|
||||
clean: cleanprog
|
||||
|
||||
##### Default values
|
||||
CFLAGS+= ${COPTS}
|
||||
|
||||
# ELF platforms depend on crtbegin.o and crtend.o
|
||||
@ -83,6 +76,7 @@ LIBWRAP?= ${DESTDIR}/usr/lib/libwrap.a
|
||||
LIBY?= ${DESTDIR}/usr/lib/liby.a
|
||||
LIBZ?= ${DESTDIR}/usr/lib/libz.a
|
||||
|
||||
##### Build and install rules
|
||||
.if defined(SHAREDSTRINGS)
|
||||
CLEANFILES+=strings
|
||||
.c.o:
|
||||
@ -222,6 +216,7 @@ lint: ${LOBJS}
|
||||
${LINT} ${LINTFLAGS} ${LDFLAGS:M-L*} ${LOBJS} ${LDADD}
|
||||
.endif
|
||||
|
||||
##### Pull in related .mk logic
|
||||
.include <bsd.man.mk>
|
||||
.include <bsd.nls.mk>
|
||||
.include <bsd.files.mk>
|
||||
@ -230,5 +225,4 @@ lint: ${LOBJS}
|
||||
.include <bsd.dep.mk>
|
||||
.include <bsd.sys.mk>
|
||||
|
||||
# Make sure all of the standard targets are defined, even if they do nothing.
|
||||
regress:
|
||||
${TARGETS}: # ensure existence
|
||||
|
@ -1,14 +1,7 @@
|
||||
# $NetBSD: bsd.subdir.mk,v 1.45 2001/10/04 16:29:54 tv Exp $
|
||||
# $NetBSD: bsd.subdir.mk,v 1.46 2001/11/02 05:21:51 tv Exp $
|
||||
# @(#)bsd.subdir.mk 8.1 (Berkeley) 6/8/93
|
||||
|
||||
.if !target(__initialized__)
|
||||
__initialized__:
|
||||
.if exists(${.CURDIR}/../Makefile.inc)
|
||||
.include "${.CURDIR}/../Makefile.inc"
|
||||
.endif
|
||||
.include <bsd.own.mk>
|
||||
.MAIN: all
|
||||
.endif
|
||||
.include <bsd.init.mk>
|
||||
|
||||
.for dir in ${SUBDIR}
|
||||
.if exists(${dir}.${MACHINE})
|
||||
@ -59,5 +52,4 @@ ${targ}: subdir-${targ}
|
||||
.endif
|
||||
.endfor
|
||||
|
||||
# Make sure all of the standard targets are defined, even if they do nothing.
|
||||
${TARGETS}:
|
||||
${TARGETS}: # ensure existence
|
||||
|
Loading…
Reference in New Issue
Block a user