Make outputs log and dry run

Source: Internet
Author: User
Tags linux shell commands

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 causesmakeTo only print the actions it wocould do, but not actually do them
  • -B -- this forcesmakeTo 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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.