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

include ${DEPTROOT}/xaprtools/etc/gmake.init
ifneq "${SOLARIS}"  ""
include ${DEPTROOT}/etc/gmake.apps.X11R6
include ${DEPTROOT}/etc/gmake.apps.motif1.2
else
include ${DEPTROOT}/etc/gmake.motif1.2
endif

CCFlags         :=      ${CCFlags} -D_NO_PROTO
sunCCFlags      :=      ${sunCCFlags} -DSUN
sun4CCFlags     :=      ${sun4CCFlags}
crayCCFlags     :=      ${crayCCFlags} -DCRAY
crayFCFlags     :=      ${crayFCFlags} -DCRAY -i64
 
# set the architecture dependent variables
CommonLibes     :=      -lxaprtools -lXm -lXt -lX11 -lm -lcu
sunLibes        +=      -lXmu
intelLibes      +=      -lXmu -lXext
crayLibes       +=      -lc
hpLibes         :=      

ifneq "${SOLARIS}"  ""
sunLibes   :=      ${sunLibes} -lSM -lICE -lgen -lsocket -B dynamic \
			-ldl -B static -lform -lnsl -lintl
CommonLibes :=	 -Bdynamic ${CommonLibes}
endif
 
Libes           :=      ${CommonLibes} ${${Vendor}Libes} ${${TArchDir}Libes}
 
OPT= -D_NO_PROTO -O  # production
#OPT= -D_NO_PROTO -g  # debug

PRGM := ${LocalBin}/xpanel

CSrcs := xpanel.c \
	addckfun.c already.c dobegin.c docol.c doend.c doexec.c\
	doinitval.c dolength.c domaxval.c dominval.c doname.c doprompt.c \
	doread.c dorow.c doscript.c dosuffix.c dotag.c dotype.c dowrite.c\
	doptany.c fclone.c fieldtype.c getarg.c getfields.c gettok.c\
	ignore.c isint.c isreal.c intcktype.c realcktype.c strcktype.c\
	lookup.c ngetc.c pathckexec.c pathckmax.c pathckmin.c\
	pathckread.c pathcksufx.c pathcktype.c pathckwrite.c pathckptype.c\
	psuffix.c putkwbak.c rtckfield.c runcommand.c scriptck.c \
	suffix.c docomment.c douppercase.c \
	yesnock.c widgetree.c \
	doon.c doprecision.c dirname.c \
	doselect.c dopick.c selectrd.c curdir.c

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

targets:  ${PRGM}

all: safe clean targets remotes

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

all:  safe targets remotes install

install:	targets remotes
	apps-execopy  xaprtools prod xpanel
	shadowexec -v ${MAKE} install
clean:
	-rm ${TArchDir}/included.files ${AllObjs} ${PRGM} RemoteCopies RemoteMakes ${wildcard ShdCpy*}  

remotes:	RemoteCopies RemoteMakes

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

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

safe:	.safe.${jdate}.Z

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

include ${TArchDir}/included.files

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

