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

# gmake Makefile for dskutil
# Joe M Wade     
 
include ${DEPTROOT}/usp/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

# IncludeDirs := ${strip -I${OPENWINHOME}/lib ${IncludeDirs}}
# LibDirs := ${strip -L${OPENWINHOME}/lib ${LibDirs}}

# define the targets

PRGM		:=	${LocalBin}/dskutil

# set the architecture dependent variables

CCFlags		:=	${CCFlags} -O -D_NO_PROTO
sunCCFlags	:=	${sunCCFlags} -DSUN
crayCCFlags	:=	${crayCCFlags} -DCRAY 
crayFCFlags	:=      -DCRAY -Wf"-i64"

CommonLibes	:=	${CommonLibes} -lXm -lXt -lXext -lX11
crayLibes	:= 	-lnet -lc

ifneq "${SOLARIS}"  ""
sunLibes	:=      -Bdynamic -lSM -lICE ${CommonLibes} ${sunLibes}  \
			-Bstatic -lgen -lsocket -Bdynamic \
			-ldl -Bstatic -lform -lnsl -lintl
else
Libes	   :=	   ${CommonLibes}
endif

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

# ifeq "${TArchDir}" "sun4" 
# CSrcs		:=	dskutil.c display_menu.c gfname.c write_tape.c \
# 			tape_menu.c tar_menu.c setfocus.c \
# 			bld_cmdline.c file_stat.c rm_archfiles.c \
# 			c_label.c tree.c post_out.c kill_widg.c \
# 			gdname.c parse_tar.c boolean.c list.c \
# 			floppy_menu.c getroot.c search_menu.c \
# 			HelpObject.c XuCrHelpPD.c qwidg.c \
# 			XStrKeysym.c
# else
CSrcs		:=	dskutil.c display_menu.c gfname.c write_tape.c \
			tape_menu.c tar_menu.c setfocus.c \
			bld_cmdline.c file_stat.c rm_archfiles.c \
			c_label.c tree.c post_out.c kill_widg.c \
			gdname.c parse_tar.c boolean.c list.c \
			floppy_menu.c getroot.c search_menu.c \
			HelpObject.c XuCrHelpPD.c qwidg.c
# endif

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

.PHONY:	all safe remotes targets

targets:	${PRGM}

all:	safe clean targets remotes Makefile install

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

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

remotes:	RemoteCopies  RemoteMakes

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

RemoteMakes:	${SafeFiles}
	shadowexec -v  ${MAKE} -f Makefile && 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} RemoteCopies RemoteMakes ${wildcard ShdCpy*}
