From 19ca5f026c2eab97396732cdf21b352ba39ac890 Mon Sep 17 00:00:00 2001 From: ichdream Date: Fri, 10 Sep 2021 15:23:29 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BB=9F=E4=B8=80=E7=94=A8Makefile=E7=AE=A1?= =?UTF-8?q?=E7=90=86=E7=BC=96=E8=AF=91=E8=BF=87=E7=A8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 06.Singleton/2.Code/Singleton/Makefile | 29 ++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 06.Singleton/2.Code/Singleton/Makefile diff --git a/06.Singleton/2.Code/Singleton/Makefile b/06.Singleton/2.Code/Singleton/Makefile new file mode 100644 index 0000000..e7b65b7 --- /dev/null +++ b/06.Singleton/2.Code/Singleton/Makefile @@ -0,0 +1,29 @@ +DIR_INC = ./ +DIR_SRC = ./ +DIR_OBJ = ./obj +DIR_BIN = ./bin + +SRC = $(wildcard ${DIR_SRC}/*.cpp) +OBJ = $(patsubst %.cpp,${DIR_OBJ}/%.o,$(notdir ${SRC})) + +TARGET = main + +BIN_TARGET = ${DIR_BIN}/${TARGET} + +CC = g++ +CFLAGS = -g -Wall -I${DIR_INC} -pthread + + +${BIN_TARGET}:${OBJ} + mkdir -p $(DIR_BIN) + $(CC) $(CFLAGS) $(OBJ) -o $@ + +${DIR_OBJ}/%.o:${DIR_SRC}/%.cpp + mkdir -p $(DIR_OBJ) + $(CC) $(CFLAGS) -c $< -o $@ + +.PHONY:clean + +clean: + rm -rf bin obj + rm -rf ./main \ No newline at end of file