#!/usr/bin/make -rRf
# Makefile for MagicPoint presentations
# Copyright (C) 2004 Mark Suter <mark.suter@miju.com.au>
# 
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
# 
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
# 
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA

SOURCES = fdl.txt gpl.txt mimedefang.mgp images/email-overview.eps images/mimedefang-architecture.eps images/sturgeon-logo.eps

live: $(SOURCES)
	exec mgp -x freetype -q -F 1 -R -G -t 25 mimedefang.mgp

cache: $(SOURCES)
	mgp -x freetype -q -d mimedefang.mgp

preview: $(SOURCES)
	exec mgp -x freetype -q -g 320x240-0+0 mimedefang.mgp

html: $(SOURCES)
	mkdir -p html
	mgp -x freetype -D html -q -g 800x600 mimedefang.mgp

fdl.txt:
	wget http://www.gnu.org/licenses/fdl.txt

gpl.txt:
	wget http://www.gnu.org/licenses/gpl.txt

%.eps: %.fig
	fig2dev -L eps -b 5 $< $@

%.eps: %.gif
	convert $< $@

%.ps: %.mgp
	mgp2ps -c $< > $@

%.pdf: %.ps
	ps2pdf $< > $@

web: html mimedefang.ps mimedefang.pdf

spell:
	exec aspell --dont-backup --check mimedefang.mgp 

clean:
	rm -f .gscache* *.bak *~ images/*.eps images/.gscache*

veryclean: clean
	rm -f mimedefang.tar.gz mimedefang.ps mimedefang.pdf
	rm -rf html

dist: clean
	tar cvzf mimedefang.tar.gz -C .. --exclude mimedefang.tar.gz $$(basename $$(pwd))

.PHONY: live cache preview web spell clean veryclean dist

