c-repl/Makefile
2023-11-10 17:35:33 +01:00

27 lines
707 B
Makefile

BUILDDIR := ./build
SRCDIR := ./src
CXX := g++
# Linker flag
LD_CXXFLAGS =
# Compilation flag
CXXFLAGS = -Wall -Wextra -g -O3 -std=c++2a
# 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
$(BUILDDIR)/main: $(SRCDIR)/main.cpp $(BUILDDIR)/input.o $(BUILDDIR)/interpreter.o $(BUILDDIR)/parser.o $(BUILDDIR)/tokenize.o
$(CXX) $^ -o $@ $(CXXFLAGS) $(LD_CXXFLAGS)
$(BUILDDIR)/%.o: $(SRCDIR)/%.cpp $(SRCDIR)/include/%.h
$(CXX) -c $< -o $@ $(CXXFLAGS)
clean:
rm -rf $(BUILDDIR)/*