summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authordmcmahill <dmcmahill>2003-01-05 13:37:15 +0000
committerdmcmahill <dmcmahill>2003-01-05 13:37:15 +0000
commit0aa05351cb21f723f88ac221655a3cd3f654323f (patch)
tree16a15455a519acc4bd13fe42989df328675c70a2 /Makefile
parent774328e97a50c605a347274e7c3f2696ff213839 (diff)
downloadpkgsrc-0aa05351cb21f723f88ac221655a3cd3f654323f.tar.gz
Switch the top level pkgsrc 'readme' and 'cdrom-readme' targets to use the
new and much more efficient code. Previously a 'make readme' took over 3 weeks on my SS5 and now takes < 3 hours. The number of make calls has been reduced from somewhere over 1,000,000 to one per package which is around 3,000. The mk/scripts/mkreadme script does all the work now. This script has been used in standalone form for a month or two on ftp.netbsd.org and has had no problem.
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile36
1 files changed, 35 insertions, 1 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