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