X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=Makefile;h=afd28b17c3d1a64bd158151487baa7eb61548a55;hb=a5bb768c8008b3d34a0461428f6a8ddbc05592a5;hp=9eeb0f444ca8c2dec2a87b32f239bdc013075157;hpb=23e93d1d63fc861743101a07f3855afb886c0f93;p=wfpl-cms.git diff --git a/Makefile b/Makefile index 9eeb0f4..afd28b1 100644 --- a/Makefile +++ b/Makefile @@ -1,8 +1,44 @@ +svgs= +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 -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 + stylus -c -p $< > $@ || rm -f "$@" + +.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 \ + ) + +%.min.svg: %.svg + svgo $< $@ + +tags: *.php inc/*.php inc/wfpl/*.php + ctags *.php inc/*.php inc/wfpl/*.php