########################################################################
#                 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 -O 
sunCCFlags      :=      ${sunCCFlags} -DSUN
#ifneq "${SOLARIS}" ""
# sunCCFlags	:=	${sunCCFlags} -DSYSV
#endif
hpCCFlags      :=       ${hpCCFlags} -Ae -DSYSV
sun4CCFlags     :=      ${sun4CCFlags}
crayCCFlags     :=      ${crayCCFlags} -DCRAY
crayFCFlags     :=      ${crayFCFlags} -DCRAY -i64
 
# set the architecture dependent variables
CommonLibes     :=      -Bdynamic -lXt -lX11 -Bstatic -lm -lcu
sunLibes   	:=      ${sunLibes}
crayLibes   	:=      ${crayLibes} -lXmu
sgiLibes   	:=      ${sgiLibes}
hpLibes   	:=      ${hpLibes}
crayLibes       :=      -lc

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

PRGM := ${LocalBin}/xshowras

CSrcs := bright.c clip.c cmuwmraster.c compress.c dither.c faces.c \
	 fbm.c fill.c g3.c getroot.c gif.c halftone.c imagetypes.c \
	 img.c mac.c mc_tables.c mcidas.c merge.c misc.c new.c options.c \
	 path.c pbm.c pcx.c print.c reduce.c rle.c rlelib.c root.c rotate.c \
	 send.c smooth.c sunraster.c sunsave.c value.c window.c xbitmap.c \
	 xloadimage.c xpixmap.c xwd.c zio.c zoom.c

SafeFiles	:=	Makefile ${AllSrcs} ${wildcard *.h} \
			patchlevel mit.cpyrght xshowras.1

targets:  ${PRGM}

all: safe clean targets remotes install

install: targets remotes
	apps-mancopy  xaprtools 1 xshowras
	apps-execopy  xaprtools prod xshowras
	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}

