Skip to content

Commit fd01d06

Browse files
cphlipotacmel
authored andcommitted
tools lib subcmd: Respect WERROR=0 for build
this enables the workaround for compilers that generate warnings when compiling libsubcmd. Signed-off-by: Chris Phlipot <cphlipot0@gmail.com> Cc: Peter Zijlstra <peterz@infradead.org> Link: http://lkml.kernel.org/r/1467349955-1135-3-git-send-email-cphlipot0@gmail.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
1 parent b983d54 commit fd01d06

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

‎tools/lib/subcmd/Makefile‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,13 @@ MAKEFLAGS += --no-print-directory
1919
LIBFILE = $(OUTPUT)libsubcmd.a
2020

2121
CFLAGS := $(EXTRA_WARNINGS) $(EXTRA_CFLAGS)
22-
CFLAGS += -ggdb3 -Wall -Wextra -std=gnu99 -Werror -O6 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fPIC
22+
CFLAGS += -ggdb3 -Wall -Wextra -std=gnu99 -O6 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fPIC
23+
24+
# Treat warnings as errors unless directed not to
25+
ifneq ($(WERROR),0)
26+
CFLAGS += -Werror
27+
endif
28+
2329
CFLAGS += -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE
2430

2531
CFLAGS += -I$(srctree)/tools/include/

0 commit comments

Comments
 (0)