From 318b866da7ea78dbb0b69295e6a2d2b4ac49bebf Mon Sep 17 00:00:00 2001 From: Avery Pennarun Date: Mon, 8 Nov 2010 22:05:54 -0800 Subject: [PATCH] Add make export-docs/push-docs/import-docs targets. export-docs: update local 'man' and 'html' branches with pregenerated doc files. push-docs: push those to origin/man and origin/html. import-docs: extract the documentation from origin/man and origin/html into the local tree so it can be installed. Signed-off-by: Avery Pennarun --- Makefile | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/Makefile b/Makefile index 0faf8a6..a9c8f04 100644 --- a/Makefile +++ b/Makefile @@ -119,6 +119,35 @@ bup-%: cmd-%.sh %.o: %.c gcc -c -o $@ $< $(CPPFLAGS) $(CFLAGS) + +# update the local 'man' and 'html' branches with pregenerated output files, for +# people who don't have pandoc (and maybe to aid in google searches or something) +export-docs: Documentation/all + git update-ref refs/heads/man origin/man '' 2>/dev/null || true + git update-ref refs/heads/html origin/html '' 2>/dev/null || true + GIT_INDEX_FILE=gitindex.tmp; export GIT_INDEX_FILE; \ + rm -f $${GIT_INDEX_FILE} && \ + git add -f Documentation/*.1 && \ + git update-ref refs/heads/man \ + $$(echo "Autogenerated man pages for $$(git describe)" \ + | git commit-tree $$(git write-tree --prefix=Documentation) \ + -p refs/heads/man) && \ + rm -f $${GIT_INDEX_FILE} && \ + git add -f Documentation/*.html && \ + git update-ref refs/heads/html \ + $$(echo "Autogenerated html pages for $$(git describe)" \ + | git commit-tree $$(git write-tree --prefix=Documentation) \ + -p refs/heads/html) + +# push the pregenerated doc files to origin/man and origin/html +push-docs: export-docs + git push origin man html + +# import pregenerated doc files from origin/man and origin/html, in case you +# don't have pandoc but still want to be able to install the docs. +import-docs: Documentation/clean + git archive origin/html | (cd Documentation; tar -xvf -) + git archive origin/man | (cd Documentation; tar -xvf -) clean: Documentation/clean rm -f *.o lib/*/*.o *.so lib/*/*.so *.dll *.exe \ -- 2.39.2