#########################################################################
#
#       MAKEFILE FOR STAND-ALONE XT CODE APPLICATION.  
#
#       EXECUTABLE      is the name of the executable to be created 
#       MAIN            is the .c file containing your main() function 
#       INTERFACES      is a list of the generated C code files
#       APP_OBJS        is a (possibly empty) list of the object code
#                       files that form the non-interface portion of
#                       your application
#
#       In the first three statements, the variables on the right 
#	of the equal sign will be replaced with their corresponding
#       values when the makefile is automatically generated.
#
#       This template is used for makefiles which do not reference 
#       the Ux runtime library.
#
#  	$Date: 2006-11-01 10:41:30 -0500 (Wed, 01 Nov 2006) $ 		$Revision: 17932 $
#########################################################################
CUR_REL_PATH := "utils/dspx"

include ../../config.mk

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

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

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

DSPX            = dspx
EXEC_SCOPE	= exec_scope

LANGUAGE        = ANSI C
EXECUTABLE	= dspx_scope
MAIN		= dspx_scope.c

INTERFACES	= dspx_scope_applshell.c 

APPL_SRCS       = dspx_func.c
APPL_OBJS = ${APPL_SRCS:.c=.o}

DSPX_SCOPE_C_SRCS = ${MAIN} ${INTERFACES} ${APPL_SRCS}
DSPX_SCOPE_C_OBJS = ${MAIN:.c=.o} ${INTERFACES:.c=.o} ${APPL_OBJS}

DSPX_C_SRCS		= dspx.c
DSPX_C_OBJS		= ${DSPX_C_SRCS:.c=.o}

EXEC_SCOPE_C_SRCS	= exec_scope.c
EXEC_SCOPE_C_OBJS	= ${EXEC_SCOPE_C_SRCS:.c=.o}



LLIBS            = -luxsig -lXpm -lXm -lXt -lX11 -ldsp -lconfig -luser \
                   -lfileformats ${LTIFF} ${LJPEG} -lm ${LSEARCH_BSD} -lz

MKDEPEND_CSRCS = ${DSPX_SCOPE_C_SRCS} ${DSPX_C_SRCS} ${EXEC_SCOPE_C_SRCS}

all: ${EXECUTABLE} ${DSPX} ${EXEC_SCOPE}

depend: makefile.d

makefile.d: ${MKDEPEND_CSRCS}
	touch makefile.d
	makedepend -fmakefile.d -- ${CFLAGS} -- ${MKDEPEND_CSRCS}

${EXECUTABLE}: ${DSPX_SCOPE_C_OBJS}
	${CXX} ${LD_OPT} $^ ${LDFLAGS} ${LLIBS} -o $@

${DSPX}: ${DSPX_C_OBJS}
	${CXX} ${LD_OPT} $^ ${LDFLAGS} ${LLIBS} -o $@


${EXEC_SCOPE}: ${EXEC_SCOPE_C_OBJS}
	${CXX} ${LD_OPT} $^ ${LDFLAGS} ${LLIBS} -o $@

install: all ${IRIS_BIN} $(IRIS_APP_DEFAULTS) ${EXECUTABLE}.rf
	install -m 0775 -o ${IRIS_USER} -g ${IRIS_GROUP} -s \
			$(EXECUTABLE) ${DSPX} ${IRIS_BIN}
	install -m 0664 -o ${IRIS_USER} -g ${IRIS_GROUP} \
			${EXECUTABLE}.rf $(IRIS_APP_DEFAULTS)/$(EXECUTABLE)
	install -m 0664 ${EXECUTABLE}.rf $(SYS_APP_DEFAULTS)/$(EXECUTABLE)

uninstall:
	rm -f $(IRIS_APP_DEFAULTS)/$(EXECUTABLE) \
	      $(SYS_APP_DEFAULTS)/$(EXECUTABLE)  \
	      ${IRIS_BIN}/$(EXECUTABLE) ${IRIS_BIN}/${DSPX}

cleanexe:
	rm -f ${EXECUTABLE} ${DSPX} ${EXEC_SCOPE} core

clean: cleanexe
	rm -f *.o *~ *.d *.d.bak

install_src: ${INST_SRC_DIR}
	install -m 0664 -o ${IRIS_USER} -g ${IRIS_GROUP} Makefile *.[chi] *.op *.prj *.rf ${INST_SRC_DIR}

uninstall_src:
	rm -rf ${INST_SRC_DIR}

-include makefile.d
