27
我該如何做這項工作?它的錯誤了以「讓:somevariable:命令未找到」不能在食譜內分配變量
sometarget:
somevariable = somevalue
完整的示例:
CXXFLAGS = -I/usr/include/test -shared -fPIC
OBJ = main.o Server.o
blabla : $(OBJ)
ifeq ($(argsexec),true)
# Creates an executable
CXXFLAGS = -I/usr/include/test
$(CXX) -o blabla $(OBJ) $(CXXFLAGS)
else
# Creates a library
DESTDIR = /home/pc
$(CXX) -o blabla $(OBJ) $(CXXFLAGS)
./bn.sh
endif
你找到了更好的解決方案嗎? –
另請參閱http://stackoverflow.com/questions/1909188/define-make-variable-at-rule-execution-time – Alexey
Pritesh:我現在使用tup構建系統來處理所有的c/C++項目。 http://gittup.org/tup/ – Blub