Newer
Older
lessons_for_leaders / makefile
  1. # Build a release of 'lessons_for_leaders' using 'make'
  2. # Requires a modern 'make' like GNU.
  3. #
  4. # Copyright (c) 2015 TundraWare Inc., Des Plaines, IL 60018 USA
  5. # All Rights Reserved. For Terms Of Use See: lessons_for_leaders-license.txt
  6. #
  7. # For Program Updates See: http://www.tundraware.com/Software/lessons_for_leaders
  8. #
  9. # $Id: makefile,v 1.100 2015/03/06 19:58:59 tundra Exp $
  10.  
  11.  
  12. # Uncomment One Of The Following For Early Releases
  13.  
  14. #EARLY = Alpha
  15. #EARLY = Beta
  16. #EARLY = RC1
  17.  
  18. #####
  19. # Definitions Relevant To This Program
  20. #####
  21.  
  22. PROGNAME = lessons_for_leaders
  23. PROGMAIN = lessons_for_leaders.rst
  24.  
  25. PROGFILES = ${PROGMAIN} # setup.py # Uncomment this if desired for python modules
  26. PROGDOCS = ${PROGMAIN}.ps
  27.  
  28. DOCS = lessons_for_leaders-license.txt \
  29. ${PROGNAME}.1.gz \
  30. ${PROGNAME}.html \
  31. ${PROGNAME}.pdf \
  32. ${PROGNAME}.ps \
  33. ${PROGNAME}.rst \
  34. ${PROGNAME}.txt \
  35. CHANGELOG.txt \
  36. Makefile \
  37.  
  38.  
  39. #####
  40. # Nothing Should Need To Change Below This Line
  41. #####
  42.  
  43.  
  44. DIR = ${PROGNAME}-${VERSION}
  45. HEADER1 = "WHATSNEW For '${PROGNAME}' ${VERSION} (`date`)"
  46. HEADER2 = "----------------------------------------------------------------------"
  47. RELEASES = "Releases"
  48. TARBALL = ${DIR}.tar.gz
  49. TMPFILE = tmpfile
  50. VERSION = $(shell cvs log ${PROGMAIN} | grep ^head\: | cut -f2 -d " ")${EARLY}
  51.  
  52.  
  53. #####
  54. # Pattern Rules
  55. #####
  56.  
  57. ###
  58. # Document Production
  59. ###
  60.  
  61. # Some Docutils installations keep the ".py" suffix for the various
  62. # frontend programs, and some do not. It's even possible there are
  63. # links from one to the other. Since the project can be checked out
  64. # on any platform, we have to check for this every time we run the
  65. # 'make'. This is irritating.
  66.  
  67. 2HTML = $(shell which rst2html.py rst2html 2>/dev/null | head -n 1)
  68. 2LATEX = $(shell which rst2latex.py rst2latex 2>/dev/null | head -n 1) --stylesheet=parskip --latex-preamble="\usepackage{fullpage}"
  69. 2ODT = $(shell which rst2odt.py rst2odt 2>/dev/null | head -n 1)
  70. 2MAN = $(shell which rst2man.py rst2man 2>/dev/null | head -n 1)
  71.  
  72. # TeX/LaTeX Processing
  73.  
  74. DVIPS = dvips
  75. PDFLATEX = pdflatex
  76. LATEX = latex
  77.  
  78. %.dvi : %.latex
  79. ${LATEX} $*.latex
  80.  
  81. %.html : %.rst
  82. ${2HTML} <$*.rst >$*.html
  83.  
  84. %.latex : %.rst
  85. ${2LATEX} $*.rst >$*.latex
  86.  
  87. %.1 : %.rst
  88. ${2MAN} <$*.rst >$*.1
  89.  
  90. %.1.gz: %.1
  91. @gzip -c <$*.1 >$*.1.gz
  92.  
  93. %.odt : %.rst
  94. ${2ODT} <$*.rst >$*.odt
  95.  
  96. %.pdf : %.latex
  97. ${PDFLATEX} $*.latex
  98. ${PDFLATEX} $*.latex
  99. ${PDFLATEX} $*.latex
  100.  
  101. %.ps : %.dvi
  102. ${DVIPS} $*.dvi
  103.  
  104. %.txt: %.1
  105. @groff -man -Tascii $< | col -xb >$@
  106.  
  107. ###
  108. # Pretty Print Programs & Scripts
  109. ###
  110.  
  111. %.pl.ps: %.pl
  112. @enscript -Eperl --color -fCourier8 -i2 -L77 -C --mark-wrapped-lines=arrow -p$@ $<
  113.  
  114. %.py.ps: %.py
  115. @enscript -Epython --color -fCourier8 -i2 -L77 -C --mark-wrapped-lines=arrow -p$@ $<
  116.  
  117. %.sh.ps: %.sh
  118. @enscript -Esh --color -fCourier8 -i2 -L77 -C --mark-wrapped-lines=arrow -p$@ $<
  119.  
  120.  
  121. #####
  122. # Actual Build Rules
  123. #####
  124.  
  125. FORCE:
  126.  
  127. CHANGELOG.txt: FORCE
  128. @cvs log ${PROGMAIN} >CHANGELOG.txt
  129.  
  130. WHATSNEW.txt: FORCE
  131. @printf "%s\n%s\n\n" ${HEADER1} ${HEADER2} | cat - $@ >${TMPFILE}
  132. @mv ${TMPFILE} $@
  133. @jmacs $@
  134. @cvs commit -m${HEADER1} $@
  135.  
  136. docs: ${DOCS} ${PROGDOCS}
  137. @chmod 644 ${DOCS} ${PROGDOCS}
  138. @chmod 644 *.gz *.txt
  139.  
  140. release: docs WHATSNEW.txt ${PROGFILES}
  141. @mkdir ${DIR}
  142. -@mkdir ${RELEASES} 2>&1 >/dev/null
  143. @cp -pv WHATSNEW.txt ${PROGFILES} ${DOCS} ${PROGDOCS} ${DIR}
  144. @tar -czvf ${TARBALL} --exclude CVS ${DIR}
  145. @rm -rf ${DIR}
  146. @mv ${DIR}.tar.gz ${RELEASES}
  147.  
  148. #####
  149. # Housekeeping
  150. #####
  151.  
  152. clean:
  153. @rm -rf *~ *.1 *.1.gz *.aux *.core *.dvi *.latex *.log *.out tmpfile *.toc
  154.  
  155. version:
  156. @echo ${VERSION}
  157.  
  158. scrub: clean
  159. @rm -rf ${DIR} ${PROGFILES} ${DOCS} ${PROGDOCS} ${TARBALL} ${TMPFILE}
  160.  
  161. init: scrub
  162. cvs update
  163.  
  164.