Newer
Older
tdocgen / makefile
  1. # Produce Various Output Formats From A Restructured Text Source Document
  2. # $Id: makefile,v 1.103 2010/07/20 14:08:19 tundra Exp $
  3.  
  4.  
  5. #####
  6. # Setup The Project Here
  7. #####
  8.  
  9. PROJECT = NAMEOFPROJECT
  10.  
  11. # List all the output files
  12.  
  13. 1: ${PROJECT}.1
  14.  
  15. dvi: ${PROJECT}.dvi
  16.  
  17. html: ${PROJECT}.html
  18.  
  19. latex: ${PROJECT}.latex
  20.  
  21. odt: ${PROJECT}.odt
  22.  
  23. pdf: ${PROJECT}.pdf
  24.  
  25. ps: ${PROJECT}.ps
  26.  
  27.  
  28. #####
  29. # Things That May Have To Be Changed, Depending On System
  30. #####
  31.  
  32. # Use these for FreeBSD
  33.  
  34. FILTDIR = /usr/local/bin
  35. PROGDIR = /usr/local/bin
  36.  
  37.  
  38. # Use these for Cygwin
  39.  
  40. #FILTDIR = /usr/bin
  41. #PROGDIR = /usr/bin
  42.  
  43.  
  44. ########################################################################
  45. # Nothing Below This Line Should Need To Be Changed #
  46. ########################################################################
  47.  
  48.  
  49.  
  50. # RST Filter And Needed Program Locations
  51.  
  52. 2HTML = ${FILTDIR}/rst2html.py
  53. 2LATEX = ${FILTDIR}/rst2newlatex.py
  54. 2ODT = ${FILTDIR}/rst2odt.py
  55. 2MAN = ${FILTDIR}/rst2man.py
  56.  
  57. DVIPS = ${PROGDIR}/dvips
  58. PDFLATEX = ${PROGDIR}/pdflatex
  59. LATEX = ${PROGDIR}/latex
  60.  
  61. # File Types
  62.  
  63. CLEAN = .aux .log .out \~
  64. DOCFILES = .1 .dvi .html .latex .odt .pdf .ps
  65.  
  66. # Conversion Rules
  67.  
  68. %.dvi : %.latex
  69. ${LATEX} $*.latex
  70.  
  71. %.html : %.txt
  72. ${2HTML} <$*.txt >$*.html
  73.  
  74. %.latex : %.txt
  75. ${2LATEX} $*.txt >$*.latex
  76.  
  77. %.1 : %.txt
  78. ${2MAN} <$*.txt >$*.1
  79.  
  80. %.odt : %.txt
  81. ${2ODT} <$*.txt >$*.odt
  82.  
  83. %.pdf : %.latex
  84. ${PDFLATEX} $*.latex
  85.  
  86. %.ps : %.dvi
  87. ${DVIPS} $*.dvi
  88.  
  89.  
  90. #####
  91. # Packaging
  92. #####
  93.  
  94. all: 1 dvi html latex odt pdf ps
  95.  
  96. pkg: all clean
  97. tar -czvf ${PROJECT}-docs.tar.gz ${PROJECT}.*
  98.  
  99.  
  100. #####
  101. # Cleanup stanzas
  102. #####
  103.  
  104. clean:
  105. -@for type in ${CLEAN};\
  106. do\
  107. rm -v *$$type;\
  108. done
  109.  
  110. scrub: clean
  111. -@for type in ${DOCFILES};\
  112. do\
  113. rm -v *$$type;\
  114. done
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.