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

# get the initialization files from .../etc

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

# Libes := -lXgoodies -lXmCreateVa -lagm -lagmutils -lgeometry -lstringutils -lmotifutils -lXext

# Libes := -lXgoodies -lXmCreateVa -lXext
Libes := -lXgoodies -lXmCreateVa
#
Libes		+=	${${Vendor}Libes} ${${TArchDir}Libes}

CommonLibes	:= 	${MathAdvO} \
			-Bdynamic -lXmCreateVa -lXm -lXt -lXext -lX11 \
			-lieeeio -lXgoodies -lcu -lut -lm

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

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

CCFlags		+=	
FCFlags		+=

ifeq "${Vendor}" "intel"
ifeq "${FLD}" "pgf77"
FLFlags += -Mnomain
endif
ifeq "${FLD}" "ifort"
FLFlags += -nofor_main
endif
endif

CSrcs		:=	 \
Dialog.c \
DigitalLine.c \
ExpandFile.c \
OkCancelHelpButtons.c \
ReadColor.c \
SeedFill.c \
agm.c \
agm2picks.c \
agm_io.c \
agm_io_db.c \
agm_to_picks.c \
animate.c \
attributes.c \
body.c \
client.c \
color.c \
colorhalf.c \
concat.c \
connect_segs2D.c \
create_string_table_from_list.c \
curv3dminmax.c \
data.c \
dconnect_segs2D.c \
dcurv3dminmax.c \
defaults.c \
display.c \
drmvduppoints.c \
editcolor.c \
editmenu.c \
editpick.c \
file.c \
free_string_table.c \
getFormatString.c \
getFormatTypes.c \
global.c \
header.c \
helpCB.c \
inflate.c \
interleave.c \
itoa.c \
itostr.c \
label.c \
load.c \
mail.c \
main.c \
menu.c \
model.c \
modelmenu.c \
modelpar.c \
mouse.c \
openfile.c \
overlay.c \
paint.c \
paintmenu.c \
paintsave.c \
pick.c \
picks2agm.c \
picks_to_agm.c \
print.c \
reportDSerror.c \
reverse.c \
reverse_poly3.c \
rmvduppoints.c \
rmvduppoints2.c \
rmvduppoints3.c \
rmvdupsubsegs.c \
rmvdupsubsegs3.c \
save.c \
showWatchCB.c \
showcolor.c \
specifyFormat.c \
unzip.c \
velmouse.c \
velocity.c \
velsave.c \
wiggle.c \
zoom.c

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

PRGM		:= ${LocalBin}/xsd

targets : ${PRGM}

all :  safe clean targets remotes install

${PRGM}    :  ${AllObjs}
	${LinkF} -o $@ ${AllObjs} ${Libes}

#  do remote make (i.e. in our case the cray, hp, convex, etc...)

remotes:	RemoteCopies RemoteMakes

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

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

#  generate include files
#  date stamp source

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

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