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

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

PRGM		:=	${LocalBin}/vxos

# set the architecture dependent variables

CCFlags		:=	${CCFlags} -D_NO_PROTO 
sunCCFlags	:=	${sunCCFlags} -DSUN
sun4CCFlags	:=	${sun4CCFlags}
crayCCFlags	:=	${crayCCFlags} -DCRAY
crayFCFlags	:=      ${crayFCFlags} -DCRAY -i64

! sunCLFlags	:=	-Bdynamic

CommonLibes	:=	${CommonLibes} \
			-lXt -lXext -lX11 -lXext \
			-lut ${MathAdvO} -lieeeio -lcu

sunLibes   	:=      -lgen -lsocket -B dynamic \
			-ldl -B static -lform -lnsl -lintl

ifeq "${Vendor}"  "sun"
CommonLibes	:=	-B dynamic -lXm -B static ${CommonLibes}
OsArchRev	:=	${shell usp-osarch -r}
ifneq "${OsArchRev}" "5.5.1"
sunLibes   	:=      ${sunLibes} -B dynamic -lSM -lICE -B static 
else
sunLibes   	:=      ${sunLibes} -lc -lw
endif
else
CommonLibes	:=	-lXm ${CommonLibes}
endif

ifneq "${Absoft}" ""
CommonLibes	+=	-lc
endif

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

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

F77Srcs		:= apnmo.F aptaup.F bvel.F dagc.F imaxv.F \
		   iminv.F insamp.F shynmo.F

CSrcs		:=	vxos.c copyColormapToPrivate.c \
			new_2_create_widgets.c callbacks.c \
			bubble_sort.c create_data_dialog.c draw_mo.c \
			dumpWidgetTree.c get_ri.c new_2_digit.c \
			new_ColorEditor.c new_draw.c new_events.c \
			new_xos_utils.c sync_displayCB.c

SafeFiles	:=	${AllSrcs} Makefile ${wildcard *.h} \
			${wildcard *.xbm}

.PHONY:	all safe remotes targets

targets:	${PRGM}

all:	safe targets remotes install

install:	targets remotes
	execopy vxos
	shadowexec -v ${MAKE} install

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

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