2023-10-20 17:15:15 +02:00
|
|
|
BUILDDIR := ./build
|
|
|
|
SRCDIR := ./src
|
|
|
|
CXX := g++
|
|
|
|
|
|
|
|
# Linker flag
|
|
|
|
LD_CXXFLAGS =
|
|
|
|
|
|
|
|
# Compilation flag
|
|
|
|
CXXFLAGS = -Wall -Wextra -std=gnu99 -g -O3
|
|
|
|
# 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 14:09:25 +02:00
|
|
|
$(BUILDDIR)/main: $(SRCDIR)/main.cpp $(BUILDDIR)/input.o
|
2023-10-20 17:15:15 +02:00
|
|
|
$(CXX) $^ -o $@ $(CFLAGS) $(LD_CFLAGS)
|
|
|
|
|
|
|
|
|
|
|
|
$(BUILDDIR)/%.o: $(SRCDIR)/%.cpp $(SRCDIR)/include/%.h
|
|
|
|
$(CXX) -c $< -o $@ $(CFLAGS)
|
|
|
|
|
|
|
|
|
|
|
|
clean:
|
|
|
|
rm -rf $(BUILDDIR)/*
|