Newer
Older
tconfpy / makefile
  1. # Build a release of tconfpy using 'make'
  2. # $Id: makefile,v 1.106 2005/01/16 10:32:52 tundra Exp $
  3. # Requires a modern 'make' like GNU.
  4.  
  5.  
  6. PROGNAME=tconfpy
  7. TESTPROG=test-tc
  8.  
  9. VERSION = $(shell rlog -v ${PROGNAME}.py | cut -f 2 -d " ")
  10.  
  11. HEADER1 = "WHATSNEW For '${PROGNAME}' ${VERSION} (`date`)"
  12. HEADER2 = "----------------------------------------------------------------------"
  13.  
  14. TMPFILE = tmpfile
  15.  
  16. PREFIX = py-${PROGNAME}
  17. DIR = ${PREFIX}-${VERSION}
  18. TARBALL = ${DIR}.tar.gz
  19.  
  20. PROGFILES = ${PROGNAME}.py ${TESTPROG}.py
  21.  
  22. SUPPFILES = ${PROGNAME}-license.txt CHANGELOG.txt Makefile READ-1ST.txt WHATSNEW.txt setup.py example.cfg
  23.  
  24. DOCFILES = ${PROGNAME}.html ${PROGNAME}.pdf ${PROGNAME}.ps ${PROGNAME}.py.ps ${PROGNAME}.txt \
  25. ${TESTPROG}.html ${TESTPROG}.pdf ${TESTPROG}.ps ${TESTPROG}.py.ps ${TESTPROG}.txt \
  26. ${TESTPROG}.1.gz ${PROGNAME}.3.gz
  27.  
  28.  
  29. #####
  30. # Pattern Rules
  31. #####
  32.  
  33. %.html: %.1
  34. @manserver $< >$@
  35.  
  36. %.html: %.3
  37. @manserver $< >$@
  38.  
  39. %.pdf: %.ps
  40. @gs -dBATCH -dNOPAUSE -sDEVICE=pdfwrite -sOutputFile=$@ $<
  41.  
  42. %.ps: %.1
  43. @groff -man -Tps $< >$@
  44.  
  45. %.ps: %.3
  46. @groff -man -Tps $< >$@
  47.  
  48. %.py.ps: %.py
  49. @enscript -Epython -fCourier8 -i2 -L77 -C --mark-wrapped-lines=arrow -p$@ $<
  50.  
  51. %.txt: %.1
  52. @groff -man -Tascii $< | col -xb >$@
  53.  
  54. %.txt: %.3
  55. @groff -man -Tascii $< | col -xb >$@
  56.  
  57. %.1.gz: %.1
  58. @gzip $<
  59.  
  60. %.3.gz: %.3
  61. @gzip $<
  62.  
  63. #####
  64. # Actual Build Rules
  65. #####
  66.  
  67. clean:
  68. @rm -rf ${DOCFILES} ${PROGFILES} ${SUPPFILES} ${DIR} ${PREFIX}* ${TMPFILE}
  69.  
  70. version:
  71. @echo ${VERSION}
  72.  
  73. CHANGELOG.txt:
  74. @rlog ${PROGNAME}.py >CHANGELOG.txt
  75.  
  76. WHATSNEW.txt:
  77. @co -l $@
  78. @printf "%s\n%s\n\n\n" ${HEADER1} ${HEADER2} | cat - $@ >${TMPFILE}
  79. @mv ${TMPFILE} $@
  80. @emacs $@
  81. @ci $@
  82. @co $@
  83.  
  84. docs: ${DOCFILES} ${SUPPFILES}
  85. @chmod 644 ${DOCFILES} ${SUPPFILES}
  86. @chmod 644 *.gz *.txt
  87. @flip -u *txt
  88.  
  89. progs: ${PROGFILES}
  90. chmod 755 ${PROGFILES}
  91.  
  92. release: docs progs
  93. @mkdir ${DIR}
  94. @mv ${DOCFILES} ${PROGFILES} ${SUPPFILES} ${DIR}
  95. @tar -czvf ${DIR}.tar.gz ${DIR}
  96. @rm -rf ${DIR}
  97. # @mv ${DIR}.tar.gz Releases
  98.  
  99.