1@echo off
2
3::  This is an example batchfile for building everything. Please
4::  edit this (or make your own) for your needs and wants using
5::  the instructions for calling makefile.vc found in makefile.vc
6
7set SYMBOLS=
8
9:OPTIONS
10if "%1" == "/?" goto help
11if /i "%1" == "/help" goto help
12if %1.==symbols. goto SYMBOLS
13if %1.==debug. goto SYMBOLS
14goto OPTIONS_DONE
15
16:SYMBOLS
17   set SYMBOLS=symbols
18   shift
19   goto OPTIONS
20
21:OPTIONS_DONE
22
23:: reset errorlevel
24cd > nul
25
26:: You might have installed your developer studio to add itself to the
27:: path or have already run vcvars32.bat.  Testing these envars proves
28:: cl.exe and friends are in your path.
29::
30if defined VCINSTALLDIR  (goto :startBuilding)
31if defined MSDEVDIR      (goto :startBuilding)
32if defined MSVCDIR       (goto :startBuilding)
33if defined MSSDK         (goto :startBuilding)
34if defined WINDOWSSDKDIR (goto :startBuilding)
35
36:: We need to run the development environment batch script that comes
37:: with developer studio (v4,5,6,7,etc...)  All have it.  This path
38:: might not be correct.  You should call it yourself prior to running
39:: this batchfile.
40::
41call "C:\Program Files\Microsoft Developer Studio\vc98\bin\vcvars32.bat"
42if errorlevel 1 (goto no_vcvars)
43
44:startBuilding
45
46echo.
47echo Sit back and have a cup of coffee while this grinds through ;)
48echo You asked for *everything*, remember?
49echo.
50title Building Tk, please wait...
51
52
53:: makefile.vc uses this for its default anyways, but show its use here
54:: just to be explicit and convey understanding to the user.  Setting
55:: the INSTALLDIR envar prior to running this batchfile affects all builds.
56::
57if "%INSTALLDIR%" == "" set INSTALLDIR=C:\Program Files\Tcl
58
59
60:: Where is the Tcl source directory?
61:: You can set the TCLDIR environment variable to your Tcl HEAD checkout
62if "%TCLDIR%" == "" set TCLDIR=..\..\tcl
63
64:: Build the normal stuff along with the help file.
65::
66set OPTS=none
67if not %SYMBOLS%.==. set OPTS=symbols
68nmake -nologo -f makefile.vc release htmlhelp OPTS=%OPTS% %1
69if errorlevel 1 goto error
70
71:: Build the static core and shell.
72::
73set OPTS=static,msvcrt
74if not %SYMBOLS%.==. set OPTS=symbols,static,msvcrt
75nmake -nologo -f makefile.vc shell OPTS=%OPTS% %1
76if errorlevel 1 goto error
77
78set OPTS=
79set SYMBOLS=
80goto end
81
82:error
83echo *** BOOM! ***
84goto end
85
86:no_vcvars
87echo vcvars32.bat was not run prior to this batchfile, nor are the MS tools in your path.
88goto out
89
90:help
91title buildall.vc.bat help message
92echo usage:
93echo   %0                 : builds Tk for all build types (do this first)
94echo   %0 install         : installs all the release builds (do this second)
95echo   %0 symbols         : builds Tk for all debugging build types
96echo   %0 symbols install : install all the debug builds.
97echo.
98goto out
99
100:end
101title Building Tk, please wait... DONE!
102echo DONE!
103goto out
104
105:out
106pause
107title Command Prompt
108