Newer
Older
validate-upg / makefile
  1. # Build a release of tconfpy using 'make'
  2. # $Id: makefile,v 1.115 2012/06/09 21:51:01 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 = validate-upg
  17.  
  18. PORTNAME = ${PROGNAME}
  19.  
  20. PROGFILES = ${PROGNAME}.py
  21.  
  22. SUPPFILES = ${PROGNAME}-license.txt CHANGELOG.txt Makefile READ-1ST.txt WHATSNEW.txt setup.py
  23.  
  24. DOCFILES = ${PROGNAME}.html ${PROGNAME}.pdf ${PROGNAME}.ps ${PROGNAME}.py.ps ${PROGNAME}.txt \
  25. ${PROGNAME}.1.gz
  26.  
  27.  
  28. #####
  29. # Nothing Should Need To Change Below This Line
  30. #####
  31.  
  32.  
  33. DIR = ${PORTNAME}-${VERSION}
  34. HEADER1 = "WHATSNEW For '${PROGNAME}' ${VERSION} (`date`)"
  35. HEADER2 = "----------------------------------------------------------------------"
  36. RELDIR = "Releases"
  37. TARBALL = ${DIR}.tar.gz
  38. TMPFILE = tmpfile
  39. VERSION = $(shell grep 'RCSID = ' ${PROGNAME}.py | cut -f 5 -d " ")${EARLY}
  40.  
  41.  
  42.  
  43. #####
  44. # Pattern Rules
  45. #####
  46.  
  47. %.html: %.1
  48. @manserver $< >$@
  49.  
  50. %.pdf: %.ps
  51. @gs -dBATCH -dNOPAUSE -sDEVICE=pdfwrite -sOutputFile=$@ $<
  52.  
  53. %.ps: %.1
  54. @groff -man -Tps $< >$@
  55.  
  56. %.ps: %.3
  57. @groff -man -Tps $< >$@
  58.  
  59. %.py.ps: %.py
  60. @enscript -Epython -fCourier8 -i2 -L77 -C --mark-wrapped-lines=arrow -p$@ $<
  61.  
  62. %.txt: %.1
  63. @groff -man -Tascii $< | col -xb >$@
  64.  
  65. %.txt: %.3
  66. @groff -man -Tascii $< | col -xb >$@
  67.  
  68. %.1.gz: %.1
  69. @gzip $<
  70.  
  71. %.3.gz: %.3
  72. @gzip $<
  73.  
  74.  
  75. #####
  76. # Actual Build Rules
  77. #####
  78.  
  79. FORCE:
  80.  
  81. CHANGELOG.txt: FORCE
  82. @cvs log ${PROGNAME}.py >CHANGELOG.txt
  83.  
  84. WHATSNEW.txt: FORCE
  85. @printf "%s\n%s\n\n" ${HEADER1} ${HEADER2} | cat - $@ >${TMPFILE}
  86. @mv ${TMPFILE} $@
  87. @emacs -nw $@
  88. @cvs commit -m${HEADER1} $@
  89.  
  90. docs: ${DOCFILES} ${SUPPFILES}
  91. @chmod 644 ${DOCFILES} ${SUPPFILES}
  92. @chmod 644 *.gz *.txt
  93.  
  94. progs: ${PROGFILES}
  95. chmod 750 ${PROGFILES}
  96.  
  97. release: docs progs
  98. @mkdir ${DIR}
  99. -@mkdir ${RELDIR} 2>&1 >/dev/null
  100. @cp -pv ${DOCFILES} ${PROGFILES} ${SRCFILES} ${SUPPFILES} ${DIR}
  101. @tar -czvf ${TARBALL} ${DIR}
  102. @rm -rf ${DIR}
  103. @mv ${DIR}.tar.gz ${RELDIR}
  104.  
  105.  
  106. #####
  107. # Housekeeping
  108. #####
  109.  
  110. clean:
  111. @rm -rf *~ *.1 *.1.gz *.aux *.core *.dvi *.latex *.log *.out tmpfile *.toc
  112.  
  113. version:
  114. @echo ${VERSION}
  115.  
  116. scrub: clean
  117. @rm -rf ${DIR} ${PROGFILES} ${DOCS} ${PROGDOCS} ${TARBALL} ${TMPFILE}
  118.  
  119. init: scrub
  120. cvs update