X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=Makefile;h=5787916081b62308e2d5dabed57d22c4bb897aa3;hb=90f02252aa537bb653c2496f94acf801c2ea019f;hp=11039bcdf7cd348ee5a4749a93cc27d50d44b62f;hpb=be246293072b9e3b10aa10219dbfcb575cc955a8;p=wfpl-cms.git diff --git a/Makefile b/Makefile index 11039bc..5787916 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) .sha1sums.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 .sha1sums.styl + compile-stylus $< -tags: *.php code/*.php code/wfpl/*.php - exuberant-ctags *.php code/*.php code/wfpl/*.php +.sha1sums.styl: $(images) + ( \ + echo -n 'mtimes = {'; \ + 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 $< $@ +tags: *.php inc/*.php inc/wfpl/*.php + exuberant-ctags *.php inc/*.php inc/wfpl/*.php