-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathMakefile
34 lines (25 loc) · 811 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
.POSIX:
IN_EXT ?= .gnuplot
GIF_EXT ?= .gif
PNG_EXT ?= .png
WEB ?= web
ZIP ?= gnuplot-examples.zip
GIFS := $(patsubst %$(GIF_EXT)$(IN_EXT),%$(GIF_EXT),$(wildcard *$(IN_EXT)))
PNGS := $(patsubst %$(IN_EXT),%$(PNG_EXT),$(wildcard *$(IN_EXT)))
# Remove some special files that should not be rendered.
PNGS := $(filter-out main$(PNG_EXT) template$(PNG_EXT),$(PNGS))
.PHONY: clean web zip
all: $(PNGS) $(GIFS)
%$(PNG_EXT): %$(IN_EXT)
gnuplot -e 'set terminal png' -e 'set output "$@"' '$<'
%$(GIF_EXT): %$(GIF_EXT)$(IN_EXT)
gnuplot -e 'set terminal gif animate delay 10' -e 'set output "$@"' '$<'
clean:
rm -fr *$(GIF_EXT) *$(PNG_EXT) '$(ZIP)' '$(WEB)'
web: all
mkdir -p '$(WEB)'
cp *$(GIF_EXT) *$(PNG_EXT) '$(WEB)'
./make-web '$(WEB)'
zip: all
rm -f '$(ZIP)'
zip -r '$(ZIP)' *$(GIF_EXT) *$(PNG_EXT)