pstricks: kleines beispiel vom herrn perner und makefile spass von mir
[hwmod.git] / spec / Makefile
index 709fc1dc88dd8c55dea4e94b01d7ee009047fc25..6b9d295c30714ec33312bf6481fd34674df43f90 100644 (file)
@@ -1,8 +1,22 @@
+SHELL := bash
 PROJECT = spec
 
-protocol:
-       @pdflatex $(PROJECT)
-       @pdflatex $(PROJECT)
+all: protocol
+
+protocol: $(PROJECT).tex $(subst .dia,.png,$(shell ls *.dia)) $(subst .tex,.pdf,$(shell ls sm/*.tex))
+       pdflatex $(PROJECT).tex
+       pdflatex $(PROJECT).tex
+
+%.png: %.dia
+       dia $< -e $@ -t png
+
+%.pdf: %.tex
+       latex -output-directory=sm $<
+       dvips $(subst .tex,.dvi,$<) -o $(subst .tex,.ps,$<)
+       ps2pdf $(subst .tex,.ps,$<) $@
+       pdfcrop $@ $(subst .pdf,.pdf2,$@)
+       mv $(subst .pdf,.pdf2,$@) $@
+       rm sm/{*.dvi,*.ps,*.aux,*.log}
 
 clean:
-       -rm -f *.aux *.log *.dvi *.toc *.out *.pdf
+       -rm -f {,sm/}{*.aux,*.log,*.dvi,*.toc,*.out,*.pdf,*.png}