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


# gmake Makefile for src/cmd/vsmx
# Bill Done	90/8/22
 
include ${DEPTROOT}/usp/etc/gmake.init

# get the qtc math advantage directory and file name.
#   place overrides after the include statement.
include ${DEPTROOT}/etc/gmake.mathadv

# define the targets

PRGM		:=	${LocalBin}/vsmx

# set the architecture dependent variables

#sunCCFlags	:=	${sunCCFlags} -DIODEBUG -DSUN -O 
#crayCCFlags	:=	${crayCCFlags} -DIODEBUG -DCRAY

#sun4FCFlags	:=	${sun4FCFlags} -DIODEBUG -DSUN -O
#crayFCFlags	:=	${crayFCFlags} -DIODEBUG -DCRAY -Wf"-es" -Wf"-dp"
crayFCFlags    :=      ${crayFCFlags} -DCRAY -Wf"-es" -Wf"-dp"

hpFLFlags	:=	${hpFLFlags} +U77

Libes		:= 	${MathAdvO} -lfu -lut -lieeeio -lm 
# crayLibes	:= 	-lnet

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

F77Srcs		:=	vsmxae.F  rdparmae.F  alftmm.F  asrtmm.F  dwmtmm.F  \
			dwrtmm.F  mdianm.F  modtmm.F  rngtmm.F  sortqk.F

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

.PHONY:	all safe remotes targets

targets:	${PRGM}

all:	safe clean targets remotes install

${PRGM}:  ${F77Objs} Makefile
	${LinkF} -o $@ ${F77Objs} ${Libes}

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

remotes:	RemoteCopies  RemoteMakes

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

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

include ${TArchDir}/included.files

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

safe:	.safe.${jdate}.Z

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

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