#########################################################################
#
#       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: 2005/06/03 16:01:22 $ 		$Revision: 808.1 $
#########################################################################

LIB = ../lib/libuxsig.a

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. -L../lib -L${IRIS_ROOT}/libs/lib ${LPATH_X11}

ERRDIAG		= errdiag
SIGXBELL        = sigxbell
LANGUAGE        = ANSI C
EXECUTABLE	= uxutils
MAIN		= uxutils.c

all : all_	# Just to insure that it's first

INTERFACES	= uxutilsshell.c \
	uxprinter_setup.c \
	uxmsgbox.c \
	uxfileselbox.c \
	uxselbox.c \
	uxpromptbox.c \
	uxAddRemoveDiag.c \
	uxDualSysSelDiag.c


uxutilsshell.o    : uxutilsshell.c
	${CC} ${CFLAGS_RELAXED} uxutilsshell.c
uxprinter_setup.o : uxprinter_setup.c
	${CC} ${CFLAGS_RELAXED} uxprinter_setup.c
uxmsgbox.o        : uxmsgbox.c
	${CC} ${CFLAGS_RELAXED} uxmsgbox.c
uxfileselbox.o    : uxfileselbox.c
	${CC} ${CFLAGS_RELAXED} uxfileselbox.c
uxselbox.o        : uxselbox.c
	${CC} ${CFLAGS_RELAXED} uxselbox.c
uxpromptbox.o     : uxpromptbox.c
	${CC} ${CFLAGS_RELAXED} uxpromptbox.c
uxAddRemoveDiag.o : uxAddRemoveDiag.c
	${CC} ${CFLAGS_RELAXED} uxAddRemoveDiag.c
uxDualSysSelDiag.o : uxDualSysSelDiag.c
	${CC} ${CFLAGS_RELAXED} uxDualSysSelDiag.c

APPL_SRCS       = printer_setup.c \
		  xfunc.c \
		  grabImage.c \
		  uxcommon_cbf.c\
                  output_file_format.c\
		  UxXt.c \
                  UxMethod.c
APPL_OBJS = ${APPL_SRCS:.c=.o}

UxMethod.o        : UxMethod.c
	${CC} ${CFLAGS_RELAXED} UxMethod.c

APPL_CXX_SRCS    = UxInterf.C
APPL_CXX_OBJS = ${APPL_CXX_SRCS:.C=.o}

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

C_ERRDIAG_SRCS	= errdiag.c
C_ERRDIAG_OBJS	= ${C_ERRDIAG_SRCS:.c=.o}

C_SIGXBELL_SRCS = sigxbell.c
C_SIGXBELL_OBJS = ${C_SIGXBELL_SRCS:.c=.o}

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


all_ :		$(EXECUTABLE) $(LIB) $(ERRDIAG) $(SIGXBELL)

MKDEPEND_CSRCS = ${C_SRCS} ${APPL_CXX_SRCS} ${C_ERRDIAG_SRCS} ${C_SIGXBELL_SRCS}
depend:; $(MKDEPEND)

$(LIB) : $(INTERFACES:.c=.o) $(APPL_OBJS) $(APPL_CXX_OBJS)
		rm -f ${LIB}
		ar -rscv ${LIB} $(INTERFACES:.c=.o) $(APPL_OBJS) $(APPL_CXX_OBJS)
		rootchmod 664 ${LIB}

$(EXECUTABLE): $(C_OBJS) $(APPL_CXX_OBJS) $(LIB)
	@echo Linking    $(EXECUTABLE)
	$(CXX) $(LD_OPT) $(C_OBJS) $(APPL_CXX_OBJS) $(LDFLAGS) $(LLIBS) -o $(EXECUTABLE)
	@rootchown operator $(EXECUTABLE)
	@rootchmod 6775 $(EXECUTABLE)
	@rootchown operator *.rf
	@rootchmod 664 *.rf

$(ERRDIAG):	$(C_ERRDIAG_OBJS) $(LIB)
		@echo Linking  $(ERRDIAG)
		$(CXX) $(LD_OPT) $(C_ERRDIAG_OBJS) $(LDFLAGS) $(LLIBS) -o $(ERRDIAG)
		@rootchown operator $(ERRDIAG)
		@rootchmod 775 $(ERRDIAG)

$(SIGXBELL):	$(C_SIGXBELL_OBJS) $(LIB)
		@echo Linking  $(SIGXBELL)
		$(CXX) $(LD_OPT) $(C_SIGXBELL_OBJS) $(LDFLAGS)\
		$(LLIBS) -o $(SIGXBELL)
		@rootchown operator $(SIGXBELL)
		@rootchmod 775 $(SIGXBELL)

install:	all
		rootcp -p $(EXECUTABLE) ${IRIS_BIN}
		rootcp -p $(ERRDIAG) ${IRIS_BIN}
		rootcp -p $(SIGXBELL) ${IRIS_BIN}
		rootcp -p $(EXECUTABLE).rf $(IRIS_APP_DEFAULTS)$(EXECUTABLE)
		rootcp -p $(EXECUTABLE).rf /usr/lib/X11/app-defaults/$(EXECUTABLE)
		( cd ${IRIS_BIN} ; strip ${EXECUTABLE} ; strip ${ERRDIAG} ; \
		  rootchown operator ${EXECUTABLE} ; rootchmod 775 ${EXECUTABLE} ;\
                 rootchown operator ${ERRDIAG} ; rootchmod 775 ${ERRDIAG} ) 
		( cd ${IRIS_APP_DEFAULTS} ; \
		  rootchown operator ${EXECUTABLE} ; rootchmod 664 ${EXECUTABLE} )
		( cd /usr/lib/X11/app-defaults ; \
		  rootchown operator ${EXECUTABLE} ; rootchmod 664 ${EXECUTABLE} )


cleanexe:;	rm -f $(EXECUTABLE) $(ERRDIAG) $(SIGXBELL) core
cleanux:;	rm -f UxXt.h
clean:		cleanexe cleanux
		rm -f *.o
# DO NOT DELETE

uxutils.o: ../../include/UxXt.h ../../include/UxInterf.h
uxutilsshell.o: ../../include/UxXt.h ../../include/UxInterf.h
uxutilsshell.o: ../../include/sigtypes.h ../../include/signoarch.h
uxutilsshell.o: ../../include/uxsig_lib.h
uxprinter_setup.o: ../../include/UxXt.h ../../include/UxInterf.h
uxprinter_setup.o: ../../include/sigtypes.h ../../include/signoarch.h
uxprinter_setup.o: ../../include/setup.h ../../include/user_lib.h
uxprinter_setup.o: ../../include/fileformats_lib.h ../../include/uxsig_lib.h
uxmsgbox.o: ../../include/UxXt.h ../../include/UxInterf.h
uxmsgbox.o: ../../include/sigtypes.h ../../include/signoarch.h
uxmsgbox.o: ../../include/uxsig_lib.h
uxfileselbox.o: ../../include/UxXt.h ../../include/UxInterf.h
uxfileselbox.o: ../../include/sigtypes.h ../../include/signoarch.h
uxfileselbox.o: ../../include/uxsig_lib.h
uxselbox.o: ../../include/UxXt.h ../../include/UxInterf.h
uxselbox.o: ../../include/sigtypes.h ../../include/signoarch.h
uxselbox.o: ../../include/uxsig_lib.h
uxpromptbox.o: ../../include/UxXt.h ../../include/UxInterf.h
uxpromptbox.o: ../../include/sigtypes.h ../../include/signoarch.h
uxpromptbox.o: ../../include/uxsig_lib.h
uxAddRemoveDiag.o: ../../include/UxXt.h ../../include/UxInterf.h
uxAddRemoveDiag.o: ../../include/sigtypes.h ../../include/signoarch.h
uxAddRemoveDiag.o: ../../include/uxsig_lib.h
uxDualSysSelDiag.o: ../../include/UxXt.h ../../include/UxInterf.h
uxDualSysSelDiag.o: ../../include/sigtypes.h ../../include/signoarch.h
uxDualSysSelDiag.o: ../../include/antenna_lib.h ../../include/uxsig_lib.h
uxDualSysSelDiag.o: ../../include/xpm_lib.h
printer_setup.o: ../../include/sigtypes.h ../../include/signoarch.h
printer_setup.o: ../../include/UxXt.h ../../include/UxInterf.h
printer_setup.o: ../../include/user_lib.h ../../include/uxsig_lib.h
printer_setup.o: ../../include/fileformats_lib.h
xfunc.o: ../../include/sigtypes.h ../../include/signoarch.h
xfunc.o: ../../include/uxsig_lib.h ../../include/UxXt.h
xfunc.o: ../../include/UxInterf.h
grabImage.o: ../../include/sigtypes.h ../../include/signoarch.h
grabImage.o: ../../include/uxsig_lib.h
uxcommon_cbf.o: ../../include/sigtypes.h ../../include/signoarch.h
uxcommon_cbf.o: ../../include/UxXt.h ../../include/UxInterf.h
uxcommon_cbf.o: ../../include/user_lib.h ../../include/uxsig_lib.h
output_file_format.o: ../../include/sigtypes.h ../../include/signoarch.h
output_file_format.o: ../../include/UxXt.h ../../include/UxInterf.h
output_file_format.o: ../../include/user_lib.h
output_file_format.o: ../../include/fileformats_lib.h
output_file_format.o: ../../include/uxsig_lib.h
UxXt.o: ../../include/UxXt.h ../../include/UxInterf.h
UxMethod.o: ../../include/UxXt.h ../../include/UxInterf.h
UxInterf.o: ../../include/UxXt.h ../../include/UxInterf.h
