fix cross-device link error
[PyX.git] / examples / Makefile
blob2de8d84804294d457e49032b036d6f54d92e7762
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 all_without_remove:
20 make $(ipynbfiles)
21 make $(thumbpngfiles)
23 %.eps: %.py
24 cd $(dir $^); PYTHONPATH=$(CURDIR)/.. $(PYTHON) -W default $(notdir $^)
26 %.ipynb: %.png
27 $(PYTHON) $(CURDIR)/../www/mkipynb.py $@
29 %.png: %.eps
30 $(GS) -r100 -dEPSCrop -dNOPAUSE -dQUIET -dBATCH -sDEVICE=pngalpha -dTextAlphaBits=4 -dGraphicsAlphaBits=4 -sOutputFile=$@ $^
32 %_thumb.png: %.eps
33 $(GS) -r50 -dEPSCrop -dNOPAUSE -dQUIET -dBATCH -sDEVICE=pngalpha -dTextAlphaBits=4 -dGraphicsAlphaBits=4 -sOutputFile=$@ $^