#
# Makefile for WebMagick Documentation Images
#
# Copyright Bob Friesenhahn, 1999
#
AUTOMAKE_OPTIONS = 1.2

SUFFIXES = .eps .fig .gif .jpg .png

FROM_PS_FLAGS = -verbose -density 144 -geometry 50%
TO_PS_FLAGS   = -verbose -colors 32 -colorspace gray
FIG_TO_JPG_FLAGS = -L jpeg -q 100

# FIG --> GIF
%.gif : %.fig
	convert $(FROM_PS_FLAGS) -colors 32 $< $@
# JPEG --> GIF
%.gif : %.jpg
	convert -colors 32 $< $@
# FIG --> JPEG
%.jpg : %.fig
	#convert $(FROM_PS_FLAGS) $< $@
	fig2dev $(FIG_TO_JPG_FLAGS) $< $@
# JPEG --> EPS
%.eps : %.jpg
	convert $(TO_PS_FLAGS) $< $@
# FIG --> EPS
%.eps : %.fig
	convert $(TO_PS_FLAGS) $< $@
# EPS -> PDF
%.pdf : %.eps
	epstopdf $<

# Additional files to distribute
FIG_SRCS = \
frame-style-1.fig \
frame-style-2.fig \
frame-style-3.fig \
frame-style-4.fig \
thumbnail-anatomy-framed.fig \
thumbnail-anatomy-plain.fig

JPEG_SRCS = \
montage-sample-framed.jpg \
thumbnail-sample-framed.jpg \
thumbnail-sample-plain.jpg

GIF_TGTS = \
frame-style-1.gif \
frame-style-2.gif \
frame-style-3.gif \
frame-style-4.gif \
montage-sample-framed.gif \
thumbnail-anatomy-framed.gif \
thumbnail-anatomy-plain.gif \
thumbnail-sample-framed.gif \
thumbnail-sample-plain.gif

JPEG_TGTS = \
frame-style-1.jpg \
frame-style-2.jpg \
frame-style-3.jpg \
frame-style-4.jpg \
thumbnail-anatomy-framed.jpg \
thumbnail-anatomy-plain.jpg

EPS_TGTS = \
frame-style-1.eps \
frame-style-2.eps \
frame-style-3.eps \
frame-style-4.eps \
montage-sample-framed.eps \
thumbnail-anatomy-framed.eps \
thumbnail-anatomy-plain.eps \
thumbnail-sample-framed.eps \
thumbnail-sample-plain.eps

PDF_TGTS = \
frame-style-1.pdf \
frame-style-2.pdf \
frame-style-3.pdf \
frame-style-4.pdf \
montage-sample-framed.pdf \
thumbnail-anatomy-framed.pdf \
thumbnail-anatomy-plain.pdf \
thumbnail-sample-framed.pdf \
thumbnail-sample-plain.pdf

EXTRA_DIST = $(JPEG_TGTS) $(JPEG_SRCS)

all-local: $(JPEG_TGTS)

dvi-local:

clean-local:

distclean-local:

maintainer-clean-local:
	rm -f $(GIF_TGTS) $(JPEG_TGTS) $(EPS_TGTS) $(PDF_TGTS)
