summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbjarni <bjarni@openttd.org>2004-11-08 21:24:48 +0000
committerbjarni <bjarni@openttd.org>2004-11-08 21:24:48 +0000
commitb78bbf80bf050e04814d0f60e9769a4bdf1e7068 (patch)
tree4771876978b426ae06692889981554a018e32862
parent72880f2dad5e322eae65fbd66787c26e710802e2 (diff)
downloadopenttd-b78bbf80bf050e04814d0f60e9769a4bdf1e7068.tar.xz
(svn r531) Makefile: made asserts enabled by default
RELEASE disables asserts unless ENABLE_ASSERTS(not in makefile.config) is set makefile.config version 3
-rw-r--r--Makefile9
-rw-r--r--makefiledir/Makefile.config_writer4
2 files changed, 10 insertions, 3 deletions
diff --git a/Makefile b/Makefile
index 5dd1d4675..d0ba157d0 100644
--- a/Makefile
+++ b/Makefile
@@ -109,7 +109,7 @@
# Makefile version tag
# it checks if the version tag in makefile.config is the same and force update outdated config files
-MAKEFILE_VERSION:=2
+MAKEFILE_VERSION:=3
# CONFIG_WRITER have to be found even for manual configuration
CONFIG_WRITER=makefiledir/Makefile.config_writer
@@ -405,9 +405,16 @@ endif
endif
# enables/disables assert()
+ifdef DISABLE_ASSERTS
+CFLAGS += -DNDEBUG
+endif
+
+# automatically disables asserts for release
+ifdef RELEASE
ifndef ENABLE_ASSERTS
CFLAGS += -DNDEBUG
endif
+endif
ifdef TRANSLATOR
STRGEN_FLAGS=-t
diff --git a/makefiledir/Makefile.config_writer b/makefiledir/Makefile.config_writer
index 0c3d669d3..55315a07c 100644
--- a/makefiledir/Makefile.config_writer
+++ b/makefiledir/Makefile.config_writer
@@ -27,8 +27,8 @@ $(MAKE_CONFIG):
$(call CONFIG_LINE,SUPRESS_LANG_ERRORS:=$(SUPRESS_LANG_ERRORS))
$(call CONFIG_LINE,)
- $(call CONFIG_LINE,\# Enable asserts)
- $(call CONFIG_LINE,ENABLE_ASSERTS:=$(ENABLE_ASSERTS))
+ $(call CONFIG_LINE,\# Disable asserts. Leave them on for easier bug finding)
+ $(call CONFIG_LINE,DISABLE_ASSERTS:=$(DISABLE_ASSERTS))
$(call CONFIG_LINE,)
$(call CONFIG_LINE,\# See Makefile for details on these paths)