X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=Makefile;h=f0d0adb07595fef5fdc4788ee768b956f21e80b9;hb=19da07bf62eaca97c6516e664733fa1d534389b3;hp=d7b53f58fadad6f56cc35036b846755846476388;hpb=840aed9b567c017dbc2f0b7648890c9084af7eec;p=wfpl-cms.git diff --git a/Makefile b/Makefile index d7b53f5..f0d0adb 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 $< + +.image-mtimes.styl: $(images) + ( \ + echo -n 'w-mtime = {'; \ + 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 \ + ) tags: *.php code/*.php code/wfpl/*.php exuberant-ctags *.php code/*.php code/wfpl/*.php - -style.css: style.less - lessc -x $< $@