Records every command it executes in the console, so
make 2>&1 | tee build.log
will create a log file called build.log as a side effect that contains the same material that was recorded on the screen. ( man tee for more details.)
2>&1 combines standard output and errors into a single stream. If you did not enable this, regular output will go into the log file, but errors will only go to the console. ( make only writes stderr when the command returns an error code.)
If you want to completely disable output in favor of logging to a file, this is even simpler:
make 2>&1 > build.log
Since they just capture console output, they work great with recursive make .
olooney
source share