diff --git a/01.SimpleFactory/2.Code/Makefile b/01.SimpleFactory/2.Code/Makefile new file mode 100644 index 0000000..ce492a8 --- /dev/null +++ b/01.SimpleFactory/2.Code/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} + + +${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