diff --git a/doc/.gitignore b/doc/.gitignore index dfd019421..2cb6f5896 100644 --- a/doc/.gitignore +++ b/doc/.gitignore @@ -14,4 +14,10 @@ Guidebook.pdf Guidebook.ps Guidebook.dated.* *.synctex.* - +# files that might appear from "make fetch-docs" +dlb.pdf +makedefs.pdf +mn.pdf +mnh.pdf +nethack.pdf +recover.pdf diff --git a/doc/fixes3-7-0.txt b/doc/fixes3-7-0.txt index befaae8f6..7dd26ce21 100644 --- a/doc/fixes3-7-0.txt +++ b/doc/fixes3-7-0.txt @@ -2766,6 +2766,7 @@ healers gain experience by healing pets blessed scroll of destroy armor asks which armor to destroy archeologists' fedora is lucky telepathic hero can discern which particular monster just read a scroll +add "make fetch-docs" to download pre-formatted documentation Platform- and/or Interface-Specific New Features diff --git a/sys/unix/Makefile.top b/sys/unix/Makefile.top index 3d7b54727..f3bb66d23 100644 --- a/sys/unix/Makefile.top +++ b/sys/unix/Makefile.top @@ -397,6 +397,25 @@ fetch-lua-http: tar zxf lua-$(LUA_VERSION).tar.gz && \ rm -f lua-$(LUA_VERSION).tar.gz ) +# +# This is not part of the dependency build hierarchy. +# It requires an explicit "make fetch-docs". +fetch-docs: + @FDroot=https://www.nethack.org; \ + FDvmajor=`awk '/VERSION_MAJOR/{print $$3}' < include/patchlevel.h`; \ + FDvminor=`awk '/VERSION_MINOR/{print $$3}' < include/patchlevel.h`; \ + RDIR="NetHack-$${FDvmajor}.$${FDvminor}"; \ + echo "Fetching directory information for $${RDIR}"; \ + RDOCFILES=`curl --no-progress-meter $${FDroot}/cgi-bin/lsautodocs?$$RDIR`; \ + FDbase="$${FDroot}/autodocs/$${RDIR}"; \ + set -- $${RDOCFILES}; \ + echo "Fetching $$# files"; \ + while [ $$# -gt 0 ]; do \ + echo "Downloading: '$$1' from '$${FDbase}/$$1'"; \ + curl --no-progress-meter -R $${FDbase}/$$1 -o doc/$$1; \ + shift; \ + done + # 'make update' can be used to install a revised version after making # customizations or such. Unlike 'make install', it doesn't delete everything # from the target directory to have a clean start.