couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kxe...@apache.org
Subject [2/2] documentation commit: updated refs/heads/master to fef8f92
Date Sat, 22 Aug 2015 11:41:13 GMT
Replace read time checks with run time ones

ifeq being processed on Makefile read so it's not possible to build
html version of docs or someone else without having all toolchain
installed. Since TeX one is quite big (up to 2.6GiB on some systems)
it makes work on documentation kind of pain.


Project: http://git-wip-us.apache.org/repos/asf/couchdb-documentation/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-documentation/commit/e2135d26
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-documentation/tree/e2135d26
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-documentation/diff/e2135d26

Branch: refs/heads/master
Commit: e2135d26b644df17af61e32a52453a4f489ed57a
Parents: 18cc926
Author: Alexander Shorin <kxepal@apache.org>
Authored: Sat Aug 8 21:39:54 2015 +0300
Committer: Alexander Shorin <kxepal@apache.org>
Committed: Sat Aug 22 14:40:31 2015 +0300

----------------------------------------------------------------------
 Makefile | 48 +++++++++++++++++++++++++++++++-----------------
 1 file changed, 31 insertions(+), 17 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-documentation/blob/e2135d26/Makefile
----------------------------------------------------------------------
diff --git a/Makefile b/Makefile
index 02773bb..9562857 100644
--- a/Makefile
+++ b/Makefile
@@ -11,12 +11,22 @@
 ## the License.
 
 SPHINXBUILD  := sphinx-build
+TEX          := tex
+PDFLATEX     := pdflatex
+MAKEINFO     := makeinfo
+
 BUILDDIR     := build
 SOURCE       := src/
 PAPERSIZE    := -D latex_paper_size=a4
 SPHINXFLAGS  := -a -E -W -n -A local=1 $(PAPERSIZE) -d $(BUILDDIR)/doctree
 SPHINXOPTS   := $(SPHINXFLAGS) $(SOURCE)
 
+ENSURECMD=\
+if [[ $(shell which $(1) > /dev/null 2>&1; echo $$?) -eq 1 ]]; then \
+  echo "*** Make sure that $(1) is installed and on your path" && exit 1; \
+fi
+
+
 all: html pdf info man
 
 clean:
@@ -24,40 +34,28 @@ clean:
 
 html: build/html
 
-build/html:
-    ifeq ($(shell which $(SPHINXBUILD) >/dev/null 2>&1; echo $$?), 1)
-    $(error ensure that $(SPHINXBUILD) is installed and on your path)
-    endif
+build/html: $(SPHINXBUILD)
 	$(SPHINXBUILD) -b html $(SPHINXOPTS) $(BUILDDIR)/html
 
 latex: build/latex
 
-build/latex:
-    ifeq ($(shell which tex >/dev/null 2>&1; echo $$?), 1)
-    $(error ensure that tex is installed and on your path)
-    endif
+build/latex: $(SPHINXBUILD) $(TEX)
 	$(SPHINXBUILD) -b latex $(SPHINXOPTS) $(BUILDDIR)/latex
 
 pdf: latex build/latex/CouchDB.pdf
 
-build/latex/CouchDB.pdf:
-    ifeq ($(shell which pdflatex >/dev/null 2>&1; echo $$?), 1)
-    $(error ensure that pdflatex is installed and on your path)
-    endif
+build/latex/CouchDB.pdf: $(PDFLATEX)
 	$(MAKE) -C $(BUILDDIR)/latex all-pdf
 
 info: build/texinfo
 
-build/texinfo:
-    ifeq ($(shell which makeinfo >/dev/null 2>&1; echo $$?), 1)
-    $(error ensure that makeinfo is installed and on your path)
-    endif
+build/texinfo: $(SPHINXBUILD) $(MAKEINFO)
 	$(SPHINXBUILD) -b texinfo $(SPHINXOPTS) $(BUILDDIR)/texinfo
 	make -C $(BUILDDIR)/texinfo info
 
 man: build/man
 
-build/man:
+build/man: $(SPHINXBUILD)
 	$(SPHINXBUILD) -b man $(SPHINXOPTS) $(BUILDDIR)/man
 
 check:
@@ -73,3 +71,19 @@ install: install-html install-pdf install-info install-man
 
 distclean: clean
 	# delete-installed-files
+
+
+$(SPHINXBUILD):
+	@$(call ENSURECMD,$@)
+
+$(TEX):
+	@$(call ENSURECMD,$@)
+
+$(PDFLATEX):
+	@$(call ENSURECMD,$@)
+
+$(MAKEINFO):
+	@$(call ENSURECMD,$@)
+
+$(PYTHON):
+	@$(call ENSURECMD,$@)


Mime
View raw message