编译C++文件,特别是多文件的时候,经常要找模板,这里为了后面方便,就自己做了一个模板。
makefile模板:Makefile
# Object files to either reference or create #OBJECTS = Proj2.o Blackjack.o Deck.o Card.o Hand.o Player.o OBJECTS = phash.o # The executable file that will be created at the end EXEC = aphash #lib LIBS = $(shell pkg-config --libs opencv) # The flags to use for compilation FLAGS = -Wall # The code compiler to use for compilation CC = g++ # Perform action on all object files (May or may not exist) all: $(OBJECTS) $(CC) $(FLAGS) -o $(EXEC) $(OBJECTS) $(LIBS)
编译脚本模板:build.sh
make > log.txt 2>&1 if [ $? -eq 0 ];then echo "build success" else echo "budild failed and call log.txt" cat log.txt | grep "error:*" fi
作者:虚生 出处:https://www.cnblogs.com/dylancao/ 以音频和传感器算法为核心的智能可穿戴产品解决方案提供商 ,提供可穿戴智能软硬件解决方案的设计,开发和咨询服务。 勾搭热线:邮箱:1173496664@qq.com weixin:18019245820 市场技术对接群:347609188 |