CFLAGS_ALL	= -D${MACH_OS} -DMOTIF -DSYSV -DXT_CODE -DXOPEN_CATALOG \
                   -I../../include -I${IRIS_ROOT}/include

CFLAGS		= -c ${DEBUGFLAG} ${C_OPT}  ${CFLAGS_ALL}

CXXFLAGS        = -c ${DEBUGFLAG} ${CC_OPT} ${CFLAGS_ALL}
CCFLAGS = ${CXXFLAGS}

CFLAGS_RELAXED	= -c ${DEBUGFLAG} ${C_OPT_RELAXED}  ${CFLAGS_ALL}
CCFLAGS_RELAXED = -c ${DEBUGFLAG} ${CC_OPT_RELAXED} ${CFLAGS_ALL}

LDFLAGS = -L../../libs/lib -L${IRIS_ROOT}/libs/lib

EXES =		xmag

MKDEPEND_CSRCS = \
		xmag.c

all: ${EXES}

depend:; makedepend -- ${CFLAGS} -- ${MKDEPEND_CSRCS}

xmag : xmag.o
		${CXX} ${LD_OPT} ${LPATH_X11} -o xmag xmag.o \
			-lXm -lXt -lX11 ${LSEARCH_BSD}
		rootchmod 775 xmag ; rootchown operator xmag

install : all
	( case `uname -s` in \
	    HP-UX )       cp xv_hpux   ${IRIS_ROOT}/config_template/extras/xv.uu  ;;  \
	    Linux )       cp xv_linux  ${IRIS_ROOT}/config_template/extras/xv.uu  ;;  \
	    IRIX|IRIX64 ) cp xv_irix   ${IRIS_ROOT}/config_template/extras/xv.uu  ;;  \
	  esac ; \
	  cd ${IRIS_ROOT}/config_template/extras ; \
	  rm -f xv xv.gz  ; uudecode xv.uu ; gunzip xv.gz ; \
	  rm -f xv.uu ; \
	  rootchmod      775 xv ; \
	  rootchown operator xv ; \
	)

# Note that the protection of the sudo files in the config_template/extras directory is
# not important.
	( case `uname -s` in \
	    HP-UX )       cp hdp_hpux11 ${IRIS_ROOT}/config_template/extras/hdp.uu ;;  \
	    Linux )       cp hdp_linux  ${IRIS_ROOT}/config_template/extras/hdp.uu ;;  \
	    IRIX|IRIX64 ) cp hdp_irix   ${IRIS_ROOT}/config_template/extras/hdp.uu ;;  \
	  esac ; \
	  cd ${IRIS_ROOT}/config_template/extras ; \
	  rm -f hdp hdp.gz  ; uudecode hdp.uu ; gunzip hdp.gz ; \
	  rm -f hdp.uu ; \
	  rootchmod      775 hdp ; \
	  rootchown operator hdp ; \
	)
	( case `uname -s` in \
	    HP-UX )       cp sudo_hpux   ${IRIS_ROOT}/config_template/extras/sudo.uu ;;  \
	    Linux )       cp sudo_linux  ${IRIS_ROOT}/config_template/extras/sudo.uu ;;  \
	    IRIX|IRIX64 ) cp sudo_irix   ${IRIS_ROOT}/config_template/extras/sudo.uu ;;  \
	  esac ; \
	  cd ${IRIS_ROOT}/config_template/extras ; \
	  rm -f sudo sudo.gz  ; uudecode sudo.uu ; gunzip sudo.gz ; \
	  rm -f sudo.uu ; \
	  rootchmod      775 sudo ; \
	  rootchown operator sudo ; \
	)
	rootcp -p sudoers ${IRIS_ROOT}/config_template/extras
	( cd ${IRIS_ROOT}/config_template/extras ; \
	  rootchmod      775 sudoers ; \
	  rootchown operator sudoers ; \
	)
	rootcp -p ${EXES} ${IRIS_ROOT}/config_template/extras
	( cd ${IRIS_ROOT}/config_template/extras ; strip ${EXES} ; \
	  rootchmod      775 ${EXES} ; \
	  rootchown operator ${EXES} ; \
	)

cleanexe:;	rm -f ${EXES} core
clean:		cleanexe
		rm -f *.o *.usg *.cat*
# DO NOT DELETE
