diff --git a/Makefile.rules b/Makefile.rules index 547eb2786e9..d9645b63410 100644 --- a/Makefile.rules +++ b/Makefile.rules @@ -301,7 +301,7 @@ ifneq ($(REQUIRES_RTTI), 1) CXX.Flags += -fno-rtti endif -ifdef ENABLE_COVERAGE +ifeq ($(ENABLE_COVERAGE),1) BuildMode := $(BuildMode)+Coverage CXX.Flags += -ftest-coverage -fprofile-arcs C.Flags += -ftest-coverage -fprofile-arcs @@ -309,17 +309,17 @@ endif # If DISABLE_ASSERTIONS=1 is specified (make command line or configured), # then disable assertions by defining the appropriate preprocessor symbols. -ifndef DISABLE_ASSERTIONS +ifeq ($(DISABLE_ASSERTIONS),1) + CPP.Defines += -DNDEBUG +else BuildMode := $(BuildMode)+Asserts CPP.Defines += -D_DEBUG -else - CPP.Defines += -DNDEBUG endif # If ENABLE_EXPENSIVE_CHECKS=1 is specified (make command line or # configured), then enable expensive checks by defining the # appropriate preprocessor symbols. -ifdef ENABLE_EXPENSIVE_CHECKS +ifeq ($(ENABLE_EXPENSIVE_CHECKS),1) BuildMode := $(BuildMode)+Checks CPP.Defines += -D_GLIBCXX_DEBUG -DXDEBUG endif diff --git a/docs/MakefileGuide.html b/docs/MakefileGuide.html index a66f78a37c1..2ef0954a8bb 100644 --- a/docs/MakefileGuide.html +++ b/docs/MakefileGuide.html @@ -640,18 +640,18 @@ generate dependencies when running the compiler. Use of this feature is discouraged and it may be removed at a later date.
ENABLE_OPTIMIZED
-
If set to any value, causes the build to generate optimized objects, +
If set to 1, causes the build to generate optimized objects, libraries and executables. This alters the flags specified to the compilers and linkers. Generally debugging won't be a fun experience with an optimized build.
ENABLE_PROFILING
-
If set to any value, causes the build to generate both optimized and +
If set to 1, causes the build to generate both optimized and profiled objects, libraries and executables. This alters the flags specified to the compilers and linkers to ensure that profile data can be collected from the tools built. Use the gprof tool to analyze the output from the profiled tools (gmon.out).
DISABLE_ASSERTIONS
-
If set to any value, causes the build to disable assertions, even if +
If set to 1, causes the build to disable assertions, even if building a debug or profile build. This will exclude all assertion check code from the build. LLVM will execute faster, but with little help when things go wrong.