diff options
author | Keith Seitz <keiths@redhat.com> | 2008-07-22 20:39:42 +0000 |
---|---|---|
committer | Keith Seitz <keiths@redhat.com> | 2008-07-22 20:39:42 +0000 |
commit | 24af8de1062fda6b0c35651e8b0b9860e3f2ddbd (patch) | |
tree | 46ea83d88a2ce5f019f728543106bec210325004 /itcl/itcl/win/makefile.vc | |
parent | 5601295b75f82401817b35387a9843a18a9ae357 (diff) | |
download | gdb-24af8de1062fda6b0c35651e8b0b9860e3f2ddbd.tar.gz |
imported Itcl 3.3ITCL_3_3
Diffstat (limited to 'itcl/itcl/win/makefile.vc')
-rw-r--r-- | itcl/itcl/win/makefile.vc | 716 |
1 files changed, 419 insertions, 297 deletions
diff --git a/itcl/itcl/win/makefile.vc b/itcl/itcl/win/makefile.vc index 92fb39c2eaf..e2749233085 100644 --- a/itcl/itcl/win/makefile.vc +++ b/itcl/itcl/win/makefile.vc @@ -1,297 +1,419 @@ -######################################################################
-# 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$
-######################################################################
-# All needed information is derived from running vcvars32.bat
-#
-# NOTE: Be sure to modify the "config.vc" file in the toplevel directory
-# before running this makefile.
-######################################################################
-# Do not modify this file! modify config.vc to effect the build.
-######################################################################
-
-!include "..\..\rules.vc"
-!include "..\..\config.vc"
-!include "..\..\pkg.vc"
-
-BINROOT = .
-ROOT = ..
-NAMEPREFIX = itcl
-STUBPREFIX = $(NAMEPREFIX)stub
-
-!if $(DEBUG)
-TMPNAME = Debug
-DBGX = d
-!else
-TMPNAME = Release
-DBGX =
-!endif
-
-TMP_DIR = $(BINROOT)\$(TMPNAME)
-
-!ifndef OUT_DIR
-OUT_DIR = $(TMP_DIR)
-!endif
-
-PKGINDEX = "$(TMP_DIR)\pkgIndex.tcl"
-
-!if $(STATIC_BUILD)
-ITCLOUTNAME = $(NAMEPREFIX)$(ITCL_VERSION)s$(DBGX)
-ITCLTARGET = "$(OUT_DIR)\$(ITCLOUTNAME).lib"
-!else
-ITCLOUTNAME = $(NAMEPREFIX)$(ITCL_VERSION)$(DBGX)
-ITCLIMPLIB = "$(OUT_DIR)\$(ITCLOUTNAME).lib"
-ITCLTARGET = "$(OUT_DIR)\$(ITCLOUTNAME).dll"
-!endif
-
-!if $(ISTCLINSTALL)
-TCLSTUBLIB = "$(TCLROOT)\lib\tclstub$(TCL_VERSION).lib"
-TCLIMPLIB = "$(TCLROOT)\lib\tcl$(TCL_VERSION)$(DBGX).lib"
-TCLSH = "$(TCLROOT)\bin\tclsh$(TCL_VERSION)$(DBGX).exe"
-!else
-TCLSTUBLIB = "$(TCLROOT)\win\Release\tclstub$(TCL_VERSION).lib"
-TCLIMPLIB = "$(TCLROOT)\win\$(OUT_DIR)\tcl$(TCL_VERSION)$(DBGX).lib"
-TCLSH = "$(TCLROOT)\win\$(OUT_DIR)\tclsh$(TCL_VERSION)$(DBGX).exe"
-!endif
-
-ITCLSTUBLIBNAME = $(STUBPREFIX)$(ITCL_VERSION)$(DBGX).lib
-ITCLSTUBLIB = "$(OUT_DIR)\$(ITCLSTUBLIBNAME)"
-
-LIB_INSTALL_DIR = $(INSTALLDIR)\lib
-BIN_INSTALL_DIR = $(INSTALLDIR)\bin
-SCRIPT_INSTALL_DIR = $(INSTALLDIR)\lib\itcl$(ITCL_DOTVERSION)
-INCLUDE_INSTALL_DIR = $(INSTALLDIR)\include
-
-ITCLSHOBJS = \
- $(TMP_DIR)\tclAppInit.obj
-
-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_obsolete.obj \
- $(TMP_DIR)\itcl_parse.obj \
- $(TMP_DIR)\itcl_util.obj \
-!if $(STATIC_BUILD) == 0
- $(TMP_DIR)\dllEntryPoint.obj \
- $(TMP_DIR)\dllResource.obj \
-!endif
- $(TMP_DIR)\itclStubInit.obj
-
-ITCLSTUBOBJS = \
- $(TMP_DIR)\itclStubLib.obj
-
-WINDIR = $(ROOT)\win
-GENERICDIR = $(ROOT)\generic
-RCDIR = $(ROOT)\win\rc
-
-######################################################################
-# Link flags
-######################################################################
-
-!if $(DEBUG)
-ldebug = -debug:full -debugtype:cv -pdb:none
-!else
-ldebug = -release -opt:ref
-!endif
-
-# declarations common to all linker options
-lcommon = -nologo -link50compat -machine:$(MACHINE)
-
-ITCL_LFLAGS = $(lcommon) -subsystem:windows -dll
-
-!if $(USE_TCL_STUBS) == 0
-ITCL_LLIBS = $(TCLIMPLIB)
-!else
-ITCL_LLIBS = $(TCLSTUBLIB)
-!endif
-
-######################################################################
-# Compile flags
-######################################################################
-
-!IF $(DEBUG) == 0
-!IF "$(MACHINE)" == "ALPHA"
-# MSVC on Alpha doesn't understand -Ot
-cdebug = -O2i
-!ELSE
-cdebug = -Ox
-!ENDIF
-!ELSE
-!if $(MSDEV_VER) < 6
-cdebug = -Zi -Od -WX
-!else
-cdebug = -ZI -Od -WX
-!endif
-!ENDIF
-
-!if $(STATIC_BUILD)
-cdll =
-!else
-cdll = -GD
-!endif
-
-# declarations common to all compiler options
-ccommon = -nologo -c -W3 -YX -Fp$(TMP_DIR)\
-
-!if $(STATIC_BUILD) && $(NOMSVCRT)
-crt = -MT$(DBGX)
-!else
-crt = -MD$(DBGX)
-!endif
-
-!if $(ISTCLINSTALL)
-TCL_INCLUDES = -I"$(TCLROOT)\include"
-!else
-TCL_INCLUDES = -I"$(TCLROOT)\generic"
-!endif
-
-ITCL_INCLUDES = -I$(WINDIR) -I$(GENERICDIR)
-ITCL_DEFINES = -DBUILD_itcl -DTCL_THREADS=1
-ITCL_EXE_CFLAGS = $(ccommon) $(cdebug) $(crt) $(cdll) $(ITCL_INCLUDES) \
- $(ITCL_DEFINES) $(TCL_INCLUDES)
-
-!if $(USE_TCL_STUBS)
-ITCL_CFLAGS = $(ITCL_EXE_CFLAGS) -DUSE_TCL_STUBS
-!else
-ITCL_CFLAGS = $(ITCL_EXE_CFLAGS)
-!endif
-
-######################################################################
-# Project specific targets
-######################################################################
-
-all : setup $(ITCLTARGET) $(ITCLSTUBLIB)
-release : setup $(ITCLTARGET) $(ITCLSTUBLIB)
-
-!if $(STATIC_BUILD)
-test :
- @echo test target not supported for a static library.
-!else
-#test : setup $(ITCLTARGET) $(ITCLSTUBLIB) $(PKGINDEX)
-# -@copy $(TCLDLL) $(TMP_DIR)
-# $(TCLSH) <<
-#cd ../tests
-#lappend auto_path ../win/$(TMP_DIR)
-#set env(ITCL_LIBRARY) ../library
-#source all
-#<<
-!endif
-
-$(PKGINDEX) :
- -@copy pkgIndex.tcl $@
-
-setup :
- @$(vcvars) > nul
- @if not exist $(TMP_DIR)\nul mkdir $(TMP_DIR) &\
- echo Created directory '$(TMP_DIR)'
- @if not exist $(OUT_DIR)\nul mkdir $(OUT_DIR) &\
- echo Created directory '$(OUT_DIR)'
-
-$(ITCLTARGET): $(ITCLOBJS)
-!if $(STATIC_BUILD)
- $(lib32) -nologo -machine:$(MACHINE) -out:$@ @<<
-!else
- $(link32) $(ITCL_LFLAGS) -out:$@ $(ITCL_LLIBS) @<<
-!endif
- $(ITCLOBJS)
-<<
-
-!if $(DEBUG) == 0
-$(ITCLSTUBLIB) : $(ITCLSTUBOBJS)
- $(lib32) -nologo -out:$@ $(ITCLSTUBOBJS)
-!else
-$(ITCLSTUBLIB) :
-!endif
-
-install : all
- 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 $(ITCLTARGET) "$(SCRIPT_INSTALL_DIR)"
- -copy $(ITCLSTUBLIB) "$(LIB_INSTALL_DIR)"
- copy $(ROOT)\generic\itcl.h "$(INCLUDE_INSTALL_DIR)"
- copy $(ROOT)\generic\itclDecls.h "$(INCLUDE_INSTALL_DIR)"
- copy $(ROOT)\library\*.* "$(SCRIPT_INSTALL_DIR)"
- echo package ifneeded Itcl $(ITCL_DOTVERSION) [list load [file join $$dir $(ITCLOUTNAME).dll] Itcl] > \
- "$(SCRIPT_INSTALL_DIR)\pkgIndex.tcl"
-
-######################################################################
-# Regenerate the stubs files.
-######################################################################
-
-!if $(ISTCLINSTALL) == 0
-# Only from the sources of Tcl does genStubs.tcl exist.
-genstubs:
- $(TCLSH) $(TCLROOT)\tools\genStubs.tcl $(GENERICDIR) \
- $(GENERICDIR)\itcl.decls $(GENERICDIR)\itclInt.decls
-!endif
-
-######################################################################
-# Special case object file targets
-######################################################################
-
-# The following object is part of the stub library and should not
-# be built as DLL objects but none of the symbols should be exported
-
-$(TMP_DIR)\itclStubLib.obj : $(GENERICDIR)\itclStubLib.c
- $(cc32) -DSTATIC_BUILD $(ITCL_EXE_CFLAGS) -Zl -Fo$@ $?
-
-$(TMP_DIR)\dllResource.obj : $(TMP_DIR)\itcl.res
- $(cvtres32) -nologo -machine:$(MACHINE) -out:$@ $?
-
-######################################################################
-# Inference rules. Use batch-mode when supported.
-######################################################################
-
-!if $(_NMAKE_VER) < 162
-{$(WINDIR)}.c{$(TMP_DIR)}.obj :
-!else
-{$(WINDIR)}.c{$(TMP_DIR)}.obj ::
-!endif
- $(cc32) -DDLL_BUILD $(ITCL_CFLAGS) -Fo$(TMP_DIR)\ @<<
-$<
-<<
-
-!if $(_NMAKE_VER) < 162
-{$(GENERICDIR)}.c{$(TMP_DIR)}.obj :
-!else
-{$(GENERICDIR)}.c{$(TMP_DIR)}.obj ::
-!endif
- $(cc32) -DDLL_BUILD $(ITCL_CFLAGS) -Fo$(TMP_DIR)\ @<<
-$<
-<<
-
-{$(RCDIR)}.rc{$(TMP_DIR)}.res :
- $(rc32) -fo $@ -DDEBUG=$(DEBUG) $(ITCL_INCLUDES) $(TCL_INCLUDES) $(ITCL_DEFINES) $<
-
-######################################################################
-# Clean up
-######################################################################
-
-tidy :
- -del $(TMP_DIR)\*.pch
- -del $(TMP_DIR)\*.obj
- -del $(TMP_DIR)\*.res
-
-clean : tidy
- -del $(OUT_DIR)\*.exp
- -del $(OUT_DIR)\*.lib
- -del $(OUT_DIR)\*.dll
-
-hose : clean
- -rmdir $(OUT_DIR)
- -rmdir $(TMP_DIR)
-
+#------------------------------------------------------------------------------ +# 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$ +#------------------------------------------------------------------------------ +# 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" -I"$(TCLDIR)\win" +!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:\=/)]] +<< +!endif + +#--------------------------------------------------------------------- +# Regenerate the stubs files. +#--------------------------------------------------------------------- + +genstubs: +!if $(TCLINSTALL) + @echo Need the source distribution to regenerate the Stubs table. +!else + $(TCLSH) $(TOOLSDIR)\genStubs.tcl $(GENERICDIR) \ + $(GENERICDIR)\$(PROJECT).decls $(GENERICDIR)\$(PROJECT)Int.decls +!endif + +#--------------------------------------------------------------------- +# Special case object file targets +#--------------------------------------------------------------------- + +# The following object is part of the stub library and should not +# be built as DLL objects but none of the symbols should be exported + +$(TMP_DIR)\itclStubLib.obj : $(GENERICDIR)\itclStubLib.c + $(cc32) -DSTATIC_BUILD $(ITCL_EXE_CFLAGS) -Zl -Fo$@ $? + +#--------------------------------------------------------------------- +# Inference rules. Use batch-mode when supported. +#--------------------------------------------------------------------- + +{$(WINDIR)}.c{$(TMP_DIR)}.obj :: + $(cc32) $(ITCL_CFLAGS) -Fo$(TMP_DIR)\ @<< +$< +<< + +{$(GENERICDIR)}.c{$(TMP_DIR)}.obj :: + $(cc32) $(ITCL_CFLAGS) -Fo$(TMP_DIR)\ @<< +$< +<< + +{$(RCDIR)}.rc{$(TMP_DIR)}.res : + $(rc32) -fo $@ -d DEBUG=$(DEBUG) -d UNCHECKED=$(UNCHECKED) \ + $(ITCL_INCLUDES) $(TCL_INCLUDES) $(ITCL_DEFINES) $< + +#--------------------------------------------------------------------- +# Generate the windows help files. +#--------------------------------------------------------------------- + +HLPBASE = $(PROJECT)$(ITCL_VERSION) +HELPFILE = $(OUT_DIR)\$(HLPBASE).hlp +HELPCNT = $(OUT_DIR)\$(HLPBASE).cnt +DOCTMP_DIR = $(OUT_DIR)\$(PROJECT)_docs +HELPRTF = $(DOCTMP_DIR)\$(PROJECT).rtf +MAN2HELP = $(DOCTMP_DIR)\man2help.tcl +MAN2HELP2 = $(DOCTMP_DIR)\man2help2.tcl +INDEX = $(DOCTMP_DIR)\index.tcl +BMP = $(DOCTMP_DIR)\toaster.bmp +BMP_NOPATH = toaster.bmp +MAN2TCL = $(DOCTMP_DIR)\man2tcl.exe + +winhelp: docsetup $(HELPFILE) + +docsetup: + @if not exist $(DOCTMP_DIR)\nul mkdir $(DOCTMP_DIR) + +$(MAN2HELP) $(MAN2HELP2) $(INDEX): $(TCLTOOLSDIR)\$$(@F) + copy $(TCLTOOLSDIR)\$(@F) $(@D) + +$(BMP): + copy $(WINDIR)\$(@F) $(@D) + +$(HELPFILE): $(HELPRTF) $(BMP) + cd $(DOCTMP_DIR) + start /wait hcrtf.exe -x <<$(PROJECT).hpj +[OPTIONS] +COMPRESS=12 Hall Zeck +LCID=0x409 0x0 0x0 ; English (United States) +TITLE=[Incr Tcl] Reference Manual +BMROOT=. +CNT=$(@B).cnt +HLP=$(@B).hlp + +[FILES] +$(PROJECT).rtf + +[WINDOWS] +main="[Incr Tcl] Reference Manual",,27648,(r15263976),(r65280) + +[CONFIG] +BrowseButtons() +CreateButton(1, "Web", ExecFile("http://www.tcl.tk")) +CreateButton(2, "SF", ExecFile("http://sf.net/projects/incrtcl")) +CreateButton(3, "Wiki", ExecFile("http://wiki.tcl.tk")) +CreateButton(4, "FAQ", ExecFile("http://www.purl.org/NET/Tcl-FAQ/")) +<< + cd $(MAKEDIR) + copy "$(DOCTMP_DIR)\$(@B).hlp" "$(OUT_DIR)" + copy "$(DOCTMP_DIR)\$(@B).cnt" "$(OUT_DIR)" + +$(MAN2TCL): $(TCLTOOLSDIR)\$$(@B).c + $(cc32) -nologo -G4 -ML -O2 -Fo$(@D)\ $(TCLTOOLSDIR)\$(@B).c -link -out:$@ + +$(HELPRTF): $(MAN2TCL) $(MAN2HELP) $(MAN2HELP2) $(INDEX) + $(TCLSH) $(MAN2HELP) -bitmap $(BMP_NOPATH) $(PROJECT) $(ITCL_VERSION) $(DOCDIR:\=/) + +install-docs: +!if exist($(HELPFILE)) + @xcopy /i /y "$(HELPFILE)" "$(DOC_INSTALL_DIR)\" + @xcopy /i /y "$(HELPCNT)" "$(DOC_INSTALL_DIR)\" + $(TCLSH) << +puts "Installing $(PROJECT)'s helpfile contents into Tcl's ..." +set f [open {$(DOC_INSTALL_DIR:\=/)/tcl$(TCL_VERSION).cnt} r] +while {![eof $$f]} { + if {[regexp {:Include $(PROJECT)([0-9]{2}).cnt} [gets $$f] dummy ver]} { + if {$$ver == $(ITCL_VERSION)} { + puts "Already installed." + exit + } else { + # do something here logical to remove (or replace) it. + puts "$$ver != $(ITCL_VERSION), unfinished code path, die, die!" + exit 1 + } + } +} +close $$f +set f [open {$(DOC_INSTALL_DIR:\=/)/tcl$(TCL_VERSION).cnt} a] +puts $$f {:Include $(HLPBASE).cnt} +close $$f +<< + start /wait winhlp32 -g $(DOC_INSTALL_DIR)\tcl$(TCL_VERSION).hlp +!endif + + +#--------------------------------------------------------------------- +# Clean up +#--------------------------------------------------------------------- + +tidy : + -del $(TMP_DIR)\*.pch + -del $(TMP_DIR)\*.obj + -del $(TMP_DIR)\*.res + +clean : tidy + -del $(OUT_DIR)\*.exp + -del $(OUT_DIR)\*.lib + -del $(OUT_DIR)\*.dll + +hose : clean + -rmdir $(OUT_DIR) + -rmdir $(TMP_DIR) |