LIB = ../lib/librtq.a

CFLAGS = -c ${DEBUGFLAG} ${C_OPT} -D${MACH_OS} \
        -I./  -I../../include -I${IRIS_ROOT}/include

CXXFLAGS= -c  ${DEBUGFLAG}  ${CC_OPT} -D${MACH_OS} \
        -I./  -I../../include -I${IRIS_ROOT}/include
CCFLAGS = ${CXXFLAGS}

CPPMSG= -DMESSAGE_ONLY -I./

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

LIB_DIR = ../lib

EXES = rtd_v1_xmt rtd_v2_xmt rtd_nids3_xmt

RTQLIB_SRCS =	RtqGlobal.C

RTQLIB_OBJS = ${RTQLIB_SRCS:.C=.o}

C_SRCS =	rtd_v1_xmt.C rtd_v2_xmt.C rtd_nids3_xmt.C RtdSupport.C

C_OBJS = ${C_SRCS:.C=.o}

all:	${EXES} ${LIB} iris_signal116.cat

messages.usg : messages.msg
	${MKMSGUSG}

iris_signal116.cat : messages.usg
	rm -f iris_signal116.cat*
	gencat iris_signal116.cat messages.usg
	chmod 664 iris_signal116.cat*

MKDEPEND_CSRCS = ${RTQLIB_SRCS} ${C_SRCS}
depend:; ${MKDEPEND} ; makedepend -a -o.usg -- ${CPPMSG} -- messages.msg

rtd_v1_xmt: rtd_v1_xmt.o RtdSupport.o ${LIB}
		${CXX} ${LD_OPT} rtd_v1_xmt.o RtdSupport.o \
			 ${LDFLAGS} -lrtq -lconfig -luser -lm ${LSEARCH_BSD} -o rtd_v1_xmt
		rootchown operator rtd_v1_xmt ; rootchmod 6775 rtd_v1_xmt

rtd_v2_xmt: rtd_v2_xmt.o RtdSupport.o ${LIB}
		${CXX} ${LD_OPT} rtd_v2_xmt.o RtdSupport.o \
			 ${LDFLAGS} -lrtq -lconfig -luser -lm ${LSEARCH_BSD} -o rtd_v2_xmt
		rootchown operator rtd_v2_xmt ; rootchmod 6775 rtd_v2_xmt

rtd_nids3_xmt: rtd_nids3_xmt.o RtdSupport.o ${LIB}
		${CXX} ${LD_OPT} rtd_nids3_xmt.o RtdSupport.o \
			 ${LDFLAGS} -lrtq -lmisc -lconfig -luser -lm ${LSEARCH_BSD} -o rtd_nids3_xmt
		rootchown operator rtd_nids3_xmt ; rootchmod 6775 rtd_nids3_xmt

${LIB}:	${RTQLIB_OBJS}
		rm -f ${LIB}
		ar -rscv ${LIB} ${RTQLIB_OBJS}
		rootchmod 664 ${LIB}

install: all
		rootcp -p ${EXES} ${IRIS_BIN}
		( cd ${IRIS_BIN} ; \
		  strip ${EXES} ; \
		  rootchown operator ${EXES} ; \
		  rootchmod 6775 ${EXES} ; \
		)
		cp iris_signal116.cat* ${IRIS_NLS}

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

RtqGlobal.o: ../../include/sigtypes.h ../../include/signoarch.h
RtqGlobal.o: ../../include/setup.h ../../include/sig_rtdisp.h
RtqGlobal.o: ../../include/config_lib.h ../../include/rtq_lib.h
RtqGlobal.o: ../../include/user_lib.h RtdSupport_h.h
rtd_v1_xmt.o: ../../include/sigtypes.h ../../include/signoarch.h
rtd_v1_xmt.o: ../../include/setup.h ../../include/sig_rtdisp.h
rtd_v1_xmt.o: ../../include/user_lib.h ../../include/rtq_lib.h RtdSupport_h.h
rtd_v2_xmt.o: ../../include/sigtypes.h ../../include/signoarch.h
rtd_v2_xmt.o: ../../include/setup.h ../../include/sig_rtdisp.h
rtd_v2_xmt.o: ../../include/user_lib.h ../../include/rtq_lib.h RtdSupport_h.h
rtd_nids3_xmt.o: ../../include/sigtypes.h ../../include/signoarch.h
rtd_nids3_xmt.o: ../../include/setup.h ../../include/sig_rtdisp.h
rtd_nids3_xmt.o: ../../include/headers.h ../../include/antenna_lib.h
rtd_nids3_xmt.o: ../../include/misc_lib.h ../../include/user_lib.h
rtd_nids3_xmt.o: ../../include/rtq_lib.h RtdSupport_h.h
RtdSupport.o: ../../include/sigtypes.h ../../include/signoarch.h
RtdSupport.o: ../../include/setup.h ../../include/sig_rtdisp.h
RtdSupport.o: ../../include/user_lib.h ../../include/rtq_lib.h RtdSupport_h.h

messages.usg: RtdSupport_h.h
