# 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		:= ${Libes} -lut ${MathAdvO} -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}

#  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}

F77Srcs		:= sis_xy.F cmdln.F help.F verbal.F LoadFirstTrace.F

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

PRGM		:= ${LocalBin}/sis_xy

targets : ${PRGM}

all :  safe clean targets install remotes

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

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

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

#  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*}
