X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=Makefile;h=58a7ae5f9e11c08a1111c1c948e6d3660ae620ee;hb=36753e2ffb06df7098fbe0e8f1760870f75741e5;hp=d7b53f58fadad6f56cc35036b846755846476388;hpb=2104707be872a6658e11b204ba1e71844001ae46;p=wfpl-cms.git diff --git a/Makefile b/Makefile index d7b53f5..58a7ae5 100644 --- a/Makefile +++ b/Makefile @@ -1,16 +1,40 @@ +svgs= +generated_images= $(svgs:.svg=.png) +images= +images += $(generated_images) -all: style.css tags +objects= $(generated_images) .image-mtimes.styl style.css tags -init: files cms_images all +all: $(objects) -files: - mkdir -m 777 $@ +clean: + rm -f $(objects) -cms_images: - mkdir -m 777 $@ +style.css: styl.styl .image-mtimes.styl + compile-stylus $< -tags: *.php code/*.php code/wfpl/*.php - exuberant-ctags *.php code/*.php code/wfpl/*.php +.image-mtimes.styl: $(images) + ( \ + echo -n 'mtimes = {'; \ + 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 \ + ) -style.css: style.less - lessc -x $< $@ +tags: *.php code/*.php inc/wfpl/*.php + exuberant-ctags *.php code/*.php inc/wfpl/*.php