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