Makefile
1.67 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
42
43
44
45
46
47
48
49
50
51
52
53
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)))
DESC=Descriptif Concept Activites
DESC_JPG=$(addprefix desc,$(addsuffix .jpg,$(DESC)))
ALL=$(COMPRESSED) $(MATRIXED) $(PLACEHOLDERS_PNG) $(DESC_JPG) $(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 $@
# DESCRIPTION
descDescriptif.jpg: orig/descDescriptif.jpg
convert $< -set option:size '%[fx:min(w,h)]x%[fx:min(w,h)]' xc:none +swap -gravity center -composite -resize x400 -quality 90% $@
descConcept.jpg: orig/descConcept.png
convert $< -set option:size '%[fx:min(w,h)]x%[fx:min(w,h)]' xc:none +swap -gravity center -composite -resize x400 -quality 90% $@
descActivites.jpg: orig/descActivites.jpg
convert $< -set option:size '%[fx:min(w,h)]x%[fx:min(w,h)]' xc:none +swap -gravity east -composite -resize x400 -quality 90% $@
# 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)