JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
stylus: scaling spritesheets
[wfpl.git] / metaform / Makefile
1 svgs=
2 generated_images= $(svgs:.svg=.png)
3 images=
4 images += $(generated_images)
5
6 objects= $(generated_images) .image-mtimes.styl style.css tags
7
8 all: $(objects)
9
10 clean:
11         rm -f $(objects)
12
13 style.css: styl.styl .image-mtimes.styl
14         compile-stylus $<
15
16 .image-mtimes.styl: $(images)
17         ( \
18                 echo -n 'w-mtime = {'; \
19                 div=' '; \
20                 for x in $^; do \
21                         echo -n "$$div '$$x': \"$$x?m=$$(stat -c '%Y' $$x)\""; \
22                         div=,; \
23                 done; \
24                 echo " }"; \
25         ) > $@ || ( \
26                 rm -f $@; \
27                 exit 1; \
28         )
29 %.png: %.svg
30         ( \
31                 inkscape -f $< -e $@ --export-area-page --without-gui --export-dpi=360 \
32                 && mogrify -alpha off -geometry '25%' $@ \
33                 && pngfix $@ \
34         ) || ( \
35                 rm -f $@ \
36                 ; exit 1 \
37         )
38
39 tags: *.php inc/*.php inc/wfpl/*.php
40         exuberant-ctags *.php inc/*.php inc/wfpl/*.php