X-Git-Url: https://jasonwoof.com/gitweb/?p=wfpl-cms.git;a=blobdiff_plain;f=Makefile;h=6ad94788811b9e874c7d86c785fe0ab4bf497993;hp=9eeb0f444ca8c2dec2a87b32f239bdc013075157;hb=3ed0f0b53ff1b3ea3e30292bf39eb6e30935e9eb;hpb=23e93d1d63fc861743101a07f3855afb886c0f93 diff --git a/Makefile b/Makefile index 9eeb0f4..6ad9478 100644 --- a/Makefile +++ b/Makefile @@ -1,8 +1,41 @@ +svgs= +generated_images= $(svgs:.svg=.png) +images= +images += $(svgs) +images += $(generated_images) -all: style.css tags +objects= $(generated_images) .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 + compile-stylus $< $@ + +.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 \ + ) + +tags: *.php inc/*.php inc/wfpl/*.php + exuberant-ctags *.php inc/*.php inc/wfpl/*.php