http://checko.blogspot.com/2006/10/ce-inside-build-process-msdn.html
CE : inside build process - msdn
從Platform下的一個folder (platform)來看..
Platform下的file : dirs ,其中列出build時要深入的folder。
dirs 只有說明要build的有哪些目錄。
folder中的 sources 這個檔案則說明了該folder在build時的各項資料(有點像Linux的 config )。
有sources 這個file的folder就會有makefile這一個檔案,代表這個folder要實際作build動作。
幾乎所有的makefile都只有一行:
!INCLUDE $(_MAKEEVNROOT)\makefile.def其中 _MAKEENVROOT 這個環境變數,可以在open
release enviroment 中用
SET _MAKEENVROOT來看,應該會是
_MAKEENVROOT=C:\WINCE500\public\common\oak\misc所以這個"system-wide
makefile是
_MAKEENVROOT=C:\WINCE500\public\common\oak\misc\makefile.def在makefile中使
用環境變數的方式和在command shell中不一樣。
makefile中用 $( )將環境變數刮起來,command shell中用 % % 刮起來。
build process依照幾乎統一的makefile,同時follow dirs, sources這兩個file的內容來 build。
在dirs, sources中可以定義macro,改變make的行為。macro的定義方式是:
Macroname= value和Linux的Makefile一樣,Marconame和"="之間不可以有space。
一樣,用"\"代表聯到下一行。
Macroname 不分大小寫。
Build.exe和Nmake.exe都會將macro展開。
sources 這個檔案中,有一些常用的Macroname:
TARGETNAME=
最後build出來的targetname (不含extension)
TARGETTPE=
build出來的target的extensionname,PROGRAM的話就是 .exe,DYNLINK 就是 .dll。
TARGETLIBS=
列出要link的library
SOURCES=
要compile -in的source file有哪些,不包含header。
EXEENTRY=
exe 檔的進入點,"WinMain" sets the entry point for a Windows application
INCLUDES=
用到的header file
SOURCELIBS=
這一個說明很奇怪,指定要link的library,這個和TARGETLIBS有什麼不一樣?
sources 決定build options。
makefile都是同一個。
dirs 決定builder recursive的path。