From 4128c5a0fe0285b38d4e6078c67c8da2187a01be Mon Sep 17 00:00:00 2001 From: fengqiangguo Date: Sun, 6 Aug 2023 10:44:10 +0800 Subject: [PATCH] Remove Makefile, add CMakeLists.txt. --- 01.SimpleFactory/2.Code/CMakeLists.txt | 4 ++++ 01.SimpleFactory/2.Code/Makefile | 29 -------------------------- 2 files changed, 4 insertions(+), 29 deletions(-) create mode 100644 01.SimpleFactory/2.Code/CMakeLists.txt delete mode 100644 01.SimpleFactory/2.Code/Makefile diff --git a/01.SimpleFactory/2.Code/CMakeLists.txt b/01.SimpleFactory/2.Code/CMakeLists.txt new file mode 100644 index 0000000..1362297 --- /dev/null +++ b/01.SimpleFactory/2.Code/CMakeLists.txt @@ -0,0 +1,4 @@ +cmake_minimum_required(VERSION 3.10) +project(SimpleFactory) +set(SRC_LIST main.cpp) +add_executable(app ${SRC_LIST}) \ No newline at end of file diff --git a/01.SimpleFactory/2.Code/Makefile b/01.SimpleFactory/2.Code/Makefile deleted file mode 100644 index ce492a8..0000000 --- a/01.SimpleFactory/2.Code/Makefile +++ /dev/null @@ -1,29 +0,0 @@ -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} - - -${BIN_TARGET}:${OBJ} - mkdir -p $(DIR_BIN) - $(CC) $(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