GNU Make 3.79 User Manual

This manual introduces the use of GNU Make, including make overview, Makefile file introduction, writing Makefile files, writing rules, using commands in rules, using variables, Makefile file condition statements, text conversion functions, executing make and using implicit rules.


GNU Make 3.79 User Manual - cover page
Brand
GNU
Document type
User Manual
Language
Chinese
Pages
90
File format
PDF
File size
653 KB
Updated
30 September, 2023
MD5 checksum
9877F5C8763BA2BED040F83A4AA524DF

About this manual

This manual introduces GNU Make, a tool that automatically determines which files in a program need to be rebuilt and executes the necessary commands. It covers the basic concepts of Makefiles, rule syntax, and how to invoke make to compile projects.

The guide also details advanced topics such as using variables, implicit (suffix) rules, pattern rules, parallel execution, and special targets like .PHONY and clean. Example Makefiles and command-line options are provided throughout the document. This manual is written in Chinese.

What's inside

  • Make Overview
  • Makefile Introduction
  • Writing Rules
  • Using Variables
  • Implicit (Suffix) Rules
  • Pattern Rules
  • Special Targets
  • Parallel Execution
  • Command-Line Options
  • Appendix

Specifications

Version3.79

Frequently asked questions

How do I start a build with GNU Make?

Type the command `make` in the directory containing the Makefile.

How can I clean the build artifacts?

Use the `make clean` command, which runs the clean target defined in the Makefile.

What is the purpose of a .PHONY target?

A .PHONY target defines a name that is not a real file, used for actions like `clean` that should always run.

How can I simplify a Makefile using variables?

Define a variable (e.g., `objects = main.o kbd.o …`) and reference it with `$$(objects)` to avoid listing files repeatedly.

Download PDF (653 KB)

More GNU Manuals


View all GNU manuals →