PASTIX_SRC  ?= ../../src
SCRIPT_PATH ?= ../../scripts/
DOCUMENT=pastixman
.PHONY : clean

all : $(DOCUMENT).pdf

apiC2latex : ${PASTIX_SRC}/common/src/api.h
	perl -I${SCRIPT_PATH}/ ${SCRIPT_PATH}/APIc2latex.pl $<

$(DOCUMENT).pdf : outputs.tex blend.tex  compilation.tex  description.tex  fact.tex  \
		functions.tex  initialisation.tex  ordering.tex  $(DOCUMENT).tex  \
		pastixsteps.tex  refinement.tex  solv.tex  symbol.tex ../fonctions/*.tex examples.tex clean
	pdflatex $(DOCUMENT)
	pdflatex $(DOCUMENT)
	makeindex $(DOCUMENT).idx
	makeindex $(DOCUMENT).nlo -s nomencl.ist -o $(DOCUMENT).nls
	bibtex $(DOCUMENT)
	pdflatex $(DOCUMENT)
	pdflatex $(DOCUMENT)

clean :
	rm -f $(DOCUMENT).aux $(DOCUMENT).log $(DOCUMENT).nls 	\
		$(DOCUMENT).nlo $(DOCUMENT).glo $(DOCUMENT).idx \
		$(DOCUMENT).ilg $(DOCUMENT).ind $(DOCUMENT).bbl \
	        $(DOCUMENT).out


cleanall : clean
	rm -f $(DOCUMENT).pdf dparm.tex iparm.tex api.tex
