.PHONY:clean install CC=g++ CFLAGS=-Wall -g BIN=libecho.a INCLUDE=echo SRC=src OBJS=Socket.o Rio.o TcpConnection.o PollPoller.o InetAddress.o TcpServer.o Thread.o Condition.o ThreadPool.o Exception.o Timer.o TimerThread.o STARD=-std=c++0x -rdynamic $(BIN):$(OBJS) ar -crv [email protected] -o $^ chmod 0777 [email protected] rm -f *.o rm -rf $(INCLUDE) mkdir $(INCLUDE) cp src/*.h $(INCLUDE)/ %.o:$(SRC)/%.cpp $(CC) $(CFLAGS) -c $< -o [email protected] $(STARD) install: sudo cp $(BIN) /usr/lib/ sudo cp $(INCLUDE) /usr/include/ -r clean: rm -rf *.o $(BIN) echo
一个可以自动生成静态库,自动安装程序的Makefile,布布扣,bubuko.com
时间: 2024-10-18 21:48:41