LATEX = latex
TITOLO = HowToThink_ITA
DVIPS = dvips

%.dvi: %.tex
	$(LATEX) $<

%.ps: %.dvi
	$(DVIPS) -o $@ $<

%.pdf: %.ps
	ps2pdf $@

all:	top.tex
	latex top
	makeindex top
	latex top
	dvips -Ppdf -z -o $(TITOLO).ps top
	ps2pdf -dMaxSubsetPct=100 -dCompatibilityLevel=1.2 -dSubsetFonts=true -dEmbedAllFonts=true $(TITOLO).ps


dist:
	mkdir $(TITOLO)
	cp Makefile *.tex $(TITOLO)
	cp -r illustrations $(TITOLO)
	make clean
	tar -czf $(TITOLO).tar.gz $(TITOLO)

clean:
	rm -f *~ *.aux *.log *.dvi *.idx *.ilg *.ind *.toc *.tmp

