LIB = ../lib/libtvsubs.a

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

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

CPPMSG= -DMESSAGE_ONLY -I../../include -I${IRIS_ROOT}/include

all:	${LIB} iris_signal104.cat

messages.usg : messages.msg
	${MKMSGUSG}

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

TVSUBS_C_SRCS =	bothout.C \
		colors.C \
		DrawCatch.C \
		DrawOverlay.C \
		getstep.C \
		initialize.C \
		inside.C \
		LabelAxis.C \
		lat_long_grid.C \
		NearestColor.C \
		overlay.C \
		plot.C \
		protected.C \
		rangerings.C \
		ReprojectTable.C \
		ReprojectVtv.C \
		rtdisp_ray.C \
		vertical_grids.C \
		xscreateimage.C

TVSUBS_C_OBJS = ${TVSUBS_C_SRCS:.C=.o}


MKDEPEND_CSRCS = ${TVSUBS_C_SRCS}
depend: makefile.d

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

${LIB} : ${TVSUBS_C_OBJS}
		rm -f ${LIB}
		$(AR) -rsc ${LIB} ${TVSUBS_C_OBJS}
		rootchmod 664 ${LIB}

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

test_tv: test_tv.o ${LIB}
	${CXX} ${LD_OPT} test_tv.o ${LDFLAGS} -ltvsubs -luser -o test_tv
	rootchown operator test_tv ;
	./test_tv


install: all
		cp iris_signal104.cat* ${IRIS_NLS}

cleanexe:;
clean:		cleanexe
		rm -f *.o *.usg *.cat* *.d *.d.bak

-include makefile.d
