#  Makefile for a Book defined in XHTML, and printed using LaTeX
#  J. Watlington, 9/25/06
#
#  make 
#  make all - Make the PDF version of the book
#  make clean - remove the intermediate LaTeX files (optional)
#  make index - rebuild the index database (must be done manually)

#  This indicates where the XHTML files for the recipes are kept
VPATH		= ../

#  These indicate the name of the book
BASE		= book
BOOK		= book.pdf

LATEX		= pdflatex
INDEX		= makeindex
XSLT		= xalan
XSLT_OPTIONS	= -TEXT -XSL ${PRINT_STYLESHEET}
PRINT_STYLESHEET = ${BASE}.xsl 

#  This huge variable contains the names of the intermediate LaTeX files,
#  one per recipe.
#
TEX_FILES = cheeseolivepuffs.tex cheesestraws.tex crabspread.tex	\
teriyakibeef.tex bitesizeturnovers.tex nutsandbolts.tex			\
breadbutterpickles.tex sweetpickles.tex pepperrelish.tex		\
bubblebreakfastcake.tex banananutbread.tex broccolicornbread.tex	\
cornbread.tex lf_cornbread.tex muffins.tex hotrolls.tex			\
hushpuppies.tex breakfastcasserole.tex arrozconpollo.tex		\
bbqchicken.tex chickendivan.tex chickendressingcass.tex			\
chickenrice.tex chickendumplings.tex chickenroyal.tex			\
chickentortilla.tex hotchickensalad.tex spicychicken.tex		\
chinesetunacasserole.tex lomosaltado.tex cheeseburgerpie.tex		\
meatballs.tex meatbirds.tex ranchchicken.tex asparaguscasserole.tex	\
broccolicasserole.tex candiedsweet.tex candiedsweet2.tex		\
chinesebroccoli.tex cornpudding.tex cornsouffle.tex corndressing.tex	\
southernfriedcabbage.tex macaronicheese.tex  \
gritscasserole.tex gritscasserole2.tex gritscasserole3.tex		\
greenbeancass.tex mexicancornbd.tex papashuancaina.tex			\
parmesanpotatoes.tex potatocasserole.tex potatocasserole2.tex		\
potatoesaugratin.tex spinachcasserole.tex spinachcasserole2.tex		\
spinachtomatocass.tex sweetpotatocasserole.tex sweetcarrots.tex		\
zucchinibake.tex zucchiniquiche.tex cokesalad.tex whitesauce.tex	\
holidaysalad.tex hotfruit.tex layeredsalad.tex marinatedcarrots.tex	\
cranberrysalad.tex peachsalad.tex pineapplecheesesalad.tex		\
strawberrysalad.tex applecake.tex applecrisp.tex chesstarts.tex		\
chesspie.tex chocolatechess.tex chocolatedip.tex doughnutglazechoc.tex	\
coconutpecanfrosting.tex coconutfrosting.tex coffeecake.tex		\
crazychoccake.tex bakedcustard.tex boiledcustard.tex cherrycake.tex	\
mincheesecakes.tex divinitycandy.tex doughnuts.tex doughnutglaze.tex	\
englishtoffee.tex germanchocolatecake.tex gingerbread.tex		\
lazydaisycake.tex lemonsauce.tex lemonpoppymuffins.tex lemonpie.tex	\
lemonsquares.tex washingtoncandy.tex orangesherbert.tex			\
easyorangesherbert.tex peanutbrittle.tex peanutbutterbrownie.tex	\
peanutbuttercup.tex peanutbutteryum.tex pecanpie.tex			\
pineappleupdowncake.tex pumpkinpie.tex punchbowlcake.tex		\
spongecake.tex sweetlemonbread.tex bbqsauce.tex figpreserves.tex	\
hamsauce.tex raisinsauce.tex asianmarinade.tex beefmarinade.tex		\
southwesternmarinade.tex currypowder.tex granola.tex spicetea.tex       \
artichokes.tex frenchdressing.tex  gravy.tex bakedapples.tex \
bakedbeans.tex cinnamonrolls.tex


#  These are the LaTeX files that contain the book formatting information,
#  title and copyright pages, the preface, biography, etc.

AUX_TEX_FILES = setup.tex preamble.tex frontmatter.tex bio.tex \
                epigraph.tex preface.tex book.tex

#  These are the actual Makefile rules

all: ${BOOK}

pdf: ${BOOK}

${BOOK}: ${TEX_FILES} ${AUX_TEX_FILES}
	${LATEX} ${BASE}.tex
	makeindex ${BASE}.idx
	${LATEX} ${BASE}.tex

quick: ${TEX_FILES} ${AUX_TEX_FILES}
	${LATEX} ${BASE}.tex

clean:
	rm -f ${TEX_FILES}

%.tex: %.html ${PRINT_STYLESHEET}
	${XSLT} ${XSLT_OPTIONS} -IN $< -OUT $@