# indiquer ici le nom du fichier ps a produire # et le nom du fichier tex principal # TODO : le glossaire SRC=coopReport DST=coopReport # all : le postscript classque # pdf : la version pdf # html : conversion en html # clean : nettoyage grossier # regarde si les differents elements sont presents LOT=$(shell cat $(SRC).tex | grep \listoftables) LOF=$(shell cat $(SRC).tex | grep \listoffigures) TOC=$(shell cat $(SRC).tex | grep \tableofcontents) INDEX=$(shell cat $(SRC).tex | grep \makeindex) INDEXES=$(shell cat $(SRC).tex | grep \makeindex{) BIBLIO=$(shell cat $(SRC).tex | grep \bibliography{) # compilation classique en .ps all : compil postscript nettoyage # affichage directe du resultat affiche : all gv $(DST).ps & # creation de la sortie en pdf pdf : compil postscript nettoyage ps2pdf ${DST}.ps ${DST}.pdf # pdflatex $(SRC) ${DST}.pdf rm ${DST}.ps # creation du site html associe html : compil hypertexte nettoyage rm *.dvi # creation des pages html associees au fichier tex, aux, ... hypertexte : tex2html -dir ./html $(SRC).tex #compilation, eventuellement avec biblio et index compil : latex $(SRC).tex && latex $(SRC).tex ifneq '$(findstring \makeindex,${INDEX})' "" # si il y a un index for i in *.idx; do makeindex -s index.ist $$i; done ifneq '$(findstring \bibliography{,${BIBLIO})' "" # si en plus il y a une biblio latex $(SRC).tex && bibtex $(SRC) && latex $(SRC).tex && latex $(SRC).tex else # il y a seulement un index latex $(SRC).tex && latex $(SRC).tex && latex $(SRC).tex endif else ifneq '$(findstring \bibliography{,${BIBLIO})' "" # si il y a seulement une biblio latex $(SRC).tex && bibtex $(SRC) && latex $(SRC).tex && latex $(SRC).tex endif endif # creation du postscript postscript : dvips $(SRC).dvi -o ${DST}.ps -t a4 rm *.dvi # suppression des fichiers generes par la compilation nettoyage : ifneq '$(findstring \makeindex,${INDEX})' "" # un index rm *.ind *.ilg *.idx endif ifneq '$(findstring \bibliography, ${BIBLIO})' "" # une bibliographie rm *.bbl *.blg endif ifeq '$(strip ${LOT})' "\listoftables" # une liste des tables rm *.lot endif ifeq '$(strip ${LOF})' "\listoffigures" # une liste des figures rm *.lof endif ifeq '$(strip ${TOC})' "\tableofcontents" # une table des matieres rm *.toc endif # un dernier nettoyage rm *.log *.aux # suppression grossiere clean : rm *.log *.aux *.dvi *.toc *.lot *.lof *.bbl *.blg *.ind *.ilg *.idx