IBM SC34-4499-03 Personal Computer User Manual


 
debug = VALUE('DEBUG',,environ)
if debug = 'YES' then
do
parms = parms || '/Ti+'
end
icc parms '/Fo'||output input
exit result
Windows NT and 95 build scripts must be able to return a value for a return
code. Because *.bat command files provide little support for programming
logic and cannot return a value, use a compiled executable for your build
script. TeamConnection provides two sample Windows build scripts and their
source files. These samples, fhbwcomp.exe and fhbwlink.exe, are C
programs for the Microsoft Visual C++ compiler and linker, respectively.
Because these samples are C programs, they can also be used with the
OS/2 build server with only slight modifications.
You can create the builder that invokes this build script using the following command:
teamc builder -create c_builder2 -script c_compile.cmd -parameters "/c"
-from d:\teamc\c_compile.cmd
Where d:\teamc\c_compile.cmd is the file to be stored in the TeamConnection database
and c_compile.cmd is the name of the local file that the build process creates and runs
during a build.
To build hello.obj using the debug option, you use the following command:
teamc part -build hello.obj -parameters "debug=YES" -pool os2pool
The command issued by the build server is the following:
c_compile.cmd /c
In turn, the build script inspects the contents of the parameters it received in its
argument list and from the environment, and it forms this command:
"icc /c /Ti+ /Fohello.obj hello.c"
Testing a build script
The easiest way to test a build script is to write a simple driver program that sets the
environment variables that the build script will expect and then runs the script against
local files.
For example, to test the example build script in “Writing an executable file for a build
script” on page 153, write a program that sets the TC_INPUT, TC_OUTPUT, and
154 User’s Guide