From ec820db997af8c9a7508d21b204a72a2debb0204 Mon Sep 17 00:00:00 2001 From: Philippe Teuwen Date: Tue, 20 Oct 2020 01:00:00 +0200 Subject: [PATCH] Add DEBUG flag to Makefile --- Makefile.defs | 12 +++++++++--- doc/md/Development/Makefile-vs-CMake.md | 5 +++-- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/Makefile.defs b/Makefile.defs index 4045fb711..a06cbb31e 100644 --- a/Makefile.defs +++ b/Makefile.defs @@ -51,9 +51,15 @@ else RANLIB= ranlib endif -DEFCXXFLAGS = -Wall -Werror -O3 -pipe -DEFCFLAGS = -Wall -Werror -O3 -fstrict-aliasing -pipe -DEFLDFLAGS = +ifeq ($(DEBUG),1) + DEFCXXFLAGS = -g -O0 -pipe + DEFCFLAGS = -g -O0 -fstrict-aliasing -pipe + DEFLDFLAGS = +else + DEFCXXFLAGS = -Wall -Werror -O3 -pipe + DEFCFLAGS = -Wall -Werror -O3 -fstrict-aliasing -pipe + DEFLDFLAGS = +endif # Next ones are activated only if SANITIZE=1 ifeq ($(SANITIZE),1) DEFCFLAGS += -g -fsanitize=address -fno-omit-frame-pointer diff --git a/doc/md/Development/Makefile-vs-CMake.md b/doc/md/Development/Makefile-vs-CMake.md index 314cd1e7a..6fa95066c 100644 --- a/doc/md/Development/Makefile-vs-CMake.md +++ b/doc/md/Development/Makefile-vs-CMake.md @@ -13,7 +13,8 @@ At the moment both are maintained because they don't perfectly overlap yet. | Feature | Makefile | CMake | Remarks | |-----|---|---|---| -| verbose | V=1 | VERBOSE=1 | | +| verbose | `V=1` | `VERBOSE=1` | | +| debug build | `DEBUG=1` | `-DCMAKE_BUILD_TYPE=Debug` | client only | | warnings management | yes (1) | **no** | (1) cf Makefile.defs | | extra GCC warnings | GCCEXTRA=1 | **no** | | | extra Clang warnings | CLANGEXTRA=1 | **no** | only on host | @@ -32,7 +33,7 @@ At the moment both are maintained because they don't perfectly overlap yet. | bzip2 detection | **none** | find_package, Cross:gitclone | | | dep cliparser | in_deps | in_deps | | | dep hardnested | in_deps | in_deps | | -| hardn arch autodetect | `uname -m` =? 86 or amd64; `$(CC) -E -mavx512f`? +AVX512` | `CMAKE_SYSTEM_PROCESSOR` =? x86 or x86_64 or i686 or AMD64 (1) | (1) currently it always includes AVX512 on Intel arch | +| hardn arch autodetect | `uname -m` =? 86 or amd64; `$(CC) -E -mavx512f`? +`AVX512` | `CMAKE_SYSTEM_PROCESSOR` =? x86 or x86_64 or i686 or AMD64 (1) | (1) currently it always includes AVX512 on Intel arch | | `cpu_arch` | yes | **no/auto?** | e.g. `cpu_arch=generic` for cross-compilation | dep jansson | sys / in_deps | sys / in_deps | | | jansson detection | pc | pc/find* | |