#
# This is a simplified Makefile for use in Tk distributions.  Before using
# it to compile Tk, you may wish to reset some of the following variables:
#
# TCL_DIR -		Name of directory holding tcl.h and tcl.a.
# XLIB -		Name of archive containing Xlib binaries.
#

# You may also wish to add some of the following switches to the CFLAGS
# variable:
#
# -DX11R3		Causes code that depends on R4 facilities not to
#			be compiled.  I haven't tested Tk with R3 in quite
#			a while, so this switch may not be enough to
#			generate a working R3 version of Tk.  Furthermore,
#			use of this switch will disable some of the facilities
#			of Tk.
# -DNO_PROTOTYPE	Turns off ANSI-style procedure prototypes and the
#			corresponding compile-time checks.  Without this
#			defininition, prototypes will be turned on if the
#			compiler supports ANSI C by defining __STDC__.
#

#TCL_DIR		= ../tcl
TCL_DIR		= [-.tcl67]
XLIB		= -lX11
TK_LIBRARY	= tcl_root:[tk32.library]
CC		= cc
CFLAGS		= /debug /inc=(sys$disk:[],$(TCL_DIR)) /def=("TK_VERSION=""3.2/""","TK_LIBRARY=""$(TK_LIBRARY)""")

LIBS = libtk.olb/lib, $(TCL_DIR)libtcl.olb/lib, sys$disk:[]x11opt.opt/opt

VMSOBJS = tkvms.obj

WIDGOBJS = tkbutton.obj, tkentry.obj, tkframe.obj, tklistbox.obj, \
	tkmenu.obj, tkmenubutton.obj, tkmessage.obj, tkscale.obj, \
	tkscrollbar.obj

CANVOBJS = tkcanvas.obj, tkcanvarc.obj, tkcanvbmap.obj, tkcanvline.obj, \
	tkcanvpoly.obj, tkcanvps.obj, tkcanvtext.obj, tkcanvwind.obj, \
	tkrectoval.obj, tktrig.obj

TEXTOBJS = tktext.obj, tktextbtree.obj, tktextdisp.obj, tktextindex.obj, \
	tktexttag.obj

OBJS = tk3d.obj, tkargv.obj, tkatom.obj, tkbind.obj, tkbitmap.obj, \
        tkcmds.obj, tkcolor.obj, tkconfig.obj, tkcursor.obj, tkerror.obj, \
        tkevent.obj, tkfocus.obj, tkfont.obj, tkget.obj, tkgc.obj, tkgeometry.obj, \
        tkgrab.obj, tkoption.obj, tkpack.obj, tkplace.obj, tkpreserve.obj, \
        tkselect.obj, tksend.obj, tkwindow.obj, tkwm.obj, \
	$(WIDGOBJS), $(CANVOBJS), $(TEXTOBJS), $(VMSOBJS), \
 	tkgeommanager.obj, tkpack2.obj, tktable.obj

VMSSRC = tkvms.c

WIDGSRCS = tkbutton.c tkentry.c tkframe.c tklistbox.c \
	tkmenu.c tkmenubutton.c tkmessage.c tkscale.c \
	tkscrollbar.c tktext.c

CANVSRCS = tkcanvas.c tkcanvarc.c tkcanvbmap.c tkcanvline.c \
	tkcanvpoly.c tkcanvps.c tkcanvtext.c tkcanvwind.c \
	tkrectoval.c tktrig.c

TEXTSRCS = tktext.c tktextbtree.c tktextdisp.c tktextindex.c \
	tktexttag.c

SRCS = tk3d.c tkargv.c tkatom.c tkbind.c tkbitmap.c \
        tkcmds.o tkcolor.c tkconfig.c tkcursor.c tkerror.c \
        tkevent.c tkfocus.c tkfont.c tkget.c tkgc.c tkgeometry.c \
        tkgrab.c tkoption.c tkpack.c tkplace.c tkpreserve.c tkselect.c \
        tksend.c tkwindow.c tkwm.c $(WIDGSRCS) $(CANVSRCS) \
        $(TEXTSRCS) $(VMSSRC) \
 	tkgeommanager.c tkpack2.c tktable.c

all : wish.exe

libtk.olb : $(OBJS)
	- delete/noconfirm libtk.olb.*
	library/create $@ $(OBJS)

# LDFLAGS = /debug

wish.exe : main.obj, libtk.olb
	link/exe=$@ $(LDFLAGS) main.obj, $(LIBS)

clean :
	- del *.exe;*, *.obj;*, *.map;*

$(OBJS) : tk.h tkint.h
$(WIDGOBJS) : default.h
main.o : tk.h tkint.h
