Skip to content

Commit

Permalink
Make debug cflags configurable like via Makefile.local
Browse files Browse the repository at this point in the history
  • Loading branch information
Thilo Schulz committed Nov 3, 2009
1 parent f5d79ea commit c90eae4
Showing 1 changed file with 13 additions and 9 deletions.
22 changes: 13 additions & 9 deletions Makefile
Expand Up @@ -151,6 +151,10 @@ ifndef USE_LOCAL_HEADERS
USE_LOCAL_HEADERS=1
endif

ifndef USE_DEBUG_CFLAGS
USE_DEBUG_CFLAGS=-g -O0
endif

#############################################################################

BD=$(BUILD_DIR)/debug-$(PLATFORM)-$(ARCH)
Expand Down Expand Up @@ -350,7 +354,7 @@ ifeq ($(PLATFORM),linux)
endif
endif

DEBUG_CFLAGS = $(BASE_CFLAGS) -g -O0
DEBUG_CFLAGS = $(BASE_CFLAGS) $(USE_DEBUG_CFLAGS)
RELEASE_CFLAGS=$(BASE_CFLAGS) -DNDEBUG $(OPTIMIZE)

else # ifeq Linux
Expand Down Expand Up @@ -424,7 +428,7 @@ ifeq ($(PLATFORM),darwin)
BASE_CFLAGS += -DNO_VM_COMPILED
endif

DEBUG_CFLAGS = $(BASE_CFLAGS) -g -O0
DEBUG_CFLAGS = $(BASE_CFLAGS) $(USE_DEBUG_CFLAGS)

RELEASE_CFLAGS=$(BASE_CFLAGS) -DNDEBUG $(OPTIMIZE)

Expand Down Expand Up @@ -517,7 +521,7 @@ ifeq ($(PLATFORM),mingw32)
BASE_CFLAGS += -m32
endif

DEBUG_CFLAGS=$(BASE_CFLAGS) -g -O0
DEBUG_CFLAGS=$(BASE_CFLAGS) $(USE_DEBUG_CFLAGS)
RELEASE_CFLAGS=$(BASE_CFLAGS) -DNDEBUG $(OPTIMIZE)

# libmingw32 must be linked before libSDLmain
Expand Down Expand Up @@ -580,7 +584,7 @@ ifeq ($(PLATFORM),freebsd)
endif
endif

DEBUG_CFLAGS=$(BASE_CFLAGS) -g
DEBUG_CFLAGS=$(BASE_CFLAGS) $(USE_DEBUG_CFLAGS)

SHLIBEXT=so
SHLIBCFLAGS=-fPIC
Expand Down Expand Up @@ -639,7 +643,7 @@ ifeq ($(PLATFORM),openbsd)
RELEASE_CFLAGS=$(BASE_CFLAGS) -DNDEBUG
HAVE_VM_COMPILED=false

DEBUG_CFLAGS=$(BASE_CFLAGS) -g
DEBUG_CFLAGS=$(BASE_CFLAGS) $(USE_DEBUG_CFLAGS)

SHLIBEXT=so
SHLIBNAME=.$(SHLIBEXT)
Expand Down Expand Up @@ -693,7 +697,7 @@ ifeq ($(PLATFORM),netbsd)
BASE_CFLAGS += -DNO_VM_COMPILED
endif

DEBUG_CFLAGS=$(BASE_CFLAGS) -g
DEBUG_CFLAGS=$(BASE_CFLAGS) $(USE_DEBUG_CFLAGS)

BUILD_CLIENT = 0
BUILD_GAME_QVM = 0
Expand All @@ -714,7 +718,7 @@ ifeq ($(PLATFORM),irix64)
BASE_CFLAGS=-Dstricmp=strcasecmp -Xcpluscomm -woff 1185 \
-I. $(SDL_CFLAGS) -I$(ROOT)/usr/include -DNO_VM_COMPILED
RELEASE_CFLAGS=$(BASE_CFLAGS) -O3
DEBUG_CFLAGS=$(BASE_CFLAGS) -g
DEBUG_CFLAGS=$(BASE_CFLAGS) $(USE_DEBUG_CFLAGS)

SHLIBEXT=so
SHLIBCFLAGS=
Expand Down Expand Up @@ -777,7 +781,7 @@ ifeq ($(PLATFORM),sunos)
BASE_CFLAGS += -DNO_VM_COMPILED
endif

DEBUG_CFLAGS = $(BASE_CFLAGS) -ggdb -O0
DEBUG_CFLAGS = $(BASE_CFLAGS) $(USE_DEBUG_CFLAGS)

RELEASE_CFLAGS=$(BASE_CFLAGS) -DNDEBUG $(OPTIMIZE)

Expand All @@ -798,7 +802,7 @@ else # ifeq sunos
# SETUP AND BUILD -- GENERIC
#############################################################################
BASE_CFLAGS=-DNO_VM_COMPILED
DEBUG_CFLAGS=$(BASE_CFLAGS) -g
DEBUG_CFLAGS=$(BASE_CFLAGS) $(USE_DEBUG_CFLAGS)
RELEASE_CFLAGS=$(BASE_CFLAGS) -DNDEBUG -O3

SHLIBEXT=so
Expand Down

0 comments on commit c90eae4

Please sign in to comment.