From c73f65e782f59b96bbabd66d91110e4a06e06d6e Mon Sep 17 00:00:00 2001 From: mitchell <70453897+667e-11@users.noreply.github.com> Date: Wed, 29 Oct 2014 09:47:51 -0400 Subject: Disable GCC optimizations when compiling with DEBUG=1; src/Makefile --- src/Makefile | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/Makefile b/src/Makefile index 9e7cf185..5124447d 100644 --- a/src/Makefile +++ b/src/Makefile @@ -94,12 +94,6 @@ else libluajit = luajit/src/libluajit.a endif -# No debugging unless DEBUG=1. -ifdef DEBUG - CFLAGS += -g - CXXFLAGS += -g -endif - # Scintilla. sci_flags = -pedantic -Os $(plat_flag) -DSCI_LEXER -DNDEBUG \ @@ -120,7 +114,7 @@ lexlpeg_objs = LexLPeg.o LexLPegjit.o LexLPeg-curses.o LexLPegjit-curses.o # Textadept. -ta_flags = -std=c99 -O -D_POSIX_C_SOURCE=200809L -D_DARWIN_C_SOURCE \ +ta_flags = -std=c99 -Os -D_POSIX_C_SOURCE=200809L -D_DARWIN_C_SOURCE \ $(plat_flag) -Iscintilla/include -Igtdialog -W -Wall \ -Wno-sign-compare -Wno-unused @@ -146,6 +140,14 @@ cdk_objs = binding.o buttonbox.o button.o cdk.o cdk_display.o cdk_objs.o \ itemlist.o label.o mentry.o menu.o popup_label.o position.o \ scroll.o scroller.o select_file.o selection.o traverse.o version.o +# Add debugging symbols and disable optimizations when DEBUG=1. +ifdef DEBUG + CFLAGS += -g + CXXFLAGS += -g + sci_flags += -O0 + ta_flags += -O0 +endif + # Build. all: textadept textadeptjit -- cgit v1.2.3