]> arthur.barton.de Git - bup.git/blobdiff - Makefile
Adds documentation for bup-import-rsnapshot
[bup.git] / Makefile
index 65a8e3d8c22ace200b2abe915a1b0ef48c07889c..a9c8f04e2acb10ea055202568795af7835c04539 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -34,7 +34,7 @@ LIBDIR=$(DESTDIR)/usr/lib/bup
 install: all
        $(INSTALL) -d $(MANDIR)/man1 $(DOCDIR) $(BINDIR) \
                $(LIBDIR)/bup $(LIBDIR)/cmd $(LIBDIR)/tornado \
-               $(LIBDIR)/web
+               $(LIBDIR)/web $(LIBDIR)/web/static
        [ ! -e Documentation/.docs-available ] || \
          $(INSTALL) -m 0644 \
                Documentation/*.1 \
@@ -57,8 +57,11 @@ install: all
                lib/tornado/*.py \
                $(LIBDIR)/tornado
        $(INSTALL) -m 0644 \
-               lib/web/* \
-               $(LIBDIR)/web
+               lib/web/static/* \
+               $(LIBDIR)/web/static/
+       $(INSTALL) -m 0644 \
+               lib/web/*.html \
+               $(LIBDIR)/web/
 %/all:
        $(MAKE) -C $* all
 
@@ -116,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 \