# gmake makefile for usp program.

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

Libes		:= ${MathAdvO} -lut -lieeeio -lfu
#
# Add an architecture library variable which may be set in one of the gmake
# rules files referenced above. Initialized with SOLARIS port.. - jmw 8/9/93
#
Libes		:= ${Libes} ${${TArchDir}Libes}

F77Srcs		:= uspmath.F functions.f

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

PRGM		:= ${LocalBin}/uspmath
#PRGM		:= ${DEVPATH}/bin/uspmath
#PRGM		:= ./uspmath

targets : ${PRGM}

all :  safe targets remotes install

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

install:
	mancopy 1 uspmath
	execopy  uspmath
	shadowexec -v execopy uspmath

remotes:	RemoteCopies RemoteMakes

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

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


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