Skip to content

Commit 4626f9b

Browse files
committed
Makefile improvement (debug-build support)
Signed-off-by: Vadim A. Misbakh-Soloviov <mva@mva.name>
1 parent af03240 commit 4626f9b

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

Makefile

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,17 +36,21 @@ OS_FLAGS ?= -bundle -undefined dynamic_lookup
3636
MAC_ENV ?= env MACOSX_DEPLOYMENT_TARGET='10.3'
3737
endif
3838

39+
ifeq ($(DEBUG),)
40+
DBG = -ggdb
41+
endif
42+
3943
ifeq ($(DEV),)
40-
WARN= -Wall -Wno-unused-value
44+
WARN = -Wall -Wno-unused-value
4145
else
42-
WARN= -Wall -W -Waggregate-return -Wcast-align -Wmissing-prototypes -Wnested-externs -Wshadow -Wwrite-strings -pedantic
46+
WARN = -Wall -W -Waggregate-return -Wcast-align -Wmissing-prototypes -Wnested-externs -Wshadow -Wwrite-strings -pedantic
4347
endif
4448

4549
INCLUDES = -I$(LUA_INC)
4650
DEFINES =
4751
LIBS = -lrt -ldl $(CURL_LIBS)
4852

49-
COMMONFLAGS = -O2 -g -pipe -fPIC $(OS_FLAGS)
53+
COMMONFLAGS = -O2 -g -pipe -fPIC $(OS_FLAGS) $(DBG)
5054
LF = $(LIBS) $(LDFLAGS)
5155
CF = $(INCLUDES) $(DEFINES) $(COMMONFLAGS) $(WARN) -DPTHREADS $(CFLAGS)
5256

0 commit comments

Comments
 (0)