JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
metaform: use stylus instead of less
[wfpl.git] / metaform / Makefile
diff --git a/metaform/Makefile b/metaform/Makefile
new file mode 100644 (file)
index 0000000..f0d0adb
--- /dev/null
@@ -0,0 +1,40 @@
+svgs=
+generated_images= $(svgs:.svg=.png)
+images=
+images += $(generated_images)
+
+objects= $(generated_images) .image-mtimes.styl style.css tags
+
+all: $(objects)
+
+clean:
+       rm -f $(objects)
+
+style.css: styl.styl .image-mtimes.styl
+       compile-stylus $<
+
+.image-mtimes.styl: $(images)
+       ( \
+               echo -n 'w-mtime = {'; \
+               div=' '; \
+               for x in $^; do \
+                       echo -n "$$div '$$x': \"$$x?m=$$(stat -c '%Y' $$x)\""; \
+                       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 code/*.php code/wfpl/*.php
+       exuberant-ctags *.php code/*.php code/wfpl/*.php