diff --git a/makefile b/makefile index b738894..36d245f 100644 --- a/makefile +++ b/makefile @@ -1,75 +1,103 @@ # Build a release of twander using 'make' -# $Id: makefile,v 1.101 2005/01/11 10:24:36 tundra Exp $ - -# Syntax is: make target VER=version-number - -PROGNAME=twander +# $Id: makefile,v 1.102 2005/01/25 23:22:25 tundra Exp $ -COLOR= -#COLOR=--color +##### +# Definitions Relevant To This Program +##### -DIR=twander-${VER} -PROGFILES=${PROGNAME}.py -BASEFILES=${PROGNAME}.1 -SUPPFILES=Makefile ${PROGNAME}-license.txt .${PROGNAME} READ-1ST.txt WHATSNEW.txt -DOCFILES=CHANGELOG.txt ${PROGNAME}.html ${PROGNAME}.pdf ${PROGNAME}.ps ${PROGNAME}.py.ps ${PROGNAME}.txt ${PROGNAME}.1.gz +PROGNAME = twander + +PORTNAME = ${PROGNAME} + +PROGFILES = ${PROGNAME}.py + +SUPPFILES = .${PROGNAME} ${PROGNAME}-license.txt CHANGELOG.txt Makefile READ-1ST.txt WHATSNEW.txt + +DOCFILES = ${PROGNAME}.html ${PROGNAME}.pdf ${PROGNAME}.ps ${PROGNAME}.py.ps ${PROGNAME}.txt ${PROGNAME}.1.gz -# Clean Up +##### +# Nothing Should Need To Change Below This Line +##### + + +DIR = ${PORTNAME}-${VERSION} +HEADER1 = "WHATSNEW For '${PROGNAME}' ${VERSION} (`date`)" +HEADER2 = "----------------------------------------------------------------------" +TARBALL = ${DIR}.tar.gz +TMPFILE = tmpfile +VERSION = $(shell rlog -v ${PROGNAME}.py | cut -f 2 -d " ") + + +##### +# Pattern Rules +##### + +%.html: %.1 + @manserver $< >$@ + +%.html: %.3 + @manserver $< >$@ + +%.pdf: %.ps + @gs -dBATCH -dNOPAUSE -sDEVICE=pdfwrite -sOutputFile=$@ $< + +%.ps: %.1 + @groff -man -Tps $< >$@ + +%.ps: %.3 + @groff -man -Tps $< >$@ + +%.py.ps: %.py + @enscript -Epython -fCourier8 -i2 -L77 -C --mark-wrapped-lines=arrow -p$@ $< + +%.txt: %.1 + @groff -man -Tascii $< | col -xb >$@ + +%.txt: %.3 + @groff -man -Tascii $< | col -xb >$@ + +%.1.gz: %.1 + @gzip $< + +%.3.gz: %.3 + @gzip $< + + +##### +# Actual Build Rules +##### clean: - @rm -f ${PROGFILES} ${BASEFILES} ${SUPPFILES} ${DOCFILES} + @rm -rf ${DIR} ${DOCFILES} ${PORTNAME} ${PROGFILES} ${SUPPFILES} ${TARBALL} ${TMPFILE} ${PROGNAME}.3 *.pyc *~ -# Checkout The Required Files - -${PROGFILES}: - @co -r${VER} $* - -${BASEFILES} ${SUPPFILES}: - @co $* - -# Pretty Print The Source Code - -${PROGNAME}.py.ps: ${PROGNAME}.py - @enscript -Epython -fCourier8 -i2 -L77 -C --mark-wrapped-lines=arrow ${COLOR} -p${PROGNAME}.py.ps ${PROGNAME}.py - - -# Build Documentation +version: + @echo ${VERSION} CHANGELOG.txt: @rlog ${PROGNAME}.py >CHANGELOG.txt -${PROGNAME}.html: ${PROGNAME}.1 - @manserver ${PROGNAME}.1 >${PROGNAME}.html +WHATSNEW.txt: + @co -l $@ + @printf "%s\n%s\n\n\n" ${HEADER1} ${HEADER2} | cat - $@ >${TMPFILE} + @mv ${TMPFILE} $@ + @emacs $@ + @ci $@ + @co $@ -${PROGNAME}.ps: ${PROGNAME}.1 - @groff -man -Tps ${PROGNAME}.1 >${PROGNAME}.ps - -${PROGNAME}.txt: ${PROGNAME}.1 - @groff -man -Tascii ${PROGNAME}.1 | col -xb >${PROGNAME}.txt - -${PROGNAME}.1.gz: ${PROGNAME}.1 - @gzip ${PROGNAME}.1 - -${PROGNAME}.pdf: ${PROGNAME}.ps - @gs -dBATCH -dNOPAUSE -sDEVICE=pdfwrite -sOutputFile=${PROGNAME}.pdf ${PROGNAME}.ps - -docs: ${SUPPFILES} ${DOCFILES} +docs: ${DOCFILES} ${SUPPFILES} @chmod 644 ${DOCFILES} ${SUPPFILES} @chmod 644 *.gz *.txt @flip -u *txt +progs: ${PROGFILES} + chmod 755 ${PROGFILES} - -# Package A Release - -release: docs +release: docs progs @mkdir ${DIR} - @chmod 755 ${PROGFILES} - @mv ${PROGFILES} ${SUPPFILES} ${DOCFILES} ${DIR} - @tar -czvf ${DIR}.tar.gz ${DIR} - @rm -rf ${DIR} - @mv ${DIR}.tar.gz Releases - + @mv ${DOCFILES} ${PROGFILES} ${SUPPFILES} ${DIR} + @tar -czvf ${TARBALL} ${DIR} +# @rm -rf ${DIR} +# @mv ${DIR}.tar.gz Releases