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

# gmake Makefile for dskutil
# Joe M Wade     
 
include ${DEPTROOT}/usp/etc/gmake.init
include ${DEPTROOT}/etc/gmake.mathadv
include ${DEPTROOT}/etc/gmake.motif1.2
 
# define the targets

PRGM		:=	${LocalBin}/specal

# set the architecture dependent variables

CCFlags		:=	${CCFlags} -D_NO_PROTO
sunCCFlags	:=	${sunCCFlags} -DSUN
crayCCFlags	:=	${crayCCFlags} -DCRAY 
sgiCCFlags	+=      -I/usr/include/abi

CommonLibes := ${CommonLibes} -lfu -lut -lieeeio ${MathAdvO} \
        -Bdynamic -lXm -lXt -lX11 -lXext -Bstatic -lm -Bdynamic

crayLibes	:= 	-lnet -lc

ifneq "${SOLARIS}"  ""
sunLibes	:= 	${sunLibes} -Bdynamic -lSM -lICE \
			-Bstatic -lgen -lsocket -Bdynamic \
			-ldl -Bstatic -lform -lintl -lnsl 
endif

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

CSrcs           :=      specal.c  draw_it.c \
                        mouse.c ColorEditor.c \
                        spline.c splint.c free_vector.c vector.c

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

.PHONY:	all safe remotes targets

targets:	${PRGM}

all:	safe clean targets remotes Makefile install

ifeq "${FLD}" "pgf77"
TargetFlags += -Mnomain
endif

${PRGM}:		${CObjs}
	${LinkF} -o $@ ${CObjs} ${Libes} -Bdynamic

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

remotes:	RemoteCopies  RemoteMakes

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

RemoteMakes:	${SafeFiles}
	shadowexec -v  ${MAKE} -f Makefile && 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} date.h RemoteCopies RemoteMakes ${wildcard ShdCpy*}
