diff options
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 110 |
1 files changed, 110 insertions, 0 deletions
diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..cc3f906 --- /dev/null +++ b/Makefile @@ -0,0 +1,110 @@ +# $Id: Makefile,v 1.29 2008-09-22 02:37:10 wohler Exp $ +# +# Makefile for MH-E documentation. +# +# Note: most changes to this file should also be mirrored in the Makefiles in +# $(TOP)/src and $(TOP)/contrib. +# +TOP = .. + +EMACS_SRC = $(TOP)/src/emacs/trunk + +DOC_DIR = doc/misc + +MH_E_DOC = $(DOC_DIR)/mh-e.texi + +MH_E_ETC_EMACS = \ + $(DOC_DIR)/ChangeLog \ + $(DOC_DIR)/gpl.texi \ + $(DOC_DIR)/doclicense.texi + +MH_E_ETC = ChangeLog Makefile README + +MH_E_DIST = $(MH_E_DOC) $(MH_E_ETC_EMACS) $(MH_E_ETC) + +MAKEINFOINFOFLAGS = -I $(DOC_DIR) --output info/mh-e + +MAKEINFOHTMLFLAGS = --html --output html + +TEXI2PDFFLAGS = --quiet --clean + +# +# User Targets +# + +all: $(MH_E_DOC) clean info html pdf + +$(MH_E_DOC): + ln -s $(EMACS_SRC)/doc + +clean: + $(RM) -r info html mh-e.html mh-e.pdf + +info: info/mh-e + +info/mh-e: $(MH_E_DOC) + [ -d info ] || mkdir info + $(RM) info/* + makeinfo $(MAKEINFOINFOFLAGS) $< + +html: html/index.html mh-e.html + +html/index.html: $(MH_E_DOC) + [ -d html ] || mkdir html + $(RM) html/* + makeinfo $(MAKEINFOHTMLFLAGS) $< + +mh-e.html: $(MH_E_DOC) + makeinfo --html --output $@ --no-split $< + +pdf: mh-e.pdf + +mh-e.pdf: $(MH_E_DOC) + texi2pdf $(TEXI2PDFFLAGS) $< + texi2pdf $(TEXI2PDFFLAGS) $< + +# +# Maintainer Targets +# + +# Tag the MH-E files that are checked out. +tag: + @if [ "$$TAG" = "" ]; then \ + echo "No tag found. Set TAG environment variable."; \ + exit 1; \ + fi + bzr tag $$TAG + bzr tag --directory $(EMACS_SRC) $$TAG + +# Create a distribution. +dist: $(MH_E_DOC) + @if [ "$$TAG" = "" ]; then \ + echo "No tag found. Set TAG environment variable."; \ + exit 1; \ + fi; \ + if ! bzr tags | grep -q $$TAG; then \ + echo "Tag $$TAG not found"; \ + exit 1; \ + fi; \ + tagVersion=`bzr tags | grep $$TAG | awk '{print $$2}'`; \ + workspaceVersion=`bzr version-info --custom --template="{revno}"`; \ + if [ $$tagVersion -ne $$workspaceVersion ]; then \ + echo "Tag $$TAG version $$tagVersion does not match workspace version $$workspaceVersion"; \ + exit 1; \ + fi; \ + LOG=/tmp/mh-e-doc.log; \ + bzr st > $$LOG; \ + if [ `cat $$LOG | wc -l` -gt 0 ]; then \ + echo "There may not be any uncommitted changes when creating a distribution"; \ + cat $$LOG; \ + exit 1; \ + fi; \ + echo "Building $$TAG..."; \ + rm -rf $$TAG; \ + mkdir $$TAG; \ + cp --parents $(MH_E_DIST) $$TAG; \ + tar -czhf $$TAG.tgz $$TAG + +# Update http://mh-e.sourceforge.net/manual/. +update-web-site: all + rsync -vaz --delete mh-e.html mh-e.pdf html $$USER,mh-e@web.sourceforge.net:doc |