#------------------------------------------------------------------------------ # Visual C++ 5.0+ makefile for [Incr Tcl] # # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. # # Copyright (c) 1993-1998 Lucent Technologies, Inc. # RCS: $Id: makefile.vc,v 1.30 2004/04/29 17:40:44 davygrvy Exp $ #------------------------------------------------------------------------------ # Do not modify this file! #------------------------------------------------------------------------------ !if !exist("makefile.vc") MSG = ^ You must run this makefile only from the directory it is in.^ Please `cd` to its location first. !error $(MSG) !endif PROJECT = itcl !include "..\..\rules.vc" !if $(TCLINSTALL) !message *** Warning: [Incr Tcl] requires the source distribution of Tcl to build from, !message *** at this time, sorry. Please set the TCLDIR macro to point to the !message *** sources. !endif !if [nmakehlp -g ..\generic\itcl.h ITCL_VERSION] == 33 ITCL_DOTVERSION = 3.3 !elseif [nmakehlp -g ..\generic\itcl.h ITCL_VERSION] == 34 ITCL_DOTVERSION = 3.4 !elseif [nmakehlp -g ..\generic\itcl.h ITCL_VERSION] == 35 ITCL_DOTVERSION = 3.5 !elseif [nmakehlp -g ..\generic\itcl.h ITCL_VERSION] == 0 MSG =^ Can't get version string from ..\generic\itcl.h !error $(MSG) !endif ITCL_VERSION = $(ITCL_DOTVERSION:.=) BINROOT = . ROOT = .. STUBPREFIX = $(PROJECT)stub PKGINDEX = "$(TMP_DIR)\pkgIndex.tcl" !if $(TCL_DOES_STUBS) ITCLLIBNAME = $(PROJECT)$(ITCL_VERSION)$(SUFX).$(EXT) !else ITCLLIBNAME = $(PROJECT)$(ITCL_VERSION)80$(SUFX).$(EXT) !endif ITCLLIB = "$(OUT_DIR)\$(ITCLLIBNAME)" ITCLIMPLIB = "$(OUT_DIR)\$(PROJECT)$(ITCL_VERSION)$(SUFX).lib" !if $(TCL_DOES_STUBS) ITCLSTUBLIBNAME = $(STUBPREFIX)$(ITCL_VERSION).lib ITCLSTUBLIB = "$(OUT_DIR)\$(ITCLSTUBLIBNAME)" !else ITCLSTUBLIBNAME = ITCLSTUBLIB = TCLSTUBLIB = $(TCLIMPLIB) !endif BIN_INSTALL_DIR = $(_INSTALLDIR)\bin DOC_INSTALL_DIR = $(_INSTALLDIR)\doc LIB_INSTALL_DIR = $(_INSTALLDIR)\lib SCRIPT_INSTALL_DIR = $(_INSTALLDIR)\lib\itcl$(ITCL_DOTVERSION) INCLUDE_INSTALL_DIR = $(_INSTALLDIR)\include ITCLOBJS = \ $(TMP_DIR)\itcl_bicmds.obj \ $(TMP_DIR)\itcl_class.obj \ $(TMP_DIR)\itcl_cmds.obj \ $(TMP_DIR)\itcl_ensemble.obj \ $(TMP_DIR)\itcl_linkage.obj \ $(TMP_DIR)\itcl_migrate.obj \ $(TMP_DIR)\itcl_methods.obj \ $(TMP_DIR)\itcl_objects.obj \ $(TMP_DIR)\itcl_parse.obj \ $(TMP_DIR)\itcl_util.obj \ !if $(TCL_DOES_STUBS) $(TMP_DIR)\itclStubInit.obj \ !endif !if !$(STATIC_BUILD) $(TMP_DIR)\dllEntryPoint.obj \ $(TMP_DIR)\itcl.res !endif ITCLSTUBOBJS = \ !if $(TCL_DOES_STUBS) $(TMP_DIR)\itclStubLib.obj !endif GENERICDIR = $(ROOT)\generic DOCDIR = $(ROOT)\doc RCDIR = $(ROOT)\win\rc WINDIR = $(ROOT)\win TOOLSDIR = ..\..\tools #--------------------------------------------------------------------- # Link flags #--------------------------------------------------------------------- !if $(DEBUG) ldebug = -debug:full -debugtype:cv !else ldebug = -release -opt:ref -opt:icf,3 !endif # declarations common to all linker options lflags = -nologo -machine:$(MACHINE) $(ldebug) !if $(PROFILE) lflags = $(lflags) -profile !endif !if $(ALIGN98_HACK) && !$(STATIC_BUILD) # align sections for PE size savings. lflags = $(lflags) -opt:nowin98 !else if !$(ALIGN98_HACK) && $(STATIC_BUILD) # align sections for speed in loading by choosing the virtual page size. lflags = $(lflags) -align:4096 !endif !if $(LOIMPACT) lflags = $(lflags) -ws:aggressive !endif ITCL_LFLAGS = $(lflags) -subsystem:windows -dll !if exist("$(TCLDIR)\win\coffbase.txt") ITCL_DLLBASE = -base:@$(TCLDIR)\win\coffbase.txt,itcl !else ITCL_DLLBASE = !endif #--------------------------------------------------------------------- # Compile flags #--------------------------------------------------------------------- !if $(DEBUG) !if "$(MACHINE)" == "IA64" cdebug = -Od -Zi !else cdebug = -Z7 -Od -WX !endif !else # This cranks the optimization level up to max. cdebug = -O2 !endif # declarations common to all compiler options cflags = -nologo -c -W3 -YX -Fp$(TMP_DIR)^\ !if $(PENT_0F_ERRATA) cflags = $(cflags) -QI0f !endif !if $(ITAN_B_ERRATA) cflags = $(cflags) -QIA64_Bx !endif !if $(MSVCRT) crt = -MD$(DBGX) !else crt = -MT$(DBGX) !endif !if $(TCLINSTALL) TCL_INCLUDES = -I"$(TCLDIR)\include" !else TCL_INCLUDES = -I"$(TCLDIR)\generic" !endif ITCL_INCLUDES = -I$(WINDIR) -I$(GENERICDIR) ITCL_DEFINES = -DBUILD_itcl -DTCL_THREADS=1 ITCL_EXE_CFLAGS = $(cdebug) $(cflags) $(crt) $(ITCL_INCLUDES) $(ITCL_DEFINES) $(TCL_INCLUDES) ### By convention, static builds do not use Stubs. This is just a practice, ### not a technical limitation. !if $(STATIC_BUILD) ITCL_CFLAGS = $(ITCL_EXE_CFLAGS) -DSTATIC_BUILD !elseif $(TCL_DOES_STUBS) ITCL_CFLAGS = $(ITCL_EXE_CFLAGS) -DUSE_TCL_STUBS !else ITCL_CFLAGS = $(ITCL_EXE_CFLAGS) !endif #--------------------------------------------------------------------- # TclTest flags #--------------------------------------------------------------------- !if "$(TESTPAT)" != "" TESTFLAGS = -file $(TESTPAT) !endif #--------------------------------------------------------------------- # Project specific targets #--------------------------------------------------------------------- all : setup $(ITCLLIB) $(ITCLSTUBLIB) release : setup $(ITCLLIB) $(ITCLSTUBLIB) install : install-binaries install-docs setup : @if not exist $(TMP_DIR)\nul mkdir $(TMP_DIR) @if not exist $(OUT_DIR)\nul mkdir $(OUT_DIR) $(ITCLLIB): $(ITCLOBJS) !if $(STATIC_BUILD) $(lib32) -nologo -machine:$(MACHINE) -out:$@ @<< $(ITCLOBJS) << !else $(link32) $(ITCL_LFLAGS) $(ITCL_DLLBASE) -out:$@ $(TCLSTUBLIB) @<< $(ITCLOBJS) << -@del $*.exp !endif !if $(TCL_DOES_STUBS) $(ITCLSTUBLIB) : $(ITCLSTUBOBJS) $(lib32) -nologo -out:$@ $(ITCLSTUBOBJS) !endif install-binaries : if not exist "$(_INSTALLDIR)" mkdir "$(_INSTALLDIR)" if not exist "$(BIN_INSTALL_DIR)" mkdir "$(BIN_INSTALL_DIR)" if not exist "$(LIB_INSTALL_DIR)" mkdir "$(LIB_INSTALL_DIR)" if not exist "$(SCRIPT_INSTALL_DIR)" mkdir "$(SCRIPT_INSTALL_DIR)" if not exist "$(INCLUDE_INSTALL_DIR)" mkdir "$(INCLUDE_INSTALL_DIR)" copy $(ITCLLIB) "$(SCRIPT_INSTALL_DIR)" !if ""$(ITCLSTUBLIB)"" != """" copy $(ITCLSTUBLIB) "$(LIB_INSTALL_DIR)" !endif copy $(ROOT)\generic\itcl.h "$(INCLUDE_INSTALL_DIR)" copy $(ROOT)\generic\itclDecls.h "$(INCLUDE_INSTALL_DIR)" copy $(ROOT)\library\*.* "$(SCRIPT_INSTALL_DIR)" echo if {[package vsatisfies 8.0 [package provide Tcl]]} {\ > "$(SCRIPT_INSTALL_DIR)\pkgIndex.tcl" echo ^ ^ ^ ^ set add 80>> "$(SCRIPT_INSTALL_DIR)\pkgIndex.tcl" echo } else {>> "$(SCRIPT_INSTALL_DIR)\pkgIndex.tcl" echo ^ ^ ^ ^ set add {}>> "$(SCRIPT_INSTALL_DIR)\pkgIndex.tcl" echo }>> "$(SCRIPT_INSTALL_DIR)\pkgIndex.tcl" echo if {[info exists ::tcl_platform(debug)] ^&^&\ $$::tcl_platform(debug) ^&^& \>> "$(SCRIPT_INSTALL_DIR)\pkgIndex.tcl" echo ^ ^ ^ ^ ^ ^ ^ ^ [file exists [file join $$dir\ $(PROJECT)$(ITCL_VERSION)$${add}g.dll]]}\ {>> "$(SCRIPT_INSTALL_DIR)\pkgIndex.tcl" echo ^ ^ ^ ^ package ifneeded Itcl $(ITCL_DOTVERSION) [list load\ [file join $$dir $(PROJECT)$(ITCL_VERSION)$${add}g.dll]\ Itcl]>> "$(SCRIPT_INSTALL_DIR)\pkgIndex.tcl" echo } else {>> "$(SCRIPT_INSTALL_DIR)\pkgIndex.tcl" echo ^ ^ ^ ^ package ifneeded Itcl $(ITCL_DOTVERSION) [list load\ [file join $$dir $(PROJECT)$(ITCL_VERSION)$${add}.dll]\ Itcl]>> "$(SCRIPT_INSTALL_DIR)\pkgIndex.tcl" echo }>> "$(SCRIPT_INSTALL_DIR)\pkgIndex.tcl" echo unset add>> "$(SCRIPT_INSTALL_DIR)\pkgIndex.tcl" !if $(STATIC_BUILD) test : @echo test target not supported for a static library. !else test : setup $(ITCLLIB) $(ITCLSTUBLIB) $(TCLSH) ..\tests\all.tcl $(TESTFLAGS) -loadfile << set env(ITCL_LIBRARY) [file normalize [file join $(MAKEDIR:\=/) .. library]] load [file normalize [file join $(MAKEDIR:\=/) $(ITCLLIB:\=/)]] <