########################################################################
# $Date: 2006-11-01 10:41:30 -0500 (Wed, 01 Nov 2006) $		$Revision: 17932 $
########################################################################
#             Copyright 1991, Visual Edge Software Ltd.
#
# ALL  RIGHTS  RESERVED.  Permission  to  use,  copy,  modify,  and
# distribute  this  software  and its documentation for any purpose
# and  without  fee  is  hereby  granted,  provided  that the above
# copyright  notice  appear  in  all  copies  and  that  both  that
# copyright  notice and this permission notice appear in supporting
# documentation,  and that  the name of Visual Edge Software not be
# used  in advertising  or publicity  pertaining to distribution of
# the software without specific, written prior permission. The year
# included in the notice is the year of the creation of the work.
########################################################################
#
#       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.
#
########################################################################
# 
#	List of supported compiler(s):
#
#	cc - A.09.61 HP C Compiler
#	CC - A.03.40 HP C++ compiler  
#
########################################################################
CUR_REL_PATH := "utils/colorsetup"

include ../../config.mk

CFLAGS_ALL	= -D${MACH_OS} -DMOTIF -DSYSV -DXT_CODE -DXOPEN_CATALOG \
                  -I./  -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 ${LPATH_X11}

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

INTERFACES      = color_setup_applshell.c \
	color_set_dialog.c \
	rename_dialog.c \
	special_color_dialog.c \
	hclass_dialog.c 

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

C_SRCS = $(MAIN) $(INTERFACES) $(APPL_SRCS)
C_OBJS = $(MAIN:.c=.o) $(INTERFACES:.c=.o) $(APPL_OBJS)

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

MKDEPEND_CSRCS = ${C_SRCS}

all: $(EXECUTABLE)

depend: makefile.d

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

color_setup_applshell.o   : color_setup_applshell.c
	${CC} ${CFLAGS_RELAXED} color_setup_applshell.c
color_set_dialog.o   : color_set_dialog.c
	${CC} ${CFLAGS_RELAXED} color_set_dialog.c
special_color_dialog.o   : special_color_dialog.c
	${CC} ${CFLAGS_RELAXED} special_color_dialog.c
rename_dialog.o   : rename_dialog.c
	${CC} ${CFLAGS_RELAXED} rename_dialog.c
hclass_dialog.o   : hclass_dialog.c
	${CC} ${CFLAGS_RELAXED} hclass_dialog.c

$(EXECUTABLE): $(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) ${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)

cleanexe:
	rm -f $(EXECUTABLE) core

cleanux:
	rm -f UxXt.c UxXt.h UxMethod.c

clean: cleanexe cleanux
	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
