|
本文介绍 GNU make。为了准确,本文引用英语原文为主,作为学习笔记。 The make utility automatically determines which pieces of a large program need to be recompiled, and issues commands to recompile them.
GNU make conforms to section 6.2 of IEEE Standard 1003.2-1992 (POSIX.2).
You can use make with any programming language (不仅仅包括linux下常见的C) whose compiler can be run with a shell command. Indeed, make is not limited to programs. You can use it to describe any task where some files must be updated automatically from others whenever the others change.
To prepare to use make, you must write a file called the makefile that describes the relationships among files in your program and provides commands for updating each file. In a program, typically, the executable file is updated from object files, which are in turn made by compiling source files.
Once a suitable makefile exists, each time you change some source files, this simple shell command:
make
suffices to perform all necessary recompilations. The make program uses the makefile data base and the last-modification times of the files to decide which of the files need to be updated. For each of those files, it issues the commands recorded in the data base.
来源:http://sunsite.ualberta.ca/Documentation/Gnu/make-3.79/html_chapter/make_toc.html 这个网址上对make和makefile的介绍很权威,很详细,请参考。
|
一共有 1 条评论