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

# gmake Makefile for src/cmd/xplots
# Bill Done	89/9/13
# converted from David Harrison's Makefile to a Makefile for gmake

#
# Makefile for the xplots program
#
# David Harrison
# University of California,  Berkeley
# 1987
#
# NOTE: the libCreate library is a library I wrote to replace XCreate
#       and XCreateTerm with ones I think provide a better interface.
#       If you do not have this library,  you can get it from hoser.
#       If you don't want to use it,  just take it out of the LIBS
#   line below.
#
#       Shading added by P. R. Gutowski
#
 
include ${DEPTROOT}/usp/etc/gmake.init
include ${DEPTROOT}/etc/gmake.motif1.2
ifeq "${Vendor}" "sun"
include ${DEPTROOT}/etc/gmake.dt
endif

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

# set the architecture dependent variables

sun3CCFlags	:=	${sun3CCFlags} -DSUN -O 
sun3fpaCCFlags	:=	${sun3fpaCCFlags} -DSUN -ffpa -O
sun4CCFlags	:=	${sun4CCFlags} -DSUN -O
sun4cg92CCFlags	:=	${sun4cg92CCFlags} -DSUN -DBSD_COMP 
crayCCFlags	:=	${crayCCFlags} -DCRAY

sun3FCFlags	:=	${sun3FCFlags} -DSUN -O
sun3fpaFCFlags	:=	${sun3fpaFCFlags} -DSUN -ffpa -O
sun4FCFlags	:=	${sun4FCFlags} -DSUN -O
crayFCFlags	:=	${crayFCFlags} -DCRAY -Wf"-ePws" -Wf"-dp"

sun3CLFlags	:=	${sun3CLFlags} -Bstatic
sun3fpaCLFlags	:=	${sun3fpaCLFlags} -Bstatic
sun4CLFlags	:=	${sun4CLFlags} -Bstatic

CommonLibes	:= 	-lxlibplot -lXaw -lXmu -lXt -lX11 -lm
cray2Libes	:= 	-lnet

# sun4cg92Libes	:= 	-lsocket -B dynamic \
# 			-R /usr/lib/X11R5 -ldl -B static -lform -lnsl -lintl

ifneq "${SOLARIS}"  ""
sunLibes   :=      ${sunLibes} -Bdynamic -lSM -lICE -lXext -lgen -lsocket \
			-B dynamic -R /usr/lib/X11R6 \
			-ldl -B static -lform -lnsl -lintl
endif

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

CSrcs		:=	xplots.c

SafeFiles	:=	${AllSrcs} ${wildcard *.1} Makefile ${wildcard *.h *.11 README*}  xplots.pattern

.PHONY:	all 

targets:	${PRGM}

all:	safe clean targets install remotes

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

install:
	mancopy 1 xplots
	execopy xplots
	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}
	${FindIncludes}

safe:	.safe.${jdate}.Z

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

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