Scons 是一個可以用來取代 Makefile 的編譯工具。
例如要編一個簡單的 .c 檔的話,只需要做
建立一個 SConstruct 檔 ( 預設檔名是 SConstruct、Sconstruct 或 sconstruct ),然後輸入下列:
env = Environment() # Initialize the environment # 初始化環境
env.Program(target = 'helloworld', source = ["helloworld.c"]) # 把 helloworld.c 編成 helloworld
例如要編一個簡單的 .c 檔的話,只需要做
建立一個 SConstruct 檔 ( 預設檔名是 SConstruct、Sconstruct 或 sconstruct ),然後輸入下列:
env = Environment() # Initialize the environment # 初始化環境
env.Program(target = 'helloworld', source = ["helloworld.c"]) # 把 helloworld.c 編成 helloworld
然後
$ scons
這樣就編好一個 helloworld 的執行檔,並安裝在當下的目錄中。移除的話
$ scons -c
更多指令 scons -h 查看。
Ref :
http://fourdollars.blogspot.com/2009/06/scons.html
http://www.scons.org/wiki/SconsTutorial1
Ref :
http://fourdollars.blogspot.com/2009/06/scons.html
http://www.scons.org/wiki/SconsTutorial1
「CMake」是跨平台的工具,可以用來產生 Makefile、Windows Visual Studio專案檔。
回覆刪除