remove none-existing reference
[PyX.git] / examples / Makefile
blob58c094e2042e6243320bfb69be607d04d476fe17
1 PYTHON ?= python3
2 GS ?= gs
4 files = $(foreach item, $(shell grep -v / INDEX), $(item)) $(foreach item, $(shell grep / INDEX), $(addprefix $(item), $(shell cat $(item)INDEX)))
5 pyfiles = $(addsuffix .py, $(files))
6 epsfiles = $(addsuffix .eps, $(files))
7 pdffiles = $(addsuffix .pdf, $(files))
8 pngfiles = $(addsuffix .png, $(files))
9 ipynbfiles = $(addsuffix .ipynb, $(files))
10 thumbpngfiles = $(addsuffix _thumb.png, $(files))
12 .PRECIOUS: $(epsfiles) $(pngfiles)
14 all:
15 rm -f $(epsfiles) $(pdffiles) $(pngfiles) $(ipynbfiles) $(thumbpngfiles)
16 make $(ipynbfiles)
17 make $(thumbpngfiles)
19 %.eps: %.py
20 cd $(dir $^); PYTHONPATH=$(CURDIR)/.. $(PYTHON) -W default $(notdir $^)
22 %.ipynb: %.png
23 $(PYTHON) $(CURDIR)/../www/mkipynb.py $@
25 misc/pattern.png: misc/pattern.eps
26 $(GS) -r400 -dEPSCrop -dNOPAUSE -dQUIET -dBATCH -sDEVICE=pnm -sOutputFile=- $^|pnmscale 0.25|pnmtopng -transparent 'rgb:ff/ff/ff' > $@
28 misc/pattern_thumb.png: misc/pattern.eps
29 $(GS) -r200 -dEPSCrop -dNOPAUSE -dQUIET -dBATCH -sDEVICE=pnm -sOutputFile=- $^|pnmscale 0.25|pnmtopng -transparent 'rgb:ff/ff/ff' > $@
31 %.png: %.eps
32 $(GS) -r100 -dEPSCrop -dNOPAUSE -dQUIET -dBATCH -sDEVICE=pngalpha -dTextAlphaBits=4 -dGraphicsAlphaBits=4 -sOutputFile=$@ $^
34 %_thumb.png: %.eps
35 $(GS) -r50 -dEPSCrop -dNOPAUSE -dQUIET -dBATCH -sDEVICE=pngalpha -dTextAlphaBits=4 -dGraphicsAlphaBits=4 -sOutputFile=$@ $^