Makefile
1.06 KB
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
35
36
37
38
39
40
41
VECTORS=$(shell echo *.svg)
PLACEHOLDERS=200
CUSTOM=mainBgPattern.png polyMap.png
COMPRESSED=$(shell cd orig; echo *.jpg)
MATRIXED=$(subst svg,png,$(VECTORS))
PLACEHOLDERS_PNG=$(addprefix ph,$(addsuffix .png,$(PLACEHOLDERS)))
ALL=$(COMPRESSED) $(MATRIXED) $(PLACEHOLDERS_PNG) $(CUSTOM)
all: $(ALL)
# CUSTOM
mainBgPattern.png:
wget http://subtlepatterns.com/patterns/low_contrast_linen.png -O $@
convert -negate $@ $@
convert -channel B -evaluate multiply 1.2 $@ $@
optipng -o7 $@
polyMap.png:
wget "https://maps.googleapis.com/maps/api/staticmap?center=50.6074998,3.1373338&zoom=16&size=640x200&scale=2&maptype=roadmap&markers=color:red%7Clabel:P%7C50.6074998,3.1373338" -O $@
optipng -o7 $@
# PLACEHOLDERS
ph%.png:
wget "http://fakeimg.pl/$(subst ph,,$(subst .png,,$@))/" -O $@
optipng -o7 $@
# MATRIXED
# $(MATRIXED): $(subst png,svg,$@)
%.png: %.svg
convert -background none $< $@
optipng -o7 $@
# COMPRESSED
# $(COMPRESSED): orig/$@
%.jpg: orig/%.jpg
convert -resize x1200 -strip -interlace Plane -gaussian-blur 0.05 -quality 90% $< $@
clean:
rm -rf $(ALL)