#!/bin/sh

# Get machine info
#
WWHelp_OS=`uname`
WWHelp_MachineName=`uname -n`

# Set compiler options
#
WWHelp_COptions="-I/usr/X/include -I/usr/X11R6/include"
if [ "${WWHelp_OS}" = "HP-UX" ] ; then
  WWHelp_COptions="-Aa ${WWHelp_COptions}"
fi

# Create compile directory if it doesn't exist
#
if [ ! -d "${WWHelp_MachineName}" ] ; then
  mkdir "${WWHelp_MachineName}"
fi

# Change into the compile directory
#
cd "${WWHelp_MachineName}"

# Compile files
#
cc ${WWHelp_COptions} -I../../../src -o wwhurl.o  -c ../../../src/wwhurl.c
cc ${WWHelp_COptions} -I../../../src -o wwhcomm.o -c ../../../src/wwhcomm.c
cc ${WWHelp_COptions} -I../../../src -o wwhunix.o -c ../../../src/wwhunix.c
cc ${WWHelp_COptions} -I../../../src -o wwhapi.o  -c ../../../src/wwhapi.c
cc ${WWHelp_COptions} -I../../../src -o main.o    -c ../../src/main.c

# Link test program
#
cc -L/usr/X/lib -L/usr/X11R6/lib -lX11 -lXmu -o example wwhurl.o wwhcomm.o wwhunix.o wwhapi.o main.o
