# ---------------------------------------------------------------
# -*- coding: iso-8859-15 -*-
# 
# Makefile pour la version franaise de la gallerie de dtx
# 
# ---------------------------------------------------------------
VERSION=1

OUTILS = Makefile

COLLEC = dtxgallery-fr

FRRDME = LISEZMOI

SI = single-source-fr
SISRC = $(SI).dtx
SISTY = $(SI).sty
SIINS = $(SI).ins
SICBL = $(SI).pdf
SITXT = $(SI)-lisezmoi.txt

RE = rearrange-fr
RESRC = $(RE).dtx
REINS = $(RE).ins
RESTY = $(RE).sty
RECBL = $(RE).pdf

CO = conditional-code-fr
COSRC = $(CO).dtx
COINS = $(CO).ins
COCBL = $(CO).pdf
COTXT = A.txt B.txt AB.txt

GA = dtxgallery-fr
GASRC = $(GA).dtx
GACBL = $(GA).pdf

PC = PourCommencer
PCSRC = $(PC).tex
PCCBL = $(PC).pdf

SOURCES = $(SISRC) \
	$(COSRC) $(COINS) \
	$(RESRC) $(REINS) \
	$(GASRC) $(PCSRC) \
	$(FRRDME) $(OUTILS)

DETRITUS = \
	$(SI).aux $(SI).glo $(SI).idx $(SI).log \
	$(CO).aux $(CO).log \
	$(GA).aux $(GA).glo $(GA).idx $(GA).log $(GA).out $(GA).toc \
	$(RE).aux $(RE).glo $(RE).idx $(RE).log \
	$(PC).aux $(PC).glo $(PC).idx $(PC).log $(PC).out $(PC).toc \

PRODUITS = \
	$(SITXT) $(SIINS) $(SISTY) $(SICBL) \
	$(COTXT) $(COCBL) \
	$(RECBL) $(RESTY) \
	$(GACBL) \
	$(PCCBL)

PDFDOC= $(SICBL) $(COCBL) $(RECBL) $(GACBL) $(PCCBL)

# ---------------------------------------------------------------

.SUFFIXES: .sty .ins .dtx .pdf .txt

# ---------------------------------------------------------------
.ins.sty:
	tex $<
.dtx.pdf:
	pdflatex $<
	pdflatex $<
.ins.txt:
	tex $<
.tex.pdf:
	pdflatex $<
	pdflatex $<
# ---------------------------------------------------------------

all: $(PDFDOC)

$(GACBL): $(GASRC) $(RESTY) $(COTXT) $(SISTY) 

$(SICBL): $(SISRC)

$(RECBL): $(RESRC) $(RESTY)

$(RESTY): $(RESRC) $(REINS)

$(COCBL): $(COSRC) $(COTXT)

$(COTXT): $(COINS) $(COSRC)
	tex $(COINS)
### je ne comprends pas pourquoi cette rgle est ncessaire
### je pensais qu'avec ce qui est en ligne 68 l'affaire tait rgle :-(


$(PCCBL): $(PCSRC)

clean: 
	@-rm -rf $(DETRITUS)

distclean: clean
	@-rm -rf $(PRODUITS)

texlive: all clean
	@-rm -rf texmf
	mkdir -p texmf/doc/latex/$(COLLEC)
	mkdir -p texmf/source/latex/$(COLLEC)
	cp $(PDFDOC) texmf/doc/latex/$(COLLEC)
	cp $(SOURCES) texmf/source/latex/$(COLLEC)

zip:	texlive
	@-rm -f $(COLLEC)-$(VERSION).zip
	zip -r $(COLLEC)-$(VERSION).zip texmf
	@-rm -r texmf/

# ---------------------------------------------------------------
# echu e an abaden
# Le \TeX nicien de surface 2008-05-01
