2023-09-19 11:39:57 +02:00
|
|
|
CXX = g++
|
|
|
|
CXXFLAGS = --std=c++11
|
|
|
|
RM = rm
|
|
|
|
|
|
|
|
SOURCES = $(wildcard src/*.cpp)
|
|
|
|
OBJETS = $(patsubst %.cpp,%.cpp.o,$(notdir $(SOURCES)))
|
|
|
|
|
|
|
|
EXE = example
|
2023-10-10 13:15:09 +02:00
|
|
|
EXE_EXT = out
|
2023-09-19 11:39:57 +02:00
|
|
|
|
|
|
|
%.cpp.o: src/%.cpp
|
|
|
|
$(CXX) -c -o $@ $< $(CXXFLAGS) $(DEVFLAGS)
|
|
|
|
|
|
|
|
main: CXXFLAGS += -O3
|
|
|
|
main: compilation
|
|
|
|
|
|
|
|
dev: CXXFLAGS += -Wall -Wextra -Wshadow -Wnon-virtual-dtor -pedantic -g -Wold-style-cast -Wsign-conversion
|
|
|
|
dev: compilation
|
|
|
|
|
|
|
|
compilation: $(OBJETS)
|
2023-10-10 13:15:09 +02:00
|
|
|
$(CXX) -o $(EXE).$(EXE_EXT) $(OBJETS)
|
2023-09-19 11:39:57 +02:00
|
|
|
|
|
|
|
all:
|
|
|
|
main
|
|
|
|
|
|
|
|
clean:
|
2023-10-10 13:15:09 +02:00
|
|
|
$(RM) $(OBJETS) $(EXE).$(EXE_EXT)
|