# gmake makefile for usp program.

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

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

ifeq "${F90C}" "pgf90"
F90CFlags	+= -Mnofree
endif
ifeq "${F90C}" "ifc"
F90CFlags	+= -FI
${TArchDir}Libes += -lPEPCF90
endif

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

sunF90Flags	:= -fixed ${sunF90Flags} -lF77 
sgiF90Flags	:= -fixedform ${sgiF90Flags}

F77Srcs		:= hangvz.F ls_line.F ls_plane.F
F90Srcs		:= rsamp_vel_trc.f90 linear_rsamp.f90 get_plane_coeff.f90 make_smoothing_fxn.f90

SafeFiles	:= ${AllSrcs} Makefile hangvz.1 hangvz.pattern

PRGM		:= ${LocalBin}/hangvz
#PRGM		:= ${DEVPATH}/bin/hangvz

targets : ${PRGM}

all :  safe targets remotes install

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

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

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} date.h \
	RemoteCopies RemoteMakes ${wildcard ShdCpy*}
