2 tool
=$
(readlink
-e "${0%/*}"/...
)
4 VERSION
=$
(which git
>/dev
/null
&&
6 git describe
--tags --match 'v[0-9][0-9][0-9][0-9].[0-9][0-9].[0-9][0-9]' --always ||
7 TZ
=UTC
date +'v%Y.%m.%d')
8 VERSION
=git
://git.autogeree.net
/tool
/hledger
10 if test ! -e "$tool"/lib
/tool
/asciidoc
/.git
12 (cd "$tool" && git submodule update
--init --recursive -- lib
/tool
/asciidoc
)
13 (cd "$tool"/lib
/tool
/asciidoc
/ && git checkout
-f HEAD
&& git clean
-dfx)
16 MAKE
=$
(which gmake
>/dev
/null
&& echo gmake ||
echo make)
19 VERSION
=${VERSION#v} \
20 ASCIIDOC_FLAGS
="${ASCIIDOC_FLAGS:+$ASCIIDOC_FLAGS }-a revnumber=$VERSION -a tabsize=0 -a latexmath" \
25 $MAKE ${MAKE_FLAGS-} \
26 -f "$tool"/lib
/tool
/asciidoc
/GNUmakefile \