Subversion Repositories shark

Rev

Blame | Last modification | View Log | RSS feed

# common part of the Shark manual makefiles

# /toOl: build only if $(MAIN).pdf is not already present
all: eps $(MAIN).pdf

# /toOl: commented stuff is for MikTex
$(MAIN).pdf: *.tex
        latex $(MAIN).tex
#       makeindex $(MAIN)
        bibtex $(MAIN)
        latex $(MAIN).tex
        latex $(MAIN).tex
#       dvips -R0 -t a4 -I c $(MAIN) -o $(MAIN).ps
        dvips $(MAIN)
        ps2pdf $(MAIN).ps
        if test $(MAIN_NAME); then cp $(MAIN).pdf ../$(MAIN_NAME).pdf; fi
        
clean:
        rm -rf *.aux
        rm -rf *.dvi
        rm -rf *.log
        rm -rf *.idx
        rm -rf *.ind
        rm -rf *.toc
        rm -rf *.ilg
        rm -rf *.out
        rm -rf *.bbl
        rm -rf *.blg
        rm -rf *~
        rm -rf $(MAIN).ps $(MAIN).pdf
        rm -f $(EPS_DIA_FILES) $(EPS_FIG_FILES)

cleanall: clean

# automatic generation of eps files from sources

DIA_FILES = $(shell find . -iname *.dia)
EPS_DIA_FILES = $(patsubst %.dia,%.eps, $(DIA_FILES))

FIG_FILES = $(shell find . -iname *.fig)
EPS_FIG_FILES = $(patsubst %.fig,%.eps, $(FIG_FILES))

.PHONY: eps

eps: $(EPS_DIA_FILES) $(EPS_FIG_FILES)

%.eps : %.dia
        dia $< -t eps-builtin -e $@

%.eps : %.fig
        fig2dev -L eps $< $@