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:
parent
c438d38a5d
commit
aa0292e796
1 changed files with 8 additions and 3 deletions
11
Makefile
11
Makefile
|
@ -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:
|
||||||
|
|
Reference in a new issue