The built-in pattern rule for compiling a C++ source file already considers CXXFLAGS, so this default behaviour is exactly what we want. This Makefile really is now stripped to its bare form.
16 lines
282 B
Makefile
16 lines
282 B
Makefile
CXXFLAGS += -Wshadow -Wall -Wpedantic -Wextra -Wno-unused-parameter
|
|
CXXFLAGS += -g3 -std=c++20
|
|
ifeq ($(DEBUG), 1)
|
|
CXXFLAGS += -DDEBUG -O0
|
|
else
|
|
CXXFLAGS += -DNDEBUG -O3
|
|
endif
|
|
|
|
.PHONY: clean
|
|
|
|
{PROJECT}: {PROJECT}.o
|
|
c++ -o {PROJECT} {PROJECT}.o
|
|
|
|
clean:
|
|
rm -f {PROJECT}.o {PROJECT}
|