diff options
author | Norbert Thiebaud <nthiebaud@gmail.com> | 2011-03-15 09:03:55 -0500 |
---|---|---|
committer | Norbert Thiebaud <nthiebaud@gmail.com> | 2011-03-15 09:03:55 -0500 |
commit | 6963ab2fd7f35282f30f7d41dbcfa53b5a255826 (patch) | |
tree | 143d6849a8159686d167734a06c05b07f0b10374 | |
parent | 5b77e7fad500b4a0a4c66e0c74a8ea42ab72591d (diff) |
add support for symbol=t in gnumake to build release code with symbol
It is needed to be able to build the release code with the debug symbol
and without disabling the build optimisations
setting symbol=xxx symbols=xxx SYMBOL=xxxx or SYMBOLS=xxx
where xxx is anything not purely spaces
will activate the generation of symbols
Note that this generation is implicit with debug=t.
-rw-r--r-- | solenv/gbuild/gbuild.mk | 8 | ||||
-rwxr-xr-x | solenv/gbuild/platform/linux.mk | 9 | ||||
-rwxr-xr-x | solenv/gbuild/platform/macosx.mk | 2 | ||||
-rwxr-xr-x | solenv/gbuild/platform/solaris.mk | 2 | ||||
-rwxr-xr-x | solenv/gbuild/platform/windows.mk | 5 |
5 files changed, 21 insertions, 5 deletions
diff --git a/solenv/gbuild/gbuild.mk b/solenv/gbuild/gbuild.mk index b3bf7b853..085909a78 100644 --- a/solenv/gbuild/gbuild.mk +++ b/solenv/gbuild/gbuild.mk @@ -83,8 +83,16 @@ gb_PRODUCT := $(false) endif endif +ifneq ($(strip $(SYMBOL)$(symbol)$(SYMBOLS)$(symbols)),) +gb_SYMBOL := $(false) +else +gb_SYMBOL := $(true) +endif + + ifneq ($(strip $(DEBUG)$(debug)),) gb_DEBUGLEVEL := 2 +gb_SYMBOL := $(true) else ifeq ($(gb_PRODUCT),$(true)) gb_DEBUGLEVEL := 0 diff --git a/solenv/gbuild/platform/linux.mk b/solenv/gbuild/platform/linux.mk index 39176604c..c9988dfca 100755 --- a/solenv/gbuild/platform/linux.mk +++ b/solenv/gbuild/platform/linux.mk @@ -208,11 +208,16 @@ gb_LinkTarget_CFLAGS := $(gb_CFLAGS) $(gb_CFLAGS_WERROR) $(gb_COMPILEROPTFLAGS) gb_LinkTarget_CXXFLAGS := $(gb_CXXFLAGS) $(gb_CXXFLAGS_WERROR) ifeq ($(gb_DEBUGLEVEL),2) -gb_LinkTarget_CXXFLAGS += -ggdb3 -finline-limit=0 -fno-inline -fno-default-inline -gb_LinkTarget_CFLAGS += -ggdb3 -finline-limit=0 -fno-inline -fno-default-inline +gb_LinkTarget_CXXFLAGS += -finline-limit=0 -fno-inline -fno-default-inline +gb_LinkTarget_CFLAGS += -finline-limit=0 -fno-inline -fno-default-inline endif +ifeq ($(gb_SYMBOL),$(true)) +gb_LinkTarget_CXXFLAGS += -ggdb3 +gb_LinkTarget_CFLAGS += -ggdb3 +endif + gb_LinkTarget_INCLUDE := $(filter-out %/stl, $(subst -I. , ,$(SOLARINC))) gb_LinkTarget_INCLUDE_STL := $(filter %/stl, $(subst -I. , ,$(SOLARINC))) diff --git a/solenv/gbuild/platform/macosx.mk b/solenv/gbuild/platform/macosx.mk index 9811e80c0..4d7031446 100755 --- a/solenv/gbuild/platform/macosx.mk +++ b/solenv/gbuild/platform/macosx.mk @@ -220,7 +220,7 @@ gb_LinkTarget_CFLAGS := $(gb_CFLAGS) $(gb_CFLAGS_WERROR) $(gb_COMPILEROPTFLAGS) gb_LinkTarget_CXXFLAGS := $(gb_CXXFLAGS) $(gb_CXXFLAGS_WERROR) gb_LinkTarget_OBJCXXFLAGS := $(gb_CXXFLAGS) $(gb_OBJCXXFLAGS) $(gb_COMPILEROPTFLAGS) -ifeq ($(gb_DEBUGLEVEL),2) +ifeq ($(gb_SYMBOL),$(true)) gb_LinkTarget_CFLAGS += -g gb_LinkTarget_CXXFLAGS += -g gb_LinkTarget_OBJCXXFLAGS += -g diff --git a/solenv/gbuild/platform/solaris.mk b/solenv/gbuild/platform/solaris.mk index 4f657a29d..6845384f2 100755 --- a/solenv/gbuild/platform/solaris.mk +++ b/solenv/gbuild/platform/solaris.mk @@ -181,7 +181,7 @@ gb_LinkTarget__RPATHS := \ gb_LinkTarget_CFLAGS := $(gb_CFLAGS) $(gb_CFLAGS_WERROR) $(gb_COMPILEROPTFLAGS) gb_LinkTarget_CXXFLAGS := $(gb_CXXFLAGS) $(gb_CXXFLAGS_WERROR) -ifeq ($(gb_DEBUGLEVEL),2) +ifeq ($(gb_SYMBOL),$(true)) gb_LinkTarget_CXXFLAGS += -g gb_LinkTarget_CFLAGS += -g endif diff --git a/solenv/gbuild/platform/windows.mk b/solenv/gbuild/platform/windows.mk index fe0904fc5..148a1daa1 100755 --- a/solenv/gbuild/platform/windows.mk +++ b/solenv/gbuild/platform/windows.mk @@ -199,9 +199,12 @@ gb_CFLAGS+=-Zi gb_CXXFLAGS+=-Zi endif -ifeq ($(gb_DEBUGLEVEL),2) +ifeq ($(gb_SYMBOL),$(true)) gb_CXXFLAGS +=-Zi gb_CFLAGS +=-Zi +endif + +ifeq ($(gb_DEBUGLEVEL),2) gb_COMPILEROPTFLAGS := gb_LinkTarget_LDFLAGS += -DEBUG else |