Skip to content

Commit d34bd9e

Browse files
author
orbea
committed
Allow building debugging symbols with DEBUG=1
1 parent 2f669cb commit d34bd9e

1 file changed

Lines changed: 8 additions & 13 deletions

File tree

Makefile

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
#
1010
###########################################################################
1111

12+
DEBUG=0
13+
1214
UNAME=$(shell uname -a)
1315

1416
ifeq ($(platform),)
@@ -460,17 +462,6 @@ endif
460462
# a native backend
461463
# FORCE_DRC_C_BACKEND = 1
462464

463-
#-------------------------------------------------
464-
# specify build options; see each option below
465-
# for details
466-
#-------------------------------------------------
467-
468-
469-
# specify optimization level or leave commented to use the default
470-
# (default is OPTIMIZE = 3 normally, or OPTIMIZE = 0 with symbols)
471-
OPTIMIZE = 3
472-
473-
474465
###########################################################################
475466
################## END USER-CONFIGURABLE OPTIONS ######################
476467
###########################################################################
@@ -559,10 +550,14 @@ COBJFLAGS += -x objective-c++
559550
CCOMFLAGS += -pipe
560551

561552
# add the optimization flag
562-
CCOMFLAGS += -O$(OPTIMIZE)
553+
ifeq ($(DEBUG), 1)
554+
CCOMFLAGS += -O0 -g
555+
else
556+
CCOMFLAGS += -O3
557+
endif
563558

564559
# if we are optimizing, include optimization options
565-
ifneq ($(OPTIMIZE),0)
560+
ifneq ($(DEBUG),1)
566561
CCOMFLAGS += -fno-strict-aliasing $(ARCHOPTS)
567562
endif
568563

0 commit comments

Comments
 (0)