############################################################################# # # # Makefile.cours for GNU Make # # # # Copyright (C) 2000 Le Loarer Loïc # # # # # # This library is free software; you can redistribute it and/or # # modify it under the terms of the GNU Lesser General Public # # License as published by the Free Software Foundation; either # # version 2 of the License, or (at your option) any later version. # # # # This library is distributed in the hope that it will be useful, # # but WITHOUT ANY WARRANTY; without even the implied warranty of # # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # # Lesser General Public License for more details. # # # # To obtain a copy of the GNU Lesser General Public License, you can write # # to the Free Software Foundation, Inc., # # 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # # or go on the World Wide Web at: # # # # http://www.gnu.org/copyleft/lesser.html # # # ############################################################################# # Ceci est un fichier de règles pour make permettant de construire les fichiers # .ps, .html et .ml.ps dans un répertoire contenant un fichier latex (.tex) # et un fichier Caml (ou OCaml) (.ml). # On utilse les programmes latex, hevea pour faire le .html à partir du .tex, # imagen pour générer les images du fichier .tex pour le .html (fourni avec # hevea) et a2ps pour faire le .ml.ps à partir du .ml. # Ce programme est à inclure dans un Makefile existant contenant la définition # des variables TARGET et TITLE # TARGET est le nom du fichier .tex prinpical. # Ce sera le nom de base pour tous les autres fichiers, aussi bien le .ml que # les fichiers de sortie .ps, .ml.ps et .html. # TITLE est le titre qui apparaîtra dans le .ml.ps fait par a2ps. # Si le .tex n'utilse pas d'images, alors hevea ne produit pas de fichier # .image.tex, ce qui génère un message d'erreur dans imagen, ne pas en tenir # compte. # Ce programme défini les targets suivantes : # usage: # default => ps, html, mlps # ps pour le PostScript final # dvi pour le dvi intermédiaire # html pour le html # mlps pour le ps du corrigé # gz pour comprimer les fichiers résultants importants (.html, # .ml.ps et .ps) # clean pour enlever les fichiers temporaires # distclean pour enlever tous les fichiers SRC=$(patsubst %,%.tex,$(TARGET)) DVI=$(patsubst %,%.dvi,$(TARGET)) PS=$(patsubst %,%.ps,$(TARGET)) PSGZ=$(patsubst %,%.ps.gz,$(TARGET)) HTML=$(patsubst %,%.html,$(TARGET)) HTMLGZ=$(patsubst %,%.html.gz,$(TARGET)) MLPS=$(patsubst %,%.ml.ps,$(TARGET)) MLPSGZ=$(patsubst %,%.ml.ps.gz,$(TARGET)) default: $(SRC) ps html mlps dvi: $(DVI) ps: $(PS) # on met .imagen dans html car il faut faire les images, c'est plus propre html: $(HTML) .imagen # fait le PostScript du fichier .ml mlps: $(MLPS) # compresse les gros fichers gz: $(PSGZ) $(MLPSGZ) $(HTMLGZ) # fait les images utilsées par hevea .imagen: $(SRC) $(HTML) -imagen $(TARGET) touch .imagen ########################## # dépendances globales : # ########################## %.dvi: %.tex latex $< latex $< # latex $< %.ps: %.dvi dvips -o $@ $< %.ml.ps: %.ml a2ps -o $@ --center-title=$(TITLE) --left-title="" $< %.html: %.tex hevea -o $@ $< #%.image.tex: %.tex # hevea -o $@ $< # touch $@ %.gz: % gzip -c $< > $@ ########################## # nétoyage : # ########################## clean:: -rm *~ *.aux *.log *.toc *.dvi $(TARGET).image.tex cleandist: clean -rm *.ps *.gif *.html .imagen *.gz