summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile36
-rw-r--r--mk/bsd.pkg.subdir.mk8
2 files changed, 40 insertions, 4 deletions
diff --git a/Makefile b/Makefile
index a68095f5c67..77528f5bf31 100644
--- a/Makefile
+++ b/Makefile
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.50 2002/12/15 02:49:37 salo Exp $
+# $NetBSD: Makefile,v 1.51 2003/01/05 13:37:15 dmcmahill Exp $
#
.include "mk/bsd.prefs.mk"
@@ -51,6 +51,40 @@ SUBDIR += x11
PKGSRCTOP= yes
+
+# If PACKAGES is set to the default (${_PKGSRCDIR}/packages), the current
+# ${MACHINE_ARCH} and "release" (uname -r) will be used. Otherwise a directory
+# structure of ...pkgsrc/packages/`uname -r`/${MACHINE_ARCH} is assumed.
+# The PKG_URL is set from FTP_PKG_URL_* or CDROM_PKG_URL_*, depending on
+# the target used to generate the README.html file.
+.PHONY: README.html
+_README_TYPE_FLAG?= none
+README.html: .PRECIOUS
+.if ${_README_TYPE_FLAG} == "--ftp" || ${_README_TYPE_FLAG} == "--cdrom"
+ @if [ -e ${PACKAGES} ]; then \
+ cd ${PACKAGES}; \
+ case `pwd` in \
+ ${.CURDIR}/packages) \
+ MULTIARCH=; \
+ ;; \
+ *) \
+ MULTIARCH=--multi-arch; \
+ ;; \
+ esac; \
+ cd ${.CURDIR} ; \
+ fi; \
+ ${ENV} TMPDIR=${TMPDIR:U/tmp}/mkreadme \
+ BMAKE=${MAKE} AWK=${AWK} EXPR=${EXPR} \
+ ./mk/scripts/mkreadme --pkgsrc ${.CURDIR} \
+ --packages ${PACKAGES} ${_README_TYPE_FLAG} $$MULTIARCH \
+ --prune
+.else
+ @${ECHO} "ERROR: please do not use the README.html target directly."
+ @${ECHO} " Instead use either the \"readme\" or \"cdrom-readme\""
+ @${ECHO} " target."
+ @${FALSE}
+.endif
+
.include "mk/bsd.pkg.subdir.mk"
# the bulk-cache and clean-bulk-cache targets are a global-pkgsrc
diff --git a/mk/bsd.pkg.subdir.mk b/mk/bsd.pkg.subdir.mk
index 31bbbfd8c0a..319e3e047b0 100644
--- a/mk/bsd.pkg.subdir.mk
+++ b/mk/bsd.pkg.subdir.mk
@@ -1,4 +1,4 @@
-# $NetBSD: bsd.pkg.subdir.mk,v 1.49 2002/10/20 22:19:22 wiz Exp $
+# $NetBSD: bsd.pkg.subdir.mk,v 1.50 2003/01/05 13:37:16 dmcmahill 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
#
@@ -114,13 +114,13 @@ readmes: readme _SUBDIRUSE
.if !target(readme)
readme:
@if [ -f README.html ]; then ${MV} -f README.html README.html.BAK ; fi
- @${MAKE} ${MAKEFLAGS} README.html _README_TYPE=$@
+ @${MAKE} ${MAKEFLAGS} README.html _README_TYPE_FLAG=--ftp _README_TYPE=$@
.endif
.if !target(cdrom-readme)
cdrom-readme:
@if [ -f README.html ]; then ${MV} -f README.html README.html.BAK ; fi
- @${MAKE} ${MAKEFLAGS} README.html _README_TYPE=$@
+ @${MAKE} ${MAKEFLAGS} README.html _README_TYPE_FLAG=--cdrom README_TYPE=$@
.endif
.if defined(PKGSRCTOP)
@@ -131,6 +131,7 @@ README= ../templates/README.category
HTMLIFY= ${SED} -e 's/&/\&amp;/g' -e 's/>/\&gt;/g' -e 's/</\&lt;/g'
+.if !target(README.html)
README.html: .PRECIOUS
@> $@.tmp
.for entry in ${SUBDIR}
@@ -169,6 +170,7 @@ README.html: .PRECIOUS
.for subdir in ${SUBDIR}
@cd ${subdir} && ${MAKE} ${MAKEFLAGS} "_THISDIR_=${_THISDIR_}${.CURDIR:T}/" ${_README_TYPE}
.endfor
+.endif
show-comment:
@if [ "${COMMENT}" ]; then \