summaryrefslogtreecommitdiff
path: root/mk/bsd.pkg.subdir.mk
diff options
context:
space:
mode:
Diffstat (limited to 'mk/bsd.pkg.subdir.mk')
-rw-r--r--mk/bsd.pkg.subdir.mk62
1 files changed, 35 insertions, 27 deletions
diff --git a/mk/bsd.pkg.subdir.mk b/mk/bsd.pkg.subdir.mk
index f5a4ea67c4a..f9c4d2aa9f3 100644
--- a/mk/bsd.pkg.subdir.mk
+++ b/mk/bsd.pkg.subdir.mk
@@ -1,4 +1,4 @@
-# $NetBSD: bsd.pkg.subdir.mk,v 1.20 1998/07/26 03:25:54 lukem Exp $
+# $NetBSD: bsd.pkg.subdir.mk,v 1.21 1998/09/23 13:09:33 agc Exp $
# Derived from: FreeBSD Id: bsd.port.subdir.mk,v 1.19 1997/03/09 23:10:56 wosch Exp
# from: @(#)bsd.subdir.mk 5.9 (Berkeley) 2/1/91
#
@@ -13,9 +13,6 @@
# own install script so that the entire system can be made
# stripped/not-stripped using a single knob. [-s]
#
-# ECHO_MSG Used to print all the '===>' style prompts - override this
-# to turn them off [echo].
-#
# OPSYS Get the operating system type [`uname -s`]
#
# SUBDIR A list of subdirectories that should be built as well.
@@ -45,7 +42,12 @@ STRIPFLAG?= -s
OPSYS!= uname -s
.endif
-ECHO_MSG?= echo
+BASENAME?= /usr/bin/basename
+ECHO?= /bin/echo
+MV?= /bin/mv
+RM?= /bin/rm
+SED?= /usr/bin/sed
+SORT?= /usr/bin/sort
_SUBDIRUSE: .USE
@for entry in ${SUBDIR}; do \
@@ -53,25 +55,25 @@ _SUBDIRUSE: .USE
for dud in $$DUDS; do \
if [ $${dud} = $${entry} ]; then \
OK="false"; \
- ${ECHO_MSG} "===> ${_THISDIR_}$${entry} skipped"; \
+ ${ECHO} "===> ${_THISDIR_}$${entry} skipped"; \
fi; \
done; \
- if test -d ${.CURDIR}/$${entry}.${MACHINE}; then \
+ if [ -d ${.CURDIR}/$${entry}.${MACHINE} ]; then \
edir=$${entry}.${MACHINE}; \
- elif test -d ${.CURDIR}/$${entry}; then \
+ elif [ -d ${.CURDIR}/$${entry} ]; then \
edir=$${entry}; \
else \
OK="false"; \
- ${ECHO_MSG} "===> ${_THISDIR_}$${entry} non-existent"; \
+ ${ECHO} "===> ${_THISDIR_}$${entry} non-existent"; \
fi; \
if [ "$$OK" = "" ]; then \
cd ${.CURDIR}/$${edir}; \
if [ -z "${_THISDIR_}" -a ! -d "files" ]; then \
- ${ECHO_MSG} "===> category ${_THISDIR_}$${edir}"; \
+ ${ECHO} "===> category ${_THISDIR_}$${edir}"; \
${MAKE} ${.TARGET:realinstall=install} \
"_THISDIR_=${_THISDIR_}$${edir}/"; \
else \
- ${ECHO_MSG} "===> package ${_THISDIR_}$${edir}"; \
+ ${ECHO} "===> package ${_THISDIR_}$${edir}"; \
${MAKE} ${.TARGET:realinstall=install} \
"_THISDIR_=${_THISDIR_}$${edir}/" || /usr/bin/true ; \
fi ; \
@@ -79,7 +81,7 @@ _SUBDIRUSE: .USE
done
${SUBDIR}::
- @if test -d ${.TARGET}.${MACHINE}; then \
+ @if [ -d ${.TARGET}.${MACHINE} ]; then \
cd ${.CURDIR}/${.TARGET}.${MACHINE}; \
else \
cd ${.CURDIR}/${.TARGET}; \
@@ -112,8 +114,14 @@ readmes: readme _SUBDIRUSE
.if !target(readme)
readme:
- @if [ -f README.html ]; then mv -f README.html README.html.BAK ; fi
- @${MAKE} README.html
+ @if [ -f README.html ]; then ${MV} -f README.html README.html.BAK ; fi
+ @${MAKE} README.html _README_TYPE=$@
+.endif
+
+.if !target(cdrom-readme)
+cdrom-readme:
+ @if [ -f README.html ]; then ${MV} -f README.html README.html.BAK ; fi
+ @${MAKE} README.html _README_TYPE=$@
.endif
.if defined(PKGSRCTOP)
@@ -122,44 +130,44 @@ README= templates/README.top
README= ../templates/README.category
.endif
-HTMLIFY= sed -e 's/&/\&amp;/g' -e 's/>/\&gt;/g' -e 's/</\&lt;/g'
+HTMLIFY= ${SED} -e 's/&/\&amp;/g' -e 's/>/\&gt;/g' -e 's/</\&lt;/g'
README.html: .PRECIOUS
@> $@.tmp
.for entry in ${SUBDIR}
.if defined(PKGSRCTOP)
- @echo -n '<TR><TD VALIGN=TOP><a href="'${entry}/README.html'">'"`echo ${entry} | ${HTMLIFY}`"'</a>: <TD>' >> $@.tmp
+ @${ECHO} -n '<TR><TD VALIGN=TOP><a href="'${entry}/README.html'">'"`${ECHO} ${entry} | ${HTMLIFY}`"'</a>: <TD>' >> $@.tmp
.else
- @echo -n '<TR><TD VALIGN=TOP><a href="'${entry}/README.html'">'"`cd ${entry}; ${MAKE} package-name | ${HTMLIFY}`</a>: <TD>" >> $@.tmp
+ @${ECHO} -n '<TR><TD VALIGN=TOP><a href="'${entry}/README.html'">'"`cd ${entry}; ${MAKE} package-name | ${HTMLIFY}`</a>: <TD>" >> $@.tmp
.endif
.if exists(${entry}/pkg/COMMENT)
@${HTMLIFY} ${entry}/pkg/COMMENT >> $@.tmp
.else
- @echo "(no description)" >> $@.tmp
+ @${ECHO} "(no description)" >> $@.tmp
.endif
.endfor
- @sort -t '>' +3 -4 $@.tmp > $@.tmp2
+ @${SORT} -t '>' +3 -4 $@.tmp > $@.tmp2
.if exists(${.CURDIR}/pkg/DESCR)
@${HTMLIFY} ${.CURDIR}/pkg/DESCR > $@.tmp3
.else
@> $@.tmp3
.endif
@cat ${README} | \
- sed -e 's/%%CATEGORY%%/'"`basename ${.CURDIR}`"'/g' \
+ ${SED} -e 's/%%CATEGORY%%/'"`${BASENAME} ${.CURDIR}`"'/g' \
-e '/%%DESCR%%/r$@.tmp3' \
-e '/%%DESCR%%/d' \
-e '/%%SUBDIR%%/r$@.tmp2' \
-e '/%%SUBDIR%%/d' \
> $@.tmp4
@if cmp -s $@.tmp4 $@.BAK ; then \
- mv $@.BAK $@ ; \
- rm $@.tmp4 ; \
+ ${MV} $@.BAK $@ ; \
+ ${RM} $@.tmp4 ; \
else \
- ${ECHO_MSG} "===> Creating README.html for ${_THISDIR_}${.CURDIR:T}" ; \
- mv $@.tmp4 $@ ; \
- rm -f $@.BAK ; \
+ ${ECHO} "===> Creating README.html for ${_THISDIR_}${.CURDIR:T}" ; \
+ ${MV} $@.tmp4 $@ ; \
+ ${RM} -f $@.BAK ; \
fi
- @rm -f $@.tmp $@.tmp2 $@.tmp3
+ @${RM} -f $@.tmp $@.tmp2 $@.tmp3
.for subdir in ${SUBDIR}
- @cd ${subdir} && ${MAKE} "_THISDIR_=${_THISDIR_}${.CURDIR:T}/" readme
+ @cd ${subdir} && ${MAKE} "_THISDIR_=${_THISDIR_}${.CURDIR:T}/" ${_README_TYPE}
.endfor