#
# Makefile to build toocl
# beust@sa.inria.fr
#

############################################################################
#  You may want to change the following variables
############################################################################

# Directories

# Where to find Tk's includes
	TK_INC=-I../../tk
# Where to find Tcl's includes
	TCL_INC=-I../../tcl
# Where to find Tooltalk's tt_c.h
	TOOLTALK_INC=-I/usr/openwin3.0/share/include/desktop
# Where to find the libtcl.a, libtk.a, libtt.a
	LIB_DIR=-L/u/wombat/1/koala/beust/lib/sun4 -L/usr/openwin3.0/lib

# C Flags
LOCAL_CFLAGS=-DHAVE_UNISTD_H=1

############################################################################
# You shouldn't have to change anything below
############################################################################

CC=gcc
RANLIB=ranlib
LIBRARY=libtcltt.a

#
# Libraries
#
LIBS= -ltk -ltcl -lX11 -ltt -lm

#
# Flags
#
CFLAGS=$(TCL_INC) $(TK_INC) $(TOOLTALK_INC) $(LOCAL_CFLAGS) -g

#
# Files
#
INCLUDES=main.h
OBJECTS= tclttAppInit.o tclttMisc.o tclttSession.o tclttDefault.o\
         tclttMessage.o tclttPattern.o tclttFile.o tclttOtype.o\
	 tclttSpec.o\
	database.o

all:	main.o $(OBJECTS) $(LIBRARY)
	$(CC) -g -o ttwish main.o $(OBJECTS) $(LIB_DIR) $(LIBS)

$(LIBRARY) : $(OBJECTS)
	rm -f $@
	ar clq $@ $(OBJECTS)
	$(RANLIB) $@

main.o:	main.c
	$(CC) $(CFLAGS) -c main.c

.c.o: $(INCLUDES)
	$(CC) $(CFLAGS) -c $<

clean: 
	rm *.o

