X-Git-Url: https://git.distorted.org.uk/~mdw/stgit/blobdiff_plain/bd1f46edab3496bf1da9dd3c09b5e6b043d44c37..d34d6e351e9708f4a5ce519e508abbc418285b5e:/Documentation/Makefile diff --git a/Documentation/Makefile b/Documentation/Makefile index a7e0f44..dd029d5 100644 --- a/Documentation/Makefile +++ b/Documentation/Makefile @@ -1,18 +1,20 @@ -MAN1_TXT=$(wildcard stg*.txt) +COMMANDS = $(shell ../stg-build --commands) +COMMANDS_TXT = $(patsubst %,stg-%.txt,$(COMMANDS)) + +MAN1_TXT= stg.txt $(COMMANDS_TXT) DOC_HTML=$(patsubst %.txt,%.html,$(MAN1_TXT)) -ARTICLES = -# with their own formatting rules. -SP_ARTICLES = tutorial +ARTICLES = tutorial -DOC_HTML += $(patsubst %,%.html,$(ARTICLES) $(SP_ARTICLES)) -DOC_PDF += $(patsubst %,%.pdf,$(ARTICLES) $(SP_ARTICLES)) +DOC_HTML += $(patsubst %,%.html,$(ARTICLES)) +DOC_PDF += $(patsubst %,%.pdf,$(ARTICLES)) DOC_MAN1=$(patsubst %.txt,%.1,$(MAN1_TXT)) prefix?=$(HOME) -mandir?=$(prefix)/man +htmldir?=$(prefix)/share/doc/stgit +mandir?=$(prefix)/share/man man1dir=$(mandir)/man1 # DESTDIR= @@ -41,6 +43,10 @@ man1: $(DOC_MAN1) install: man $(INSTALL) -d -m755 $(DESTDIR)$(man1dir) $(INSTALL) -m644 $(DOC_MAN1) $(DESTDIR)$(man1dir) + +install-html: html + $(INSTALL) -d -m755 $(DESTDIR)$(htmldir) + $(INSTALL) -m644 $(DOC_HTML) $(DESTDIR)$(htmldir) # # Determine "include::" file references in asciidoc files. # @@ -52,7 +58,15 @@ doc.dep : $(wildcard *.txt) build-docdep.perl -include doc.dep clean: - rm -f *.xml *.html *.pdf *.1 doc.dep + rm -f *.xml *.html *.pdf *.1 doc.dep $(COMMANDS_TXT) command-list.txt + +ALL_PY = $(shell find ../stgit -name '*.py') + +$(COMMANDS_TXT): $(ALL_PY) + ../stg-build --asciidoc $(basename $(subst stg-,,$@)) > $@ + +command-list.txt: $(ALL_PY) + ../stg-build --cmd-list > $@ %.html : %.txt $(ASCIIDOC) -b xhtml11 -d manpage -f asciidoc.conf $(ASCIIDOC_EXTRA) $< @@ -68,6 +82,7 @@ clean: # special formatting rules tutorial.html : %.html : %.txt - $(ASCIIDOC) -b xhtml11 -d article -f tutorial.conf $(ASCIIDOC_EXTRA) $< + $(ASCIIDOC) -b xhtml11 -d article -a toc -f tutorial.conf \ + $(ASCIIDOC_EXTRA) $< tutorial.xml : %.xml : %.txt $(ASCIIDOC) -b docbook -d article -f tutorial.conf $<