]> arthur.barton.de Git - bup.git/blobdiff - Makefile
Merge branch 'bl/dumbserver' into next
[bup.git] / Makefile
index 531afecd49d122edf6ce0f3cb07d241c8611be17..3194a06dde72d05d7293b8fb10caacb3af02c7ae 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -34,31 +34,34 @@ 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 \
-               $(wildcard Documentation/*.1) \
+               Documentation/*.1 \
                $(MANDIR)/man1
        [ ! -e Documentation/.docs-available ] || \
          $(INSTALL) -m 0644 \
-               $(wildcard Documentation/*.html) \
+               Documentation/*.html \
                $(DOCDIR)
        $(INSTALL) -m 0755 bup $(BINDIR)
        $(INSTALL) -m 0755 \
-               $(wildcard cmd/bup-*) \
+               cmd/bup-* \
                $(LIBDIR)/cmd
        $(INSTALL) -m 0644 \
-               $(wildcard lib/bup/*.py) \
+               lib/bup/*.py \
                $(LIBDIR)/bup
        $(INSTALL) -m 0755 \
-               $(wildcard lib/bup/*$(SOEXT)) \
+               lib/bup/*$(SOEXT) \
                $(LIBDIR)/bup
        $(INSTALL) -m 0644 \
-               $(wildcard lib/tornado/*.py) \
+               lib/tornado/*.py \
                $(LIBDIR)/tornado
        $(INSTALL) -m 0644 \
-               $(wildcard lib/web/*) \
-               $(LIBDIR)/web
+               lib/web/static/* \
+               $(LIBDIR)/web/static/
+       $(INSTALL) -m 0644 \
+               lib/web/*.html \
+               $(LIBDIR)/web/
 %/all:
        $(MAKE) -C $* all
 
@@ -100,7 +103,9 @@ bup: main.py
        rm -f $@
        ln -s $< $@
 
-cmds: $(patsubst cmd/%-cmd.py,cmd/bup-%,$(wildcard cmd/*-cmd.py))
+cmds: \
+    $(patsubst cmd/%-cmd.py,cmd/bup-%,$(wildcard cmd/*-cmd.py)) \
+    $(patsubst cmd/%-cmd.sh,cmd/bup-%,$(wildcard cmd/*-cmd.sh))
 
 cmd/bup-%: cmd/%-cmd.py
        rm -f $@
@@ -114,8 +119,41 @@ bup-%: cmd-%.sh
        rm -f $@
        ln -s $< $@
 
+cmd/bup-%: cmd/%-cmd.sh
+       rm -f $@
+       ln -s $*-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 \