Checking in DOs during a build
However, the ClearCase® build tool does not create a configuration record until the build script is completed (all commands after the target-name: are executed). Therefore, if the same build script that created the DO checks it in or converts it to an element, the resulting version is not a DO version.
For example, the version created by the following build script is not a DO version:
buildit : buildit.c
cleartool co -unres -nc $@
del /F $@
cl /c $@ $*.c
cleartool ci -nc buildit
You can work around this problem by building and checking in a derived object in two steps. For example, the makefile contains one build script that creates the DO, and another build script that checks it in, as shown here:
buildit : buildit.c
cleartool co -unres -nc $@
del /F $@
cl /c $@ $*.c
stageit : buildit
cleartool ci -nc buildit
The command clearmake stageit performs the following steps:
- Brings the target buildit up to date. This creates a DO named buildit and an associated configuration record.
- Brings the target stageit up to date. This step checks in the buildit derived object as a DO version.