# Makefile for the C programs in the
# Practical Programming in Tcl and Tk

# You will need to fix these up to match your system
TCL_LIB = /proj/tcl/usrdist/src/tk,v4.0/tcl7.4/libtcl.a
TK_LIB = /proj/tcl/usrdist/src/tk,v4.0/tk4.0/libtk.a
INCS = -I/proj/tcl/usrdist/src/tk,v4.0/tk4.0 \
	-I/proj/tcl/usrdist/src/tk,v4.0/tcl7.4Xa \
	-I/proj/tcl/usrdist/src/tk,v4.0/tcl7.4 \
	-I/usr/openwin/include

# You may not have all these.  Comment them out if you do not.
BLT_LIB = /proj/tcl/usrdist/src/tk,v4.0/blt-1.8/src/libBLT.a
#DP_LIB = /proj/tcl/usrdist/src/tk,v4.0/tcl-dp3.3b1/libdpnetwork.so.3.3
EXP_LIB = /proj/tcl/usrdist/src/tk,v4.0/expect-5.17/libexpect.a
#TCLX_LIB = /proj/tcl/usrdist/src/tk,v4.0/tclX7.4a/libtclx.a
#TKX_LIB = /proj/tcl/usrdist/src/tk,v4.0/tkX4.0a/libtkx.a
INCR_LIB = /proj/tcl/usrdist/src/tk,v4.0/itcl-1.5/src/libitcl.so.1.3

# On Solaris you need this for the random function
#UCBLIB = /usr/ucblib/libucb.a

CFLAGS = -g $(INCS)
CC = gcc

all: mytcl mywish supertcl

SOURCE = README COPYRIGHT *.tcl app-defaults* *.resources *.bitmap *.mask *.expect Makefile *.c *.h
FLOPPY = /dev/rfd0c

srctar:
	tar cvf $(FLOPPY) $(SOURCE)

TCL_OBJS = tclMain.o random.o tclInvoke.o
mytcl: $(TCL_OBJS)
	$(CC) -o mytcl $(TCL_OBJS) $(TCL_LIB) -lm $(UCBLIB)

TK_OBJS = tkCustomMain.o tkWidget.o
mywish: $(TK_OBJS)
	$(CC) -o mywish $(TK_OBJS) $(TK_LIB) $(TCL_LIB) -lX11 -lm $(UCBLIB)

TRACE =

ALL_LIBS = $(DP_LIB) $(EXP_LIB) $(BLT_LIB) $(INCR_LIB) \
	$(TKX_LIB) $(TK_LIB) $(TCLX_LIB) $(TCL_LIB) -lX11 -lm

TK_OBJS_2 = supertcl.o tkWidget.o tkImgPixmap.o tclInvoke.o
supertcl: $(TK_OBJS_2)
	$(CC) -o supertcl $(TRACE) $(TK_OBJS_2) $(ALL_LIBS) $(UCBLIB)
