Newer
Older
tdocgen / makefile
# Produce Various Output Formats From A Restructured Text Source Document
# $Id: makefile,v 1.102 2010/07/16 22:41:01 tundra Exp $


#####
# Setup The Project Here
#####

PROJECT  = NAMEOFPROJECT

# List all the output files

1:     ${PROJECT}.1

dvi:   ${PROJECT}.dvi

html:  ${PROJECT}.html

latex: ${PROJECT}.latex

odt:   ${PROJECT}.odt

pdf:   ${PROJECT}.pdf

ps:    ${PROJECT}.ps


#####
# Things That May Have To Be Changed, Depending On System
#####

# Use these for FreeBSD

FILTDIR  = /usr/local/bin
PROGDIR  = /usr/local/bin


# Use these for Cygwin

#FILTDIR  = /usr/bin
#PROGDIR  = /usr/bin


########################################################################
#          Nothing Below This Line Should Need To Be Changed           #
########################################################################



# RST Filter And Needed Program Locations

2HTML    = ${FILTDIR}/rst2html.py
2LATEX   = ${FILTDIR}/rst2newlatex.py
2ODT     = ${FILTDIR}/rst2odt.py
2MAN     = ${FILTDIR}/rst2man.py

DVIPS    = ${PROGDIR}/dvips
PDFLATEX = ${PROGDIR}/pdflatex
LATEX    = ${PROGDIR}/latex

# File Types

CLEAN    = .aux .log .out \~
DOCFILES = .1 .dvi .html .latex .odt .pdf .ps

# Conversion Rules

%.dvi : %.latex
	${LATEX} $*.latex 

%.html : %.txt
	${2HTML} <$*.txt >$*.html

%.latex : %.txt
	${2LATEX} $*.txt >$*.latex

%.1 : %.txt
	${2MAN} <$*.txt >$*.1

%.odt : %.txt
	${2ODT} <$*.txt >$*.odt

%.pdf : %.txt
	${PDFLATEX} $*.latex

%.ps : %.dvi
	${DVIPS} $*.dvi


#####
# Packaging
#####

all: 1 dvi html latex odt pdf ps

pkg: all clean
	tar -czvf ${PROJECT}-docs.tar.gz ${PROJECT}.*


#####
# Cleanup stanzas
#####

clean:
	-@for type in ${CLEAN};\
     do\
         rm -v *$$type;\
     done

scrub: clean
	-@for type in ${DOCFILES};\
     do\
         rm -v *$$type;\
     done