2010年12月21日 星期二

3.7 How make Reads a Makefile

GNU make does its work in two distinct phases. During the first phase it reads all the makefiles, included makefiles, etc. and internalizes all the variables
   and their values, implicit and explicit rules, and constructs a dependency graph of all the targets and their prerequisites. During the second phase, make
   uses these internal structures to determine what targets will need to be rebuilt and to invoke the rules necessary to do so.

原來make在做事情的時候會有兩個階段
1. 先把所有makefile讀入, include相關makefile, 載入所有相關變數
最後建立一個 相關連的dependency

2. 根據makefile條件來決定哪些target需要被更新

Reference


透過Facebook分享

沒有留言: