Créer un profil "debug" qui contient les warnings et le flag "-g", make sans argument compile avec l'optimisation 3

This commit is contained in:
Mylloon 2022-04-05 17:11:13 +02:00
parent c438d38a5d
commit aa0292e796
Signed by: Anri
GPG key ID: A82D63DFF8D1317F

View file

@ -1,6 +1,5 @@
CXX = g++ CXX = g++
CXXFLAGS = -Wall -Wextra -O3 --std=c++17 CXXFLAGS = --std=c++17
DEVFLAGS = -g
RM = rm RM = rm
SOURCES = $(wildcard src/*.cpp) SOURCES = $(wildcard src/*.cpp)
@ -11,7 +10,13 @@ EXE = ecosysteme
%.cpp.o: src/%.cpp %.cpp.o: src/%.cpp
$(CXX) -c -o $@ $< $(CXXFLAGS) $(DEVFLAGS) $(CXX) -c -o $@ $< $(CXXFLAGS) $(DEVFLAGS)
main: $(OBJETS) main: CXXFLAGS += -O3
main: compilation
debug: CXXFLAGS += -Wall -Wextra -Wshadow -Wnon-virtual-dtor -pedantic -g
debug: compilation
compilation: $(OBJETS)
$(CXX) -o $(EXE) $(OBJETS) $(CXX) -o $(EXE) $(OBJETS)
all: all: