########################################################################
#                 copyright 2001, Amoco Production Company             #
#                             All Rights Reserved                      #
#                     an affiliate of BP America Inc.                  #
########################################################################


# gmake makefile for a usp program.
# Changes:
# 09/27/89	Terri Fischer
# 09/10/90	Terri Fischer	updated

# get the initialization files from .../etc

include ${DEPTROOT}/usp/etc/gmake.init
include ${DEPTROOT}/etc/gmake.mathadv

#  the libraray names (e.g. "ut") get translated into full path names
#  via the info in the initialization files above

Libes		+=  -lut ${MathAdvO} -lieeeio -lfu  -lm

ifneq "${SOLARIS}" ""
sunLIBES :=		${sunLIBES} -L/usr/ucblib -lucb -lsunmath \
			-L/usr/ucblib -lucb -lsunmath \
			-lm \
                        -Bdynamic -ldl -lintl
endif

Libes		:=	${Libes} ${${TArchDir}Libes} ${${Vendor}Libes}

#  define compiler flags.  The default optimization levels are set in the
#  gmake rules files.  If you need to change them do so here.

CCFlags		:=	${CCFlags}

# -O for optimized , -g for use with a debugger such as prism or xdbx
# once debugged set to -O for distribution

FCFlags		:=	${FCFlags}
#sunFCFlags	:=	${sunFCFlags} -DSUN -g

CSrcs  		:=	xsd_server.c \
			bits.c \
			deflate.c \
			zip.c \
			util.c \
			trees.c

ifeq "${FLD}" "pgf77"
intelFLFlags += -Mnomain
endif

SafeFiles	:= ${AllSrcs} Makefile ${wildcard *.h}

PRGM		:= ${LocalBin}/xsdServer

targets : ${PRGM}

all :  safe clean targets remotes install

${PRGM}    :  ${CObjs}
	${LinkF} -o $@ ${CObjs} ${Libes}

#  do remote make (i.e. in our case the cray, hp, convex, etc...)

remotes:	RemoteCopies RemoteMakes

install:
	mancopy 1 xsdServer
	execopy  xsdServer
	shadowexec -v ${MAKE} install

RemoteCopies:	${SafeFiles}
	shadowcopy -v $? && touch RemoteCopies

RemoteMakes:	${SafeFiles}
	shadowexec -v ${MAKE} && touch RemoteMakes

safe:	.safe.${jdate}.Z

.safe.${jdate}.Z:	${SafeFiles}
	${MakeSafe}

include ${TArchDir}/included.files

#  generate include files
#  date stamp source

${TArchDir}/included.files: ${AllSrcs}
	usp_d_stamp
	${FindIncludes}

clean:
	-rm ${TArchDir}/included.files ${AllObjs} ${PRGM} date.h RemoteCopies RemoteMakes ${wildcard ShdCpy*}
