init-projects/cpp/Makefile
2024-04-03 15:38:54 +02:00

29 lines
529 B
Makefile

CXX = g++
RM = rm
SOURCES = $(wildcard src/*.cpp)
OBJECTS = $(patsubst %.cpp,%.o,$(notdir $(SOURCES)))
CXXFLAGS = --std=c++11
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 -pedantic -g
debug: CXXFLAGS += -Wold-style-cast -Wsign-conversion
debug: compilation
compilation: $(OBJECTS)
$(CXX) -o $(EXE).$(EXE_EXT) $(OBJECTS)
all:
release
clean:
$(RM) $(OBJECTS) $(EXE).$(EXE_EXT)