-bup
-bup-*
+/bup
+/bup-*
randomgen
memtest
*.o
--- /dev/null
+*.[0-9]
+*.html
--- /dev/null
+PANDOC:=$(shell \
+ if pandoc </dev/null 2>/dev/null; then \
+ echo pandoc; \
+ else \
+ echo "Warning: pandoc not installed; can't generate manpages." >&2; \
+ echo '@echo Skipping: pandoc'; \
+ fi)
+BUP_VERSION=$(shell git describe --match 'bup-*' | sed 's/^bup-//')
+BUP_DATE=$(shell git log --no-walk --pretty='%ci%n' | (read x y && echo $$x))
+
+default: all
+
+all: man html
+
+man: $(patsubst %.md,%,$(wildcard *.md))
+
+html: $(patsubst %.1.md,%.html,$(wildcard *.md))
+
+%: %.md.tmp Makefile
+ $(PANDOC) -s -r markdown -w man -o $@ $<
+
+%.html: %.1.md.tmp Makefile
+ $(PANDOC) -s -r markdown -w html -o $@ $<
+
+.PRECIOUS: %.1.md.tmp
+%.md.tmp: %.md Makefile
+ rm -f $@ $@.new
+ sed -e 's,%BUP_VERSION%,${BUP_VERSION},g' \
+ -e 's,%BUP_DATE%,${BUP_DATE},g' <$< >$@.new
+ mv $@.new $@
+
+clean:
+ rm -f *~ .*~ *.[0-9] *.new *.tmp *.html
--- /dev/null
+% bup(1) Bup %BUP_VERSION%
+% Avery Pennarun <apenwarr@gmail.com>
+% %BUP_DATE%
+
+# NAME
+
+bup - Backup program using rolling checksums and git file formats
+
+# SYNOPSIS
+
+bup [*options*] [*input-file*]...
+
+# DESCRIPTION
+
+This is the sample description.
+
+ embeddeded code
+ more code
+
+More stuff.
+
+## Subsection
+
+Yay!
+
+- this is a list.
+
+- another list item.
+
+ list continuation.
+
+- another item.
+
+ with some code
+ and more code
+
+1. numbered item.
+
+1. another numbered item.
+
+ - with a list
+ - of items
+ - that say stuff
+
+1. yet another number.
+
+# OPTIONS
+
+-o, --output=*output*
+: the stuff about the term
+
+--hello
+: more stuff
+
+# SEE ALSO
+
+`git`(1) and the *README* file from the bup distribution.
+
+The home of bup is at <http://github.com/apenwarr/bup/>.
all: bup-split bup-join bup-save bup-init bup-server bup-index bup-tick \
bup-midx bup-fuse bup-ls bup-damage bup-fsck bup-margin bup-drecurse \
- bup memtest randomgen$(EXT) _hashsplit$(SOEXT)
+ bup memtest randomgen$(EXT) _hashsplit$(SOEXT) \
+ Documentation/all
+
+%/all:
+ $(MAKE) -C $* all
+
+%/clean:
+ $(MAKE) -C $* clean
randomgen$(EXT): randomgen.o
$(CC) $(CFLAGS) -o $@ $<
%.o: %.c
gcc -c -o $@ $< $(CPPFLAGS) $(CFLAGS)
-clean:
+clean: Documentation/clean
rm -f *.o *.so *.dll *.exe *~ .*~ *.pyc */*.pyc */*~ \
bup bup-* randomgen memtest \
out[12] out2[tc] tags[12] tags2[tc]