1. Output log
How to obtain the make log in Linux?
How do I save the console dialog?
How do I save the compilation process information into logs?
Compilation may fail due to errors. Detailed analysis of error information helps solve syntax errors in the source code.
So how to save the configuration compilation process information? The amount of information is large and may be beyond the scope of Shell's tumble view. It is best to save the compilation process information as a log file for later analysis.
For example, you can run the command to save the compilation information. It stores all the information printed during the make process in XXX. log.
$ Make 2> & 1 | tee XXX. Log
This command is used to compile and save printed information. In the device definition of Linux Shell, "0" indicates the standard input, "1" indicates the standard output, and "2" indicates the standard error information output. 2> & 1 indicates that the information of device 2 is redirected to device 1 for backup. "|" indicates the pipeline symbol, which directly transmits the standard output information to the subsequent commands; tee is a tool for creating files and saving information; XXX. log is the file name.
This pipeline is widely used in Linux shell commands. You can use this method during compilation to generate a log file and save it to the buildlogs directory.
Ii. Dry run
Http://www.cs.northwestern.edu/academics/courses/211/html/make.html
When debugging makefile's, the following two flags can be handy:
- -N -- this causes
make
To only print the actions it wocould do, but not actually do them
- -B -- this forces
make
To run all the actions that apply, whether or not files have changed
Therefore, an easy way to "dry run" A makefile is to type:
make -B -n
This will show the commands that the makefile will do to build a project from scratch.