LinuxC programming --- use of the make command

Source: Internet
Author: User
LinuxC programming --- use of the make command -- general Linux technology-Linux programming and kernel information. The following is a detailed description. Abstract: when developing a system, a system is generally divided into several modules, which improves the maintainability of the system. However, due to the inevitable association between modules, therefore, when a module is changed, other modules may be updated. Of course, it is okay to manually compile the connection for small systems. However, if it is a large system, there are many modules, the manual compilation method is not applicable. In Linux, A make command is provided to automatically maintain the target file. Compared with manual compilation and connection, the make command updates only the modified files (in Linux, a file is created or updated with a last modification time, the make command determines whether the file has been modified through the last modification time), and ignores unmodified files, and the make command does not miss a file to be updated.
When developing a system, a system is generally divided into several modules, which improves the maintainability of the system. However, since each module is inevitably associated, when a module is changed, other modules may be updated. Of course, it is okay to manually compile the connection for small systems. However, if there are many modules in a large system, the manual compilation method will not apply. In Linux, A make command is provided to automatically maintain the target file. Compared with manual compilation and connection, the make command updates only the modified files (in Linux, a file is created or updated with a last modification time, the make command determines whether the file has been modified through the last modification time), and ignores unmodified files, and the make command does not miss a file to be updated.
  
Files and files or modules may depend on each other. The make command is maintained based on this dependency. Therefore, it is necessary to understand what dependency is: if we want to play a game, we must have a game CD and a computer (the dependency between the two), and the prerequisite for a game CD and a computer is that the financial conditions permit, in addition, when you have a game CD, you need to choose which game to play based on your mood. For example:
  
Play games
/
/
Game CDs
//
//
Economic mood
  
Of course, the make command does not know these dependencies on its own, but the programmer needs to write these dependencies into a file named makefile. The Makefile file contains some targets. Generally, the target is the file name. For each target, a set of commands are provided to achieve the target and other targets or file names that are dependent on the target, the following is a simple example of Makefile:
  
# A simple Makefile
  
QUOTE:
Related Article

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.