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

# include ${DEPTROOT}/etc/gmake.init
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
include ${DEPTROOT}/etc/gmake.motif2.0
#endif

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

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

PRGM := ${LocalBin}/xalert

CSrcs := xalert.c 

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

targets:  ${PRGM}

all: safe clean targets remotes install

install: targets remotes
	apps-mancopy xaprtools 1 xalert
	apps-execopy  xaprtools prod xalert
	shadowexec -v ${MAKE} install

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

all:  safe targets remotes

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}

