
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. -I${IRIS_ROOT}/siris

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

SIRIS_C_SRCS =	siris.C \
		create_error_log.C \
		iris_processes.C \
		radar_signal_handler.C \
		scanfiles.C
SIRIS_C_OBJS = ${SIRIS_C_SRCS:.C=.o}

QIRIS_C_SRCS =	qiris.C \
		iris_processes.C
QIRIS_C_OBJS = ${QIRIS_C_SRCS:.C=.o}

RESTART_C_SRCS=	restart_iris.C \
		iris_processes.C \
		scanfiles.C
RESTART_C_OBJS = ${RESTART_C_SRCS:.C=.o}

ROOTEXES = siris qiris restart_iris

all:	${ROOTEXES} setup_change show_iris signal_iris TaskMonitor iris_signal206.cat

messages.usg : messages.msg
	${MKMSGUSG}

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

MKDEPEND_CSRCS = ${SIRIS_C_SRCS} ${RESTART_C_SRCS} ${QIRIS_C_SRCS} setup_change.C \
	show_iris.C signal_iris.C TaskMonitor.C
depend: makefile.d

makefile.d:
	touch makefile.d
	makedepend -fmakefile.d -- ${CFLAGS} -- ${MKDEPEND_CSRCS} 
	makedepend -fmakefile.d -a -o.usg -- ${CPPMSG} -- messages.msg

sem_test: sem_test.o
		${CXX} ${LD_OPT} sem_test.o \
			${LDFLAGS} -luser -o sem_test
		 rootchown root sem_test ; rootchmod 6775 sem_test

siris: ${SIRIS_C_OBJS}
		${CXX} ${LD_OPT} ${SIRIS_C_OBJS} ${LDFLAGS} \
		-lshare -lprivate -lmisc -lantenna -lmaps -ldspi -lconfig -luser -lXmu \
	        -lm ${LSEARCH_BSD} -lz -o siris
		@strip siris
		@rootchown root siris ; rootchmod 6775 siris

setup_change: setup_change.o
		${CXX} ${LD_OPT} setup_change.o \
			${LDFLAGS} -lshare -lconfig -luser -lm -o setup_change
		@strip setup_change
		@rootchown operator setup_change ; rootchmod 775 setup_change

TaskMonitor: TaskMonitor.o
		${CXX} ${LD_OPT} TaskMonitor.o \
			${LDFLAGS} -lshare -luser -lm -o TaskMonitor
		@strip TaskMonitor
		@rootchown operator TaskMonitor ; rootchmod 775 TaskMonitor

qiris: ${QIRIS_C_OBJS}
		${CXX} ${LD_OPT} ${QIRIS_C_OBJS} ${LDFLAGS} \
		-lshare -lmisc -lmaps -luser -lm ${LSEARCH_BSD} -o qiris
		@strip qiris;
		@ rootchown root qiris ; rootchmod 6775 qiris

restart_iris: ${RESTART_C_OBJS}
		${CXX} ${LD_OPT} ${RESTART_C_OBJS} ${LDFLAGS} \
		-lshare -lprivate -lmisc -ldspi -lconfig -luser -lm ${LSEARCH_BSD} \
			-o restart_iris
		@strip restart_iris
		@rootchown root restart_iris ; rootchmod 6775 restart_iris

show_iris: show_iris.o
		${CXX} ${LD_OPT} show_iris.o ${LDFLAGS} \
		-lshare -lprivate -lmisc -ldspi -lconfig -luser -lm ${LSEARCH_BSD} \
			-o show_iris
		@strip show_iris
		@rootchown operator show_iris ; rootchmod 6775 show_iris

signal_iris: signal_iris.o
		${CXX} ${LD_OPT} signal_iris.o ${LDFLAGS} \
		-lshare -luser -o signal_iris
		@strip signal_iris
		@rootchown operator signal_iris ; rootchmod 6775 signal_iris

install: all
		rootcp -p ${ROOTEXES} setup_change show_iris signal_iris ${IRIS_BIN}
		cp iris_signal206.cat* ${IRIS_NLS}


cleanexe:;	rm -f ${ROOTEXES} setup_change show_iris signal_iris TaskMonitor core
clean:		cleanexe
		rm -f *.o *.usg *.cat* *.d *.d.bak

-include makefile.d
