簡體   English   中英

外部makefile調用Eclipse CDT生成的makefile - 根據Debug \\ Release配置

[英]External makefile to call Eclipse CDT's generated makefile - according to Debug\ Release config

我在Linux上使用Eclipse CDT來構建一個c ++可執行文件和幾個可執行文件依賴的靜態庫。 一切都很好 - Eclipse按預期為Debug和Release生成makefile。

但是,我想在沒有安裝Eclipse的計算機上編譯這段代碼,所以我想編寫一個調用Eclipse makefile的簡單makefile。

所以我從以下開始:

all:  
cd Lib1/Release && make all  
cd Lib2/Release && make all  
...  
cd Exec/Release && make all

這適用於僅發布,如您所見......

如何更改makefile以便我可以使用所選用戶的配置?

非常感謝你。

在makefile中,您可以調用'make debug'或'make release'來構建所需模式的所有項目:

config:
    cd Lib1/$(CONFIG) && make all
    ...
    cd LibN/$(CONFIG) && make all
    cd Exec/$(CONFIG) && make all
debug:
    make config CONFIG=Debug 
release:
    make config CONFIG=Release
.PHONY: debug release config

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM