Newer
Older
tsshbatch / makefile
@tundra tundra on 17 Jun 2011 2 KB Initial Version
  1. # Build a release of 'tsshbatch' using 'make'
  2. # $Id: makefile,v 1.100 2011/06/17 17:02:16 tundra Exp $
  3. # Requires a modern 'make' like GNU.
  4.  
  5.  
  6. # Uncomment One Of The Following For Early Releases
  7.  
  8. #EARLY = Alpha
  9. #EARLY = Beta
  10. #EARLY = RC1
  11.  
  12. #####
  13. # Definitions Relevant To This Program
  14. #####
  15.  
  16. PROGNAME = tsshbatch
  17.  
  18. PORTNAME = ${PROGNAME}
  19.  
  20. PROGFILES = ${PROGNAME}.py
  21.  
  22. DOCSOURCES = ${PROGNAME}.rst ${PROGNAME}-license.txt CHANGELOG.txt Makefile \
  23. WHATSNEW.txt setup.py
  24.  
  25. DOCFILES = ${PROGNAME}.html ${PROGNAME}.pdf ${PROGNAME}.ps ${PROGNAME}.py.ps \
  26. ${PROGNAME}.1.gz
  27.  
  28.  
  29. #####
  30. # Nothing Should Need To Change Below This Line
  31. #####
  32.  
  33.  
  34. DIR = ${PORTNAME}-${VERSION}
  35. HEADER1 = "WHATSNEW For '${PROGNAME}' ${VERSION} (`date`)"
  36. HEADER2 = "----------------------------------------------------------------------"
  37. TARBALL = ${DIR}.tar.gz
  38. TMPFILE = tmpfile
  39. VERSION = $(shell rlog -v ${PROGNAME}.py | cut -f 2 -d " ")${EARLY}
  40.  
  41.  
  42. #####
  43. # Pattern Rules
  44. #####
  45.  
  46. ###
  47. # Old Rules
  48. ###
  49.  
  50. # %.1.gz: %.1
  51. # @gzip $<
  52.  
  53. # %.1: %.txt
  54. # @cp $< $@
  55.  
  56. # %.txt: %.1
  57. # @groff -man -Tascii $< | col -xb >$@
  58.  
  59. # %.html: %.1
  60. # @manserver $< >$@
  61.  
  62. #%.dvi: %.latex
  63. # latex $<
  64.  
  65. #%.ps: %.1
  66. # @groff -man -Tps $< >$@
  67.  
  68. #%.1: %.rst
  69. # @rst2man.py $< >$@
  70.  
  71.  
  72. ###
  73. # Man & html Output
  74. ###
  75.  
  76. %.html: %.rst
  77. @rst2html $< >$@
  78.  
  79. %.1: %.html
  80. @w3m -dump $< >$@
  81.  
  82. %.1.gz: %.1
  83. @gzip $<
  84.  
  85.  
  86. ###
  87. # LaTeX, PostScript, & PDF Output
  88. ###
  89.  
  90. %.latex: %.rst
  91. rst2latex --stylesheet=parskip $< >$@
  92.  
  93. %.pdf: %.latex
  94. @pdflatex $< $@
  95. @pdflatex $< $@
  96. @pdflatex $< $@
  97.  
  98. %.ps: %.pdf
  99. @pdftops $< >$@
  100.  
  101.  
  102. ###
  103. # Pretty Print Programs & Scripts
  104. ###
  105.  
  106. %.py.ps: %.py
  107. @enscript -Epython --color -fCourier8 -i2 -L77 -C --mark-wrapped-lines=arrow -p$@ $<
  108.  
  109. %.sh.ps: %
  110. @enscript -Esh --color -fCourier8 -i2 -L77 -C --mark-wrapped-lines=arrow -p$@ $<
  111.  
  112.  
  113. #####
  114. # Actual Build Rules
  115. #####
  116.  
  117.  
  118. CHANGELOG.txt:
  119. @rlog ${PROGNAME}.py >CHANGELOG.txt
  120.  
  121. WHATSNEW.txt:
  122. @co -l $@
  123. @printf "%s\n%s\n\n" ${HEADER1} ${HEADER2} | cat - $@ >${TMPFILE}
  124. @mv ${TMPFILE} $@
  125. @emacs -nw $@
  126. @ci -m${HEADER1} $@
  127. @co $@
  128.  
  129. clean:
  130. @rm -rf ${DIR} ${DOCFILES} ${PORTNAME} ${PROGFILES} ${DOCSOURCES} ${TARBALL} ${TMPFILE} \
  131. *~ *.1 *.aux *.core *.dvi *.latex *.log *.out *.toc
  132.  
  133. docs: ${DOCSOURCES} ${DOCFILES}
  134. @chmod 644 ${DOCFILES} ${DOCSOURCES}
  135. @chmod 644 *.gz *.txt
  136. @flip -u *txt
  137.  
  138. progs: ${PROGFILES}
  139. chmod 755 ${PROGFILES}
  140.  
  141. release: docs progs
  142. @mkdir ${DIR}
  143. @for f in `for f in ${DOCFILES} ${PROGFILES} ${DOCSOURCES};do echo $$f;done | sort`; do mv -v $$f ${DIR};done
  144. @tar -czvf ${TARBALL} ${DIR}
  145. @rm -rf ${DIR}
  146. @mv ${DIR}.tar.gz Releases
  147.  
  148. version:
  149. @echo ${VERSION}