X-Git-Url: https://jasonwoof.com/gitweb/?p=wfpl-cms.git;a=blobdiff_plain;f=Makefile;h=e6222d180c0fb7caf6f8aeac43c4603e0277ba61;hp=d7b53f58fadad6f56cc35036b846755846476388;hb=75ac4ad08bdca7f026d518698ed2a05860016e0d;hpb=2104707be872a6658e11b204ba1e71844001ae46 diff --git a/Makefile b/Makefile index d7b53f5..e6222d1 100644 --- a/Makefile +++ b/Makefile @@ -1,16 +1,44 @@ +svgs= images/sprites.svg +minified_svgs= $(svgs:.svg=.min.svg) +generated_images= $(svgs:.svg=.png) +images= +images += $(generated_images) $(minified_svgs) -all: style.css tags +objects= $(generated_images) $(minified_svgs) .sha1sums.styl css.css tags -init: files cms_images all +all: $(objects) -files: - mkdir -m 777 $@ +clean: + rm -f $(objects) -cms_images: - mkdir -m 777 $@ +css.css: style.styl .sha1sums.styl inc/wfpl/stylus_helpers.styl + stylus -p $< > $@ || rm -f "$@" -tags: *.php code/*.php code/wfpl/*.php - exuberant-ctags *.php code/*.php code/wfpl/*.php +.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 \ + ) -style.css: style.less - lessc -x $< $@ +%.min.svg: %.svg + svgo $< $@ + +tags: *.php inc/*.php inc/wfpl/*.php + ctags *.php inc/*.php inc/wfpl/*.php