GNU make manual 翻译(七十三)
生活随笔
收集整理的這篇文章主要介紹了
GNU make manual 翻译(七十三)
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
繼續翻譯
4 Writing Rules *************** A "rule" appears in the makefile and says when and how to remake certain files, called the rule's "targets" (most often only one per rule). It lists the other files that are the "prerequisites" of the target, and the "recipe" to use to create or update the target. The order of rules is not significant, except for determining the default goal: the target for `make' to consider, if you do not otherwise specify one. The default goal is the target of the first rule in the first makefile. If the first rule has multiple targets, only the first target is taken as the default. There are two exceptions: a target starting with a period is not a default unless it contains one or more slashes, `/', as well; and, a target that defines a pattern rule has no effect on the default goal. (*Note Defining and Redefining Pattern Rules: Pattern Rules.) Therefore, we usually write the makefile so that the first rule is the one for compiling the entire program or all the programs described by the makefile (often with a target called `all'). *Note Arguments to Specify the Goals: Goals.一個規則出現在makefile中,表明何時以及如何重新建立特定的文件--此規則的目的(大多數情況下,每個規則一個文件)。它也列出作為此目的的前提條件的文件列表,還有用來創建和更改目的的片段。
?
規則的順序并不重要,除了決定缺省的終點: make 所考慮的目的。如果你不指定一個,那么make就會使用缺省的終點。
缺省的終點就是第一個makefile中的第一個規則的目的。
如果第一個規則有多個目的,那么只有第一個目的被認為是缺省的。
但是有兩個例外:以句號開始的目的不是缺省的,除非它還包含一個或多個 /。
在缺省終點,定義模式規則的目的是無效的。(*Note Defining and Redefining Pattern Rules:Pattern Rules)
?
因此,我們通常寫makefile的時候,第一個規則是一個編譯整個程序或者所有程序的。
(此目的經常命名為 all)。*Note Arguments to Specify the Goals: Goals
后文待續
總結
以上是生活随笔為你收集整理的GNU make manual 翻译(七十三)的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: mysql把latin1编码的中文转成g
- 下一篇: C# 属性反射