diff --git a/Makefile b/Makefile index 358b236c..f196198c 100644 --- a/Makefile +++ b/Makefile @@ -55,6 +55,10 @@ DEBUG_CFLAGS_DEFAULT = -O0 -U_FORTIFY_SOURCE -ggdb3 DEBUG_CFLAGS_INTERNAL = DEBUG_CFLAGS := +DEBUG_LDFLAGS_DEFAULT = +DEBUG_LDFLAGS_INTERNAL = +DEBUG_LDFLAGS := + TOPDIR := $(shell pwd) # Common build flags @@ -72,7 +76,9 @@ CFLAGS = $(SUBST_CFLAGS) \ $(EXTRA_CFLAGS) LDFLAGS = $(SUBST_LDFLAGS) \ - -rdynamic -L$(TOPDIR) $(EXTRA_LDFLAGS) + -rdynamic -L$(TOPDIR) \ + $(DEBUG_LDFLAGS_INTERNAL) \ + $(EXTRA_LDFLAGS) LIBS = $(LIBS_BASE) LIBBTRFS_LIBS = $(LIBS_BASE) @@ -135,6 +141,7 @@ endif ifeq ("$(origin D)", "command line") DEBUG_CFLAGS_INTERNAL = $(DEBUG_CFLAGS_DEFAULT) $(DEBUG_CFLAGS) + DEBUG_LDFLAGS_INTERNAL = $(DEBUG_LDFLAGS_DEFAULT) $(DEBUG_LDFLAGS) endif ifneq (,$(findstring verbose,$(D)))