2023-10-20 17:15:15 +02:00
|
|
|
BUILDDIR := ./build
|
|
|
|
SRCDIR := ./src
|
|
|
|
CXX := g++
|
|
|
|
|
|
|
|
# Linker flag
|
|
|
|
LD_CXXFLAGS =
|
|
|
|
|
|
|
|
# Compilation flag
|
2023-10-27 17:54:10 +02:00
|
|
|
CXXFLAGS = -Wall -Wextra -g -O3
|
2023-10-20 17:15:15 +02:00
|
|
|
# Remove warnings about unused variables, functions, ...
|
|
|
|
# -Wno-unused-parameter -Wno-unused-function -Wno-unused-variable -Wno-unused-but-set-variable
|
|
|
|
# Compile with debug
|
|
|
|
# -g
|
|
|
|
# See memory leaks and Incorrect Read/Write
|
|
|
|
# -fsanitize=address -lasan
|
|
|
|
|
2023-10-27 17:54:10 +02:00
|
|
|
$(BUILDDIR)/main: $(SRCDIR)/main.cpp $(BUILDDIR)/input.o src/include/parser.h
|
|
|
|
$(CXX) $^ -o $@ $(CXXFLAGS) $(LD_CXXFLAGS)
|
2023-10-20 17:15:15 +02:00
|
|
|
|
|
|
|
|
|
|
|
$(BUILDDIR)/%.o: $(SRCDIR)/%.cpp $(SRCDIR)/include/%.h
|
2023-10-27 17:54:10 +02:00
|
|
|
$(CXX) -c $< -o $@ $(CXXFLAGS)
|
2023-10-20 17:15:15 +02:00
|
|
|
|
|
|
|
|
|
|
|
clean:
|
|
|
|
rm -rf $(BUILDDIR)/*
|