# Visual C++ 2.x and 4.0 makefile
#
# Copyright (c) 1995-1996 by Sun Microsystems, Inc.
#
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
# 
# SCCS: @(#) makefile.vc 1.35 96/10/02 14:04:12

# Project directories
#
# ROOT = top of source tree
# TMPDIR = location where .obj files should be stored during build
# TCLDIR = location of top of Tcl source heirarchy
# TOOLS32 = location of VC++ 32-bit development tools
#

ROOT	= ..
TMPDIR	= .
TOOLS32	= c:\msdev
TCLDIR	= ..\..\..\tcl8.0b2

# Comment the following line to compile with symbols
# NODEBUG=1

# uncomment the following two lines to compile with TCL_MEM_DEBUG
#DEBUGDEFINES	=-DTCL_MEM_DEBUG

# Make sure the VC++ tools are at the head of the path
PATH=$(TOOLS32)\vc\bin;$(TOOLS32)\SharedIDE\bin;$(PATH)

TCLLIBDIR       = $(TCLDIR)\win
WINDIR          = $(ROOT)\win
GENERICDIR	= $(ROOT)\generic

cc32 = $(TOOLS32)\vc\bin\cl -I$(TOOLS32)\vc\include
rc32 = $(TOOLS32)\SharedIDE\bin\rc
link32 = $(TOOLS32)\vc\bin\link

EXTRA_INCLUDES = \
        -I$(TOOLS32)\vc\include -I$(ROOT)\win -I$(ROOT)\generic \
	-I$(ROOT)\bitmaps -I$(ROOT)\xlib -I$(ROOT) -I$(TCLDIR)\generic

EXTRA_DEFINES = \
        -nologo $(DEBUGDEFINES) -DUSE_TCLALLOC=0

OBJS = \
	$(TMPDIR)\example.obj

TCLLIB = tcl80.lib
LIB = example.lib
TCLDLL = tcl80.dll
DLL = example.dll

CP      = copy

!include    "$(TOOLS32)\vc\include\win32.mak"

all:    $(DLL)

$(DLL): $(OBJS)
	set LIB=$(TOOLS32)\vc\lib
        $(link32) $(linkdebug) $(dlllflags) \
 		$(TCLLIBDIR)\$(TCLLIB) $(guilibsdll) \
		-out:$(DLL) @<<
		$(OBJS)
<<

#
# Implicit rules
#

{$(ROOT)\xlib}.c{$(TMPDIR)}.obj:
	$(cc32) $(cdebug) $(cflags) $(cvarsdll) $(EXTRA_INCLUDES) \
		$(EXTRA_DEFINES) -Fo$(TMPDIR)\ $<

{$(ROOT)\generic}.c{$(TMPDIR)}.obj:
	$(cc32) $(cdebug) $(cflags) $(cvarsdll) $(EXTRA_INCLUDES) \
		$(EXTRA_DEFINES) -Fo$(TMPDIR)\ $<

{$(ROOT)\win}.c{$(TMPDIR)}.obj:
	$(cc32) $(cdebug) $(cflags) $(cvarsdll) $(EXTRA_INCLUDES) \
		$(EXTRA_DEFINES) -Fo$(TMPDIR)\ $<

{$(ROOT)\win\rc}.rc{$(TMPDIR)}.res:
	$(rc32) -fo $@ -r -i $(ROOT)\generic $<

clean:
	-@del *.exp
	-@del *.lib
	-@del *.dll
        -@del $(TMPDIR)\*.obj 
