TrumanWong

make

GNU engineering compilation tools

Supplementary instructions

make command is GNU's engineering compilation tool, which is used to compile many interrelated source code files to achieve engineering management and improve development efficiency.

grammar

make(options)(parameters)

Options

-f: Specify the "makefile" file;
-i: Ignore error messages returned by command execution;
-s: Silent mode, no corresponding command line information is output before execution;
-r: Disable the use of build-in rules;
-n: Non-execution mode, outputs all execution commands but does not execute them;
-t: update target file;
-q: The make operation will return "0" or non-"0" status information based on whether the target file has been updated;
-p: Output all macro definitions and target file descriptions;
-d: Debug mode, output detailed information about files and detection time.

Commonly used options under Linux are slightly different from those in Unix systems. The following are the different parts:

-c dir: Change to the specified directory dir before reading the makefile;
-I dir: Use this option to specify the search directory when including other makefile files;
-h: help file, displays all make options;
-w: Display the working directory before and after processing the makefile.

Parameters

Target: Specify the compilation target.

Knowledge expansion

Whether in Linux or Unix environment, make is a very important compilation command. Whether we are developing our own projects or installing application software, we often use make or make install. Using the make tool, we can decompose large-scale development projects into multiple more manageable modules. For an application that includes hundreds of source files, using the make and makefile tools can neatly and neatly smooth out the complexity between the various source files. complex interrelationships.

And with so many source files, if you have to type the gcc command to compile every time, it would be a disaster for programmers. The make tool can automatically complete the compilation work, and can only compile the parts that the programmer has modified since the last compilation.

Therefore, effective use of make and makefile tools can greatly improve the efficiency of project development. After mastering make and makefile at the same time, you will no longer be at a loss when faced with application software under Linux.