X-Git-Url: https://git.distorted.org.uk/~mdw/tig/blobdiff_plain/a74fa1900a65384bc4140fe45a55877bc981b185..a7bc4b1447f974fbbe400c3657d9ec3d0fda133e:/Makefile diff --git a/Makefile b/Makefile index eec1e03..efeca0d 100644 --- a/Makefile +++ b/Makefile @@ -1,12 +1,31 @@ LDFLAGS = -lcurses CFLAGS = -g +PROGS = cgit +DOCS = cgit.1.txt cgit.1 cgit.1.html -all: cgit +all: $(PROGS) +docs: $(DOCS) install: all - install cgit $(HOME)/bin + for prog in $(PROGS); do \ + install $$prog $(HOME)/bin; \ + done clean: - rm -f cgit + rm -f $(PROGS) $(DOCS) cgit: cgit.c + +cgit.1.txt: cgit.c + sed -n '/\*\*/,/\*\*/p' < $< | \ + sed '/\*\*/d' | \ + sed -n 's/^ \* *//p' > $@ + +%.1.html : %.1.txt + asciidoc -b xhtml11 -d manpage -f asciidoc.conf $< + +%.1.xml : %.1.txt + asciidoc -b docbook -d manpage -f asciidoc.conf $< + +%.1 : %.1.xml + xmlto man $<