X-Git-Url: https://git.cyclocoop.org/?p=tool%2Fhledger.git;a=blobdiff_plain;f=doc%2FGNUmakefile;fp=doc%2FGNUmakefile;h=fc5343d4ee0b42ea73a7be1c7a638dbf39907dfb;hp=0000000000000000000000000000000000000000;hb=61f2b02106365640f1fed2d4c3e8a1a7236bdb4e;hpb=627dd26d4ab92cb46924101e2a27048b1c68c766 diff --git a/doc/GNUmakefile b/doc/GNUmakefile new file mode 100644 index 0000000..fc5343d --- /dev/null +++ b/doc/GNUmakefile @@ -0,0 +1,38 @@ +tool:=$(dir $(lastword $(MAKEFILE_LIST))) + +all: $(HOME)/.asciidoc/backends/slidy2 + +$(HOME)/.asciidoc/backends/slidy2: tool:=$(tool) +$(HOME)/.asciidoc/backends/slidy2: \ + $(tool)/.../lib/tool/asciidoc/backend/slidy2/install + $< + +tool/asciidoc := $(tool)/.../lib/tool/asciidoc +include $(tool/asciidoc)/GNUmakefile + +export VERSION:=$(patsubst v%,%,$(shell which git >/dev/null && \ + 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')) + +### lib +tool/lib/targets:=$(addprefix .../,$(shell cd ... && git config -f .gitmodules \ + --get-regexp submodule'\.lib/.*\.'path | \ + cut -d ' ' -f 2)) +.PHONY: $(tool/lib/targets) $(tool)/lib/all $(tool)/lib +$(tool/lib/targets): + cd "$(tool)"/... && git submodule update --init -- $(patsubst .../%,%,$@) + cd "$(tool)"/$@ && git checkout -f HEAD && git clean -dfx +$(tool)/.../lib: $(tool)/lib/all +$(tool)/.../lib/all: $(tool/lib/targets) +$(tool)/.../lib/tool/asciidoc/GNUmakefile: \ + $(if $(wildcard .../lib/tool/asciidoc/.git),,.../lib/tool/asciidoc) + + +### slidy +%.slidy.html: export ASCIIDOC_FLAGS+=-arevnumber="$(VERSION)" +%.slidy.html: export ASCIIDOC_FLAGS+=-atabsize=0 +%.slidy.html: export ASCIIDOC_FLAGS+=-alatexmath=0 + +$(patsubst %.ad,%.html,$(wildcard *.slidy.ad)): \ + $(tool/asciidoc)/conf/latexmath.conf \ + $(tool/asciidoc)/conf/vim.conf