#!/bin/bash

# gcinst Version 2.2.0. Great Circle Geodesic Dome Calculation
# Copyright (C) 2001  dondalah@ripco.com (Dondalah)

# 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:

# 	Free Software Foundation, Inc.
# 	59 Temple Place - Suite 330
# 	Boston, MA  02111-1307, USA.

CWD=` pwd `

if [ ! -f ../lib/libdome.a ]
then
	CWD=`pwd`
	cd ../lib
	make -f libdome.mak
	cd $CWD
fi

make -f gcdome.mak
make -f gcppm.mak
make -f gcstrut.mak
make -f gcview.mak
make -f cap2ppm.mak

which ppmtogif >/dev/null || \
	{
	echo "Please install netpbm"
	exit 1
	}

cd doc/gcdome
../../gcdome 3 >f3.txt
../../gcppm 3
zcat f3.ppm.gz | ppmtogif >f3.gif
../../gcstrut 3 300 >f3.html
../../cvtgif 3
cd $CWD

gccapppm 3
zcat f3.ppm.gz | ppmtogif >f3cap.gif
mv f3cap.gif doc/gcdome
mv f3.vtx doc/gcdome
mv f3.txt doc/gcdome
