# /usr/share/doc/jsurf-alggeo/examples/Makefile
#
# Ad hoc Makefile for composing the sample jsurf scripts distributed
# within the debian package jsurf-alggeo.
#
# Recommended usage:
#  create a dedicated folder somewhere in your HOME directory;
#  link all the files in /usr/share/doc/jsurf-alggeo/examples in the dedicated folder;
#  launch this Makefile in the dedicated folder:
#  $ make ;
#  for a cleanup, consider the clean target:
#  $ make clean ;
#  for other targets, just read the Makefile;
#  display the PNG images with `display' (graphicsmagick-imagemagick-compat Debian package):
#  $ for ff in $(ls *.png); do display $ff ; done
#  or if you do not like loops:
#  $ display tutorial_zitrus.png
#
# written for Debian by Jerome Benoit <calculus@rezozer.net>
# on behalf of the Debian Science Team
# copyright: 2015 Jerome Benoit <calculus@rezozer.net>
# distributed under the terms and conditions of GPL version 3 or later
#

OPT_SIZE ?= 512
OPT_QUALITY ?= 1

JSURFALGGEO ?= /usr/bin/jsurf-alggeo

JSURFSCRIPTS = $(wildcard *.jsurf)

PNGIMAGES = $(patsubst %.jsurf,%.png, $(JSURFSCRIPTS))

default: all

all: png

check: png

png: $(PNGIMAGES)

clean:
	$(RM) $(PNGIMAGES)

%.png: %.jsurf
	$(JSURFALGGEO) --size $(OPT_SIZE) --quality $(OPT_QUALITY) --output $@ $<
