diff options
Diffstat (limited to 'tools/lib/subcmd/Makefile')
-rw-r--r-- | tools/lib/subcmd/Makefile | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/tools/lib/subcmd/Makefile b/tools/lib/subcmd/Makefile index ed61fb3a46c0..1c777a72bb39 100644 --- a/tools/lib/subcmd/Makefile +++ b/tools/lib/subcmd/Makefile @@ -19,10 +19,17 @@ MAKEFLAGS += --no-print-directory LIBFILE = $(OUTPUT)libsubcmd.a -CFLAGS := $(EXTRA_WARNINGS) $(EXTRA_CFLAGS) -CFLAGS += -ggdb3 -Wall -Wextra -std=gnu99 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fPIC +CFLAGS := -ggdb3 -Wall -Wextra -std=gnu99 -fPIC -ifeq ($(CC_NO_CLANG), 0) +ifeq ($(DEBUG),0) + ifeq ($(feature-fortify-source), 1) + CFLAGS += -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 + endif +endif + +ifeq ($(DEBUG),1) + CFLAGS += -O0 +else ifeq ($(CC_NO_CLANG), 0) CFLAGS += -O3 else CFLAGS += -O6 @@ -37,6 +44,8 @@ CFLAGS += -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE CFLAGS += -I$(srctree)/tools/include/ +CFLAGS += $(EXTRA_WARNINGS) $(EXTRA_CFLAGS) + SUBCMD_IN := $(OUTPUT)libsubcmd-in.o all: |