Ajout : doc/
[tool/hledger.git] / doc / make
diff --git a/doc/make b/doc/make
new file mode 100644 (file)
index 0000000..baa921c
--- /dev/null
+++ b/doc/make
@@ -0,0 +1,27 @@
+#!/bin/sh -efux
+tool=$(readlink -e "${0%/*}"/...)
+
+VERSION=$(which git >/dev/null &&
+       cd "$tool" &&
+       git describe --tags --match 'v[0-9][0-9][0-9][0-9].[0-9][0-9].[0-9][0-9]' --always ||
+       TZ=UTC date +'v%Y.%m.%d')
+VERSION=git://git.autogeree.net/tool/hledger
+
+if test ! -e "$tool"/lib/tool/asciidoc/.git
+ then
+       (cd "$tool" && git submodule update --init --recursive -- lib/tool/asciidoc)
+       (cd "$tool"/lib/tool/asciidoc/ && git checkout -f HEAD && git clean -dfx)
+ fi
+
+MAKE=$(which gmake >/dev/null && echo gmake || echo make)
+
+cd "${0%/*}"
+VERSION=${VERSION#v} \
+ASCIIDOC_FLAGS="${ASCIIDOC_FLAGS:+$ASCIIDOC_FLAGS }-a revnumber=$VERSION -a tabsize=0 -a latexmath" \
+conf=etc \
+SRCDIR=. \
+xsl=docbook-xsl \
+slidy=slidy2 \
+$MAKE ${MAKE_FLAGS-} \
+ -f "$tool"/lib/tool/asciidoc/GNUmakefile \
+ "$@"