2026-07-18 18:48:23 +02:00
|
|
|
|
2026-07-18 20:03:40 +02:00
|
|
|
# Build mode. The DEFAULT is an optimized -O3 build (what installs and releases
|
|
|
|
|
# use). Opt into other modes explicitly:
|
|
|
|
|
# DEBUG=1 -> debug build: -O0 -g + AddressSanitizer (development)
|
|
|
|
|
# NOPYTHON=1 -> -O0 -g -DNOPYTHON, no ASan (build without the interpreter)
|
|
|
|
|
# `override` is used throughout so that a stray command-line or environment
|
|
|
|
|
# `OPTIMIZE=...` cannot leak into CXXFLAGS: OPTIMIZE is an internal flag string
|
|
|
|
|
# here, no longer a trigger. (A legacy `make OPTIMIZE=1` still yields -O3, since
|
|
|
|
|
# it falls through to the optimized default below.)
|
|
|
|
|
ifdef DEBUG
|
|
|
|
|
override OPTIMIZE := -O0 -g
|
|
|
|
|
SANITIZE := -fsanitize=address -fno-omit-frame-pointer
|
2026-07-18 18:48:23 +02:00
|
|
|
else ifdef NOPYTHON
|
2026-07-18 20:03:40 +02:00
|
|
|
override OPTIMIZE := -O0 -g -DNOPYTHON
|
2026-07-18 18:48:23 +02:00
|
|
|
SANITIZE :=
|
|
|
|
|
else
|
2026-07-18 20:03:40 +02:00
|
|
|
# Performance build (default).
|
|
|
|
|
override OPTIMIZE := -O3
|
|
|
|
|
SANITIZE :=
|
2026-07-18 18:48:23 +02:00
|
|
|
endif
|