

VERSION=0.2.3
LANGUAGE=en
NAME=F-CPU_manual-$(VERSION)-$(LANGUAGE)

RM=rm -f

LATEX=latex
L2H=latex2html
L2P=pdfelatex

DVIPS=dvips
DVIPDF=dvipdf

FICHIER=src/i7/Draft/p6.tex \
	src/i7/Overview/p5.tex\
	src/Programming/p7.tex\
	src/manual.tex\
	src/Introduction/FAQ/p1c2.tex\
	src/Introduction/History/p1c3.tex\
	src/Introduction/History/p1c4.tex\
	src/Introduction/p1c1.tex\
	src/Introduction/p1c5.tex\
	src/Introduction/p1c6.tex\
	src/Introduction/cover.tex\
	src/Introduction/foreword.tex\
	src/manual/images.tex\
	src/Special/p4c1.tex\
	src/Special/p4c2.tex\
	src/Special/p4c3.tex\
	src/Special/p4c4.tex\
	src/Special/p4.tex\
	src/General/FC-0/p3c1.tex\
	src/General/FC-0/p3c2.tex\
	src/General/FC-0/p3c3.tex\
	src/General/p2.tex
AUX=$(FICHIER:.tex=.aux)

TODEL1=find . -name \*.aux
TODEL2=find . -name \*.log
TODEL3=find . -name \*~
TODEL4=find . -name \*.lof
TODEL5=find . -name \*.lot
TODEL6=find . -name \*.toc
TODEL7=find . -name \*.dvi
TODEL8=find . -name \\\#\*

all: pdf

dvi:
	cd src && $(LATEX) manual.tex && $(LATEX) manual.tex

pdf: dvi
	cd src && $(DVIPDF) manual.dvi
	mv src/manual.pdf $(NAME).pdf

ps: dvi
	cd src && $(DVIPS) manual.dvi
	mv src/manual.pdf $(NAME).ps

html:
	cd src && $(L2H) manual.tex
	mv src/manual ./$(NAME)-html

clean:
	$(RM) $(AUX)
	$(RM) `$(TODEL1)` `$(TODEL2)` `$(TODEL3)` `$(TODEL4)` `$(TODEL5)` `$(TODEL6)` `$(TODEL7)` `$(TODEL8)`
	$(RM) -Rf $(NAME)

re: clean re

dist: clean
	mkdir $(NAME)
	cp -Rf *.txt Makefile *.pdf src/ $(NAME)
	tar cvfz $(NAME).tar.gz $(NAME)/
	rm -Rf $(NAME)
