Làm cách nào để thực hiện công việc này? Nó lỗi với "thực hiện: somevariable: Command not found"Không thể gán biến trong công thức
sometarget:
somevariable = somevalue
Full dụ:
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
Bạn có tìm thấy giải pháp tốt hơn không? –
Xem thêm http://stackoverflow.com/questions/1909188/define-make-variable-at-rule-execution-time – Alexey
Pritesh: Bây giờ tôi sử dụng hệ thống xây dựng tup cho tất cả các dự án c/C++ của tôi. http://gittup.org/tup/ – Blub