From 88bd6945554aea926123c39d9bc44cc1f525d218 Mon Sep 17 00:00:00 2001 From: Tom Smeding Date: Mon, 19 Oct 2020 18:14:49 +0200 Subject: Initial --- Makefile | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 Makefile (limited to 'Makefile') diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..834f021 --- /dev/null +++ b/Makefile @@ -0,0 +1,30 @@ +CXX = g++ +CXXFLAGS = -Wall -Wextra -std=c++17 -O2 -g -flto +LDFLAGS = $(CXXFLAGS) +TARGET = datetags + +SOURCES = $(wildcard *.cpp) + +OBJDIR = obj + +.PHONY: all clean + +all: $(TARGET) + +clean: + @echo "Cleaning" + @rm -f $(TARGET) + @rm -rf $(OBJDIR) + + +$(OBJDIR)/%.o: %.cpp $(wildcard *.h) | $(OBJDIR) + @mkdir -p $(dir $@) + @echo "CXX $<" + @$(CXX) $(CXXFLAGS) -c -o $@ $< + +$(TARGET): $(patsubst %.cpp,$(OBJDIR)/%.o,$(SOURCES)) | $(OBJDIR) + @echo "LD -o $@" + @$(CXX) -o $@ $^ $(LDFLAGS) + +$(OBJDIR): + @mkdir -p $(OBJDIR) -- cgit v1.2.3-70-g09d2