#!/usr/bin/amake
#
# Makefile to compile the showfont sample with amake
# (at this time, it will NOT work with other make tools)
# Written by Alexis Wilke for Made to Order Software Corp. (c) 2002-2009
#
# Copyright (c) 2002-2009 Made to Order Software Corp.
#
# Permission is hereby granted, free of charge, to any
# person obtaining a copy of this software and
# associated documentation files (the "Software"), to
# deal in the Software without restriction, including
# without limitation the rights to use, copy, modify,
# merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom
# the Software is furnished to do so, subject to the
# following conditions:
#
# The above copyright notice and this permission notice
# shall be included in all copies or substantial
# portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF
# ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
# LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
# FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO
# EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
# WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
# ARISING FROM, OUT OF OR IN CONNECTION WITH THE
# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
#

#if system(IRIX)
CFLAGS:=-DIRIX=1 -L/usr/freeware/lib32 -fullwarn
#else
CFLAGS:=-DIRIX=0 -Wall
#endif


CFLAGS+=-g -O2
MOLIB:=../../lib/libsswf.a
CXX:=g++

# The list of fonts we want to generate
FONTS:=fotinos blue_highway-condensed


all: $(FONTS:*=*.swf)
	@echo "All Done!"

$(FONTS:*=.swf): showfont showfont.tsswf showfont.xhtml ../../include/sswf/scripts/fonts/font-$(.STEM).sswf \
			../../include/sswf/scripts/fonts/font-fotinos.sswf
	./showfont ../../include/sswf/scripts/fonts/font-$(.STEM).sswf showfont.tsswf showfont.xhtml
	../../bin/sswf -Dscreen_width=682 -Dscreen_height=722 \
		-o $(.TARGET) $(.STEM).sswf ../../include/sswf/scripts/colors.sswf \
		../../include/sswf/scripts/fonts/font-$(.STEM).sswf \
		$(.STEM:-fotinos:*=>../../include/sswf/scripts/fonts/font-fotinos.sswf)


showfont: showfont.c++ $(MOLIB)
	$(CXX) $(CFLAGS) -o $@ $< $(MOLIB) -ljpeg -lz


clean: .PHONY
	rm -f $(FONTS:*=*.\\*)
	rm -f showfont


