+svgs=
+generated_images= $(svgs:.svg=.png)
+images=
+images += $(svgs)
+images += $(generated_images)
-all: style.css tags
+objects= $(generated_images) .sha1sums.styl css.css tags
-tags: *.php code/*.php code/wfpl/*.php
- exuberant-ctags *.php code/*.php code/wfpl/*.php
+all: $(objects)
-style.css: style.less
- lessc $< $@
+clean:
+ rm -f $(objects)
+
+css.css: style.styl .sha1sums.styl
+ compile-stylus $< $@
+
+.sha1sums.styl: $(images)
+ ( \
+ echo -n 'sha1 = {'; \
+ div=' '; \
+ for x in $^; do \
+ echo -n "$$div '$$x': \"$$x?m=$$(sha1sum < $$x | head -c 10)\""; \
+ div=,; \
+ done; \
+ echo " }"; \
+ ) > $@ || ( \
+ rm -f $@; \
+ exit 1; \
+ )
+%.png: %.svg
+ ( \
+ inkscape -f $< -e $@ --export-area-page --without-gui --export-dpi=360 \
+ && mogrify -alpha off -geometry '25%' $@ \
+ && pngfix $@ \
+ ) || ( \
+ rm -f $@ \
+ ; exit 1 \
+ )
+
+tags: *.php inc/*.php inc/wfpl/*.php
+ exuberant-ctags *.php inc/*.php inc/wfpl/*.php