Using Trace
trace "[options] command {command arguments} Options:
/o:file Log all events to the output files.
/? Display this help message.
Summary:
Runs the build commands and figures out which files have dependencies..
Trace records every child process, every file accessed (created, deleted, written, read) for a process and every child process, and dumps it all into a nice little XML file.
Example Trace File:
<?xml version="1.0" encoding="UTF-8"?>
<Traces>
<Process id="::0.::" par="" exe="cscript" pid="8284" >
<Directory>C:\root\projects\work\gsToolkit</Directory>
<Executable>C:\Windows\SysWOW64\cscript.exe</Executable>
<Line>C:\Windows\SysWOW64\cscript.exe clean.js</Line>
<Return>0</Return>
<Files>
<File read="true">C:\root\projects\work\gsToolkit\clean.js</File>
<File read="true">C:\root\projects\work\gsToolkit\js\js.js</File>
<File delete="true">C:\root\projects\work\gsToolkit\output\Win32\Release\bin\gsToolkit.dll</File>
<File delete="true">C:\root\projects\work\gsToolkit\output\Win32\Release\bin\mkProject.exe</File>
</Files>
<Vars>
</Vars>
<Child id="::0.1.::" exe="cmd" >
<Executable>C:\Windows\system32\cmd.exe</Executable>
<Line>C:\Windows\system32\cmd.exe /c type ext\iconv\php_iconv.def ext\pcre\php_pcre.def ext\zlib\php_zlib.def ext\libxml\php_libxml2.def > Release\php5.dll.def</Line>
</Child>
</Process>
<Process id="::0.1.::" parentId="::0.::" par="/nmake" exe="cmd" redirects="true" pid="5568" >
<Directory>C:\UnifiedBuild\php5</Directory>
<Executable>C:\Windows\SysWOW64\cmd.exe</Executable>
<Line>C:\Windows\SysWOW64\cmd.exe /c type ext\iconv\php_iconv.def ext\pcre\php_pcre.def ext\zlib\php_zlib.def ext\libxml\php_libxml2.def > Release\php5.dll.def</Line>
<Return>0</Return>
<Files>
<File write="true">C:\UnifiedBuild\php5\Release\php5.dll.def</File>
<File read="true">C:\UnifiedBuild\php5\ext\iconv\php_iconv.def</File>
<File read="true">C:\UnifiedBuild\php5\ext\pcre\php_pcre.def</File>
<File read="true">C:\UnifiedBuild\php5\ext\zlib\php_zlib.def</File>
<File read="true">C:\UnifiedBuild\php5\ext\libxml\php_libxml2.def</File>
</Files>
<Vars>
</Vars>
</Process>
</Traces>
Building Trace
In order to build Trace, you must first get Detours from
http://research.microsoft.com/en-us/projects/detours/, and install it. (If it's in the default location, the project file will find it.)