- # Build a release of 'tsearchpath' using 'make'
- # $Id: makefile,v 1.108 2012/06/09 19:32:50 tundra Exp $
- # Requires a modern 'make' like GNU.
- # Uncomment One Of The Following For Early Releases
- #EARLY = Alpha
- #EARLY = Beta
- #EARLY = RC1
- #####
- # Definitions Relevant To This Program
- #####
- PROGNAME = tsearchpath
- PROGMAIN = tsearchpath.py
- PROGFILES = ${PROGMAIN} setup.py testpath.py
- PROGDOCS = ${PROGMAIN}.ps
- DOCS = tsearchpath-license.txt \
- ${PROGNAME}.3.gz \
- ${PROGNAME}.html \
- ${PROGNAME}.pdf \
- ${PROGNAME}.ps \
- ${PROGNAME}.rst \
- ${PROGNAME}.txt \
- testpath.py.ps \
- CHANGELOG.txt \
- Makefile \
- #####
- # Nothing Should Need To Change Below This Line
- #####
- DIR = ${PROGNAME}-${VERSION}
- HEADER1 = "WHATSNEW For '${PROGNAME}' ${VERSION} (`date`)"
- HEADER2 = "----------------------------------------------------------------------"
- RELEASES = "Releases"
- TARBALL = ${DIR}.tar.gz
- TMPFILE = tmpfile
- VERSION = $(shell cvs log ${PROGMAIN} | grep ^head\: | cut -f2 -d " ")${EARLY}
- #####
- # Pattern Rules
- #####
- ###
- # Document Production
- ###
- # Some Docutils installations keep the ".py" suffix for the various
- # frontend programs, and some do not. It's even possible there are
- # links from one to the other. Since the project can be checked out
- # on any platform, we have to check for this every time we run the
- # 'make'. This is irritating.
- 2HTML = $(shell which rst2html.py rst2html 2>/dev/null | head -n 1)
- 2LATEX = $(shell which rst2latex.py rst2latex 2>/dev/null | head -n 1) --stylesheet=parskip
- 2ODT = $(shell which rst2odt.py rst2odt 2>/dev/null | head -n 1)
- 2MAN = $(shell which rst2man.py rst2man 2>/dev/null | head -n 1)
- # TeX/LaTeX Processing
- DVIPS = dvips
- PDFLATEX = pdflatex
- LATEX = latex
- %.dvi : %.latex
- ${LATEX} $*.latex
- %.html : %.rst
- ${2HTML} <$*.rst >$*.html
- %.latex : %.rst
- ${2LATEX} $*.rst >$*.latex
- %.3 : %.rst
- ${2MAN} <$*.rst >$*.3
- %.3.gz: %.3
- @gzip -c <$*.3 >$*.3.gz
- %.odt : %.rst
- ${2ODT} <$*.rst >$*.odt
- %.pdf : %.latex
- ${PDFLATEX} $*.latex
- ${PDFLATEX} $*.latex
- ${PDFLATEX} $*.latex
- %.ps : %.dvi
- ${DVIPS} $*.dvi
- %.txt: %.3
- @groff -man -Tascii $< | col -xb >$@
- ###
- # Pretty Print Programs & Scripts
- ###
- %.pl.ps: %.pl
- @enscript -Eperl --color -fCourier8 -i2 -L77 -C --mark-wrapped-lines=arrow -p$@ $<
- %.py.ps: %.py
- @enscript -Epython --color -fCourier8 -i2 -L77 -C --mark-wrapped-lines=arrow -p$@ $<
- %.sh.ps: %.sh
- @enscript -Esh --color -fCourier8 -i2 -L77 -C --mark-wrapped-lines=arrow -p$@ $<
- #####
- # Actual Build Rules
- #####
- FORCE:
- CHANGELOG.txt: FORCE
- @cvs log ${PROGMAIN} >CHANGELOG.txt
- WHATSNEW.txt: FORCE
- @printf "%s\n%s\n\n" ${HEADER1} ${HEADER2} | cat - $@ >${TMPFILE}
- @mv ${TMPFILE} $@
- @emacs -nw $@
- @cvs commit -m${HEADER1} $@
- docs: ${DOCS} ${PROGDOCS}
- @chmod 644 ${DOCS} ${PROGDOCS}
- @chmod 644 *.gz *.txt
- release: docs WHATSNEW.txt ${PROGFILES}
- @mkdir ${DIR}
- -@mkdir ${RELEASES} 2>&1 >/dev/null
- @cp -pv WHATSNEW.txt ${PROGFILES} ${DOCS} ${PROGDOCS} ${DIR}
- @tar -czvf ${TARBALL} --exclude CVS ${DIR}
- @rm -rf ${DIR}
- @mv ${DIR}.tar.gz ${RELEASES}
- #####
- # Housekeeping
- #####
- clean:
- @rm -rf *~ *.3 *.3.gz *.aux *.core *.dvi *.latex *.log *.out tmpfile *.toc
- version:
- @echo ${VERSION}
- scrub: clean
- @rm -rf ${DIR} ${PROGFILES} ${DOCS} ${PROGDOCS} ${TARBALL} ${TMPFILE}
- init: scrub
- cvs update