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

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

# define the targets

PRGM		:=	${LocalBin}/qdslice

# set the architecture dependent variables

CCFlags		:=	${CCFlags} -D_NO_PROTO -O
ifeq "${FILE_OFFSET_BITS}" "64"
CCFlags	:=	${CCFlags} -DFSEEKO
endif
sunCCFlags	:=	${sunCCFlags} -DSUN
crayCCFlags	:=	${crayCCFlags} -DCRAY
crayFCFlags	:=      -DCRAY -Wf"-i64"
#
# - libieeeio.a is only included to get the byte-swapping routines
#
Libes           :=      -lut -lcu -lieeeio -lm
#
# 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}

CSrcs		:=	qdslice.c

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

.PHONY:	all

targets:	${PRGM}

all:	safe clean targets install remotes

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

saber: ${CSrcs}
	-rm -f saber.make
	echo "saber: ${CSrcs}" > saber.make
	echo "	#setopt make_prog gmake" >> saber.make
	echo "	#setopt make_symbol !" >> saber.make
	echo "	#load ${IncludeDirs} ${CFlags} ${CSrcs} ${LibDirs} ${Libes}" >> saber.make

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

remotes:	RemoteCopies  RemoteMakes

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

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

include ${TArchDir}/included.files

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

safe:	.safe.${jdate}.Z

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


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