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