summaryrefslogtreecommitdiffstats
path: root/tools/lib/api/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'tools/lib/api/Makefile')
-rw-r--r--tools/lib/api/Makefile16
1 files changed, 11 insertions, 5 deletions
diff --git a/tools/lib/api/Makefile b/tools/lib/api/Makefile
index eb6e0b3..1e83e3c 100644
--- a/tools/lib/api/Makefile
+++ b/tools/lib/api/Makefile
@@ -8,22 +8,28 @@ srctree := $(patsubst %/,%,$(dir $(srctree)))
#$(info Determined 'srctree' to be $(srctree))
endif
-CC = $(CROSS_COMPILE)gcc
-AR = $(CROSS_COMPILE)ar
-LD = $(CROSS_COMPILE)ld
+CC ?= $(CROSS_COMPILE)gcc
+AR ?= $(CROSS_COMPILE)ar
+LD ?= $(CROSS_COMPILE)ld
MAKEFLAGS += --no-print-directory
LIBFILE = $(OUTPUT)libapi.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 -U_FORTIFY_SOURCE -fPIC
-ifeq ($(CC), clang)
+ifeq ($(DEBUG),0)
+ifeq ($(CC_NO_CLANG), 0)
CFLAGS += -O3
else
CFLAGS += -O6
endif
+endif
+
+ifeq ($(DEBUG),0)
+ CFLAGS += -D_FORTIFY_SOURCE
+endif
# Treat warnings as errors unless directed not to
ifneq ($(WERROR),0)
OpenPOWER on IntegriCloud