#!/bin/sh

if test "$1" = "" ; then
   echo "Usage:   build all   /  build i    with i=1,2,3,4,5"
   exit
fi

if test "$1" = "all" ; then
   CONT=01234
else
   CONT=$[$i-1]
fi

if ! [ -x jpd2else ] ; then
   echo "Compiling jpd2else..."
   make
fi

cp -f header earth.vmf

echo 
echo "Building earth.vmf map for continent(s) '$1', with command:"
echo "    ./jpd2else -continent $1 ..."
./jpd2else -format vmf -continents $CONT -spacing 20 >> earth.vmf
echo "end" >> earth.vmf

echo
echo "Reading the earth.vmf map with sunclock..."
sunclock -map -mapimage earth.vmf -nonight -parallelmode 1 -meridianmode 1 \
         -setcolor "parallel|indianred" -setcolor "meridian|indianred" \
	 -citymode 0

