/* set your compiler here if you want to override the default setup */
 CC = gcc

/* add any extra load flags such as -static or -g */
LOCAL_LDFLAGS =

/* Include files for tcl, Motif and the Send package.
   Change the first two as needed (SEND is included in this package)
 */
TCL_INCLUDE   = /usrs/local/include
MOTIF_INCLUDE = /usr/local/include
SEND_INCLUDE  = ../send

/* The corresponding libraries.
   Change the first two as needed by setting the -L option 
 */
TCL_LIB   = -L/usr/local/lib -ltcl -lm
MOTIF_LIB = -L/usr/local/lib -lXm -lXt -lX11
SEND_LIB  = -L../send -ltclXtSend

/* what type of libraries do you want? */
#define DoNormalLib YES
#define DoSharedLib NO

/* simple -g debugging flag - set to YES or NO */
#define Debug YES

/* Connor Cahil's dbmalloc debugging malloc library.
   Worked fine on a Sun (renamed malloc.h to dbmalloc.h)
   - set to YES or NO
 */
#define ConnorDebug NO

/*  Mark Moraes' debugging malloc library.
    Worked fine under Linux (renamed malloc.h to dbmalloc.h)
   - set to YES or NO
 */
#define MoraesDebug NO

/* define this if you want the obsoleted main.c rather than
   the super-duper tcl extension method now used
 */
/* #define OLD_MAIN */

/***************************************************************************
 * Only look below here if you want to change the debugging options, 
 * or where the debugging mallocs are located.
 ***************************************************************************/

#if Debug
EXTRA_DEFINES = -g
#endif

#if ConnorDebug
CDEBUGFLAGS = -g -DDEBUG_MALLOC
/* set the -I, -L options to where the include and lib files are */
EXTRA_DEFINES = -I/usr/local/include
DEBUG_LIB = -L/usr/local/include -ldbmalloc
#endif

#if MoraesDebug
CDEBUGFLAGS = -g -DDEBUG_MALLOC
/* set the -I, -L options to where the include and lib files are */
EXTRA_DEFINES = -I/usrs/home/malloc/malloc
DEBUG_LIB = -L/usrs/home/malloc/malloc -lmalloc_d
#endif

/***************************************************************************
 * No changes should be required below here
 ***************************************************************************/

INCLUDES = -I$(TCL_INCLUDE) -I$(MOTIF_INCLUDE) -I$(SEND_INCLUDE)
LOCAL_LIBRARIES = $(DEBUG_LIB) $(SEND_LIB) $(TCL_LIB) $(MOTIF_LIB)

OBJS1 = tmBasic.o \
	tmCreateWidget.o \
	tmCommands.o \
	tmDrag.o \
	tmTclCommands.o \
	tmExpand.o \
	tmWidget.o \
	tmUtils.o \
	tmConverters.o \
	tmResources.o \
	tmResult.o

#ifdef OLD_MAIN
OBJS = tmMain.o $(OBJS1)
#else
OBJS = tmAppInit.o $(OBJS1)
#endif

SRCS =	main.c \
	tmAppInit.c \
	tmCreateWidget.c \
	tmCommands.c \
	tmDrag.c \
	tmTclCommands.c \
	tmExpand.c \
	tmWidget.c \
	tmUtils.c \
	tmConverters.c \
	tmResources.c \
	tmResult.c

DEFINES = -DTM_LIBRARY=\".\" -DTM_VERSION=\"1.0\"


ComplexProgramTarget(moat)

#if DoNormalLib
NormalLibraryObjectRule()
NormalLibraryTarget(tclMotif,$(OBJS))
InstallLibrary(tclMotif,$(USRLIBDIR))
#endif

#if DoSharedLib
#if DoNormalLib
SharedLibraryTarget(tclMotif,1.0,$(OBJS),shared,.)
#else
SharedLibraryTarget(tclMotif,1.0,$(OBJS),.,.)
#endif
InstallSharedLibrary(tclMotif, 1.0, $(USRLIBDIR))
#endif

