From ef40b73392888b1bac5ab06ba3130290c3e89956 Mon Sep 17 00:00:00 2001 From: Yann Herklotz Date: Tue, 24 Oct 2017 18:38:10 +0100 Subject: Adding initial files --- makefile | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 makefile (limited to 'makefile') diff --git a/makefile b/makefile new file mode 100644 index 0000000..fb5c24d --- /dev/null +++ b/makefile @@ -0,0 +1,26 @@ +CXX = g++ +CXX_FLAGS = -Wfatal-errors -Wall -Wextra -Wpedantic -Wconversion -Wshadow -Iinclude + +BIN = simplex +BUILD_DIR = ./build + +CPP = $(wildcard src/*.cpp) + +OBJ = $(CPP:%.cpp=$(BUILD_DIR)/%.o) +DEP = $(OBJ:%.o=%.d) + +$(BIN) : $(BUILD_DIR)/$(BIN) + +$(BUILD_DIR)/$(BIN) : $(OBJ) + mkdir -p $(@D) + $(CXX) $(CXX_FLAGS) $^ -o $@ + +-include $(DEP) + +$(BUILD_DIR)/%.o : %.cpp + mkdir -p $(@D) + $(CXX) $(CXX_FLAGS) -MMD -c $< -o $@ + +.PHONY : clean +clean : + -rm $(BUILD_DIR)/$(BIN) $(OBJ) $(DEP) -- cgit