29 lines
511 B
Makefile
29 lines
511 B
Makefile
CXX = g++
|
|
RM = rm
|
|
|
|
SOURCES = $(wildcard src/*.cpp)
|
|
OBJETS = $(patsubst %.cpp,%.o,$(notdir $(SOURCES)))
|
|
|
|
CXXFLAGS = --std=c++11
|
|
|
|
EXE = example
|
|
EXE_EXT = out
|
|
|
|
%.o: src/%.cpp
|
|
$(CXX) -c -o $@ $< $(CXXFLAGS)
|
|
|
|
compilation: $(OBJETS)
|
|
$(CXX) -o $(EXE).$(EXE_EXT) $(OBJETS)
|
|
|
|
main: CXXFLAGS += -O3
|
|
main: compilation
|
|
|
|
dev: CXXFLAGS += -Wall -Wextra -Wshadow -Wnon-virtual-dtor -pedantic -g
|
|
dev: CXXFLAGS += -Wold-style-cast -Wsign-conversion
|
|
dev: compilation
|
|
|
|
all:
|
|
main
|
|
|
|
clean:
|
|
$(RM) $(OBJETS) $(EXE).$(EXE_EXT)
|