/* --------------------------------------------------------------- */
/* -- Copyright (c) 1994, 1995 Computer Sciences Department,    -- */
/* -- University of Wisconsin-Madison, subject to the terms     -- */
/* -- and conditions given in the file COPYRIGHT.  All Rights   -- */
/* -- Reserved.                                                 -- */
/* --------------------------------------------------------------- */

/*
 *      $RCSfile: Imakefile,v $
 *      $Revision: 1.52 $
 *      $Date: 1996/07/17 21:31:04 $
 *      $Author: nhall $
 */

#ifdef MULTI_SERVER
#define SRC_REMOTE
#else
#define SRC_REMOTE
#endif

SRC.C = SRC_REMOTE
SRC.c = ssh.c shell.c ovt.c tcl_thread.c  ssh_error.c
SRC = $(SRC.c) $(SRC.C)

OBJ = $(SRC.c:.c=.o) $(SRC.C:.C=.o)


#ifdef MULTI_SERVER
EXEC = ssh
#else
EXEC = ssh
#endif

INCLUDE += $(SM_INCL) $(STHREAD_INCL) $(COMMON_INCL) $(FC_INCL) $(OCOMM_INCL) $(TCL_INCL) $(GDBM_INCL)

#ifndef MULTI_SERVER
CMNT OCOMM library should not be used
OCOMM_LIB =
#endif

LIB = $(SM_LIB) $(COMMON_LIB) $(STHREAD_LIB) $(OCOMM_LIB) $(FC_LIB) $(TCL_LIB) $(GDBM_LIB)

LOCAL_LDFLAGS =

SYMLINKS = ../../sthread/diskrw

ALLTARGETS = $(SM_LIB)

$(SM_LIB): ALWAYS
	(cd $(SM_DIR); $(MAKE) $(OPTIONS))

errorcodes: e_error_bakw.i opt_error_bakw.i st_error_bakw.i fc_error_bakw.i

error_codes(../e_error.dat,-d,e_error_bakw.i)
error_codes(../../common/opt_error.dat,-d,opt_error_bakw.i)
error_codes(../../sthread/st_error.dat,-d,st_error_bakw.i)
error_codes(../../fc/fc_error.dat,-d,fc_error_bakw.i)

c_plus_program(smstats, smstats.o, $(LIB))
c_plus_program(ssh, $(OBJ), $(LIB))
c_plus_program(random_kick, random_kick.o, -lm)

#ifdef IS_SP2
poe_c_plus_program(ssh.poe, $(OBJ), $(LIB))
#endif

CMNT c_plus_program(client, client.o remote.o, $(STHREAD_LIB) $(FC_LIB) $(COMMON_LIB) $(OCOMM_LIB) $(TCL_LIB))

PURE_OPTIONS = $(PURE_OPT)
QUANT_OPTIONS = -collection-granularity=line -record-system-calls=yes -record-register-window-traps=yes
purify_c_plus_program(ssh, $(OBJ), $(LIB), $(PURE_OPTIONS))
quantify_c_plus_program(ssh, $(OBJ), $(LIB), $(QUANT_OPTIONS))
PURECOV_OPT += -best-effort  $(PURE_OPT)
purecov_c_plus_program(ssh, $(OBJ), $(LIB), $(PURECOV_OPT))


depend_target($(SRC))

