diff options
Diffstat (limited to 'tools/lib/api')
-rw-r--r-- | tools/lib/api/Makefile | 17 | ||||
-rw-r--r-- | tools/lib/api/cpu.c | 1 | ||||
-rw-r--r-- | tools/lib/api/cpu.h | 1 | ||||
-rw-r--r-- | tools/lib/api/debug-internal.h | 1 | ||||
-rw-r--r-- | tools/lib/api/debug.c | 1 | ||||
-rw-r--r-- | tools/lib/api/debug.h | 1 | ||||
-rw-r--r-- | tools/lib/api/fd/array.h | 1 | ||||
-rw-r--r-- | tools/lib/api/fs/fs.c | 1 | ||||
-rw-r--r-- | tools/lib/api/fs/fs.h | 1 | ||||
-rw-r--r-- | tools/lib/api/fs/tracing_path.c | 1 | ||||
-rw-r--r-- | tools/lib/api/fs/tracing_path.h | 1 |
11 files changed, 22 insertions, 5 deletions
diff --git a/tools/lib/api/Makefile b/tools/lib/api/Makefile index eb6e0b36bfc1..a13e9c7f1fc5 100644 --- a/tools/lib/api/Makefile +++ b/tools/lib/api/Makefile @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: GPL-2.0 include ../../scripts/Makefile.include include ../../scripts/utilities.mak # QUIET_CLEAN @@ -8,22 +9,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) diff --git a/tools/lib/api/cpu.c b/tools/lib/api/cpu.c index 8c6489356e3a..4af6d4b7aa07 100644 --- a/tools/lib/api/cpu.c +++ b/tools/lib/api/cpu.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 #include <stdio.h> #include "cpu.h" diff --git a/tools/lib/api/cpu.h b/tools/lib/api/cpu.h index 81e9d3955961..90a102fb20de 100644 --- a/tools/lib/api/cpu.h +++ b/tools/lib/api/cpu.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ #ifndef __API_CPU__ #define __API_CPU__ diff --git a/tools/lib/api/debug-internal.h b/tools/lib/api/debug-internal.h index 188f7880eafe..80c783497d25 100644 --- a/tools/lib/api/debug-internal.h +++ b/tools/lib/api/debug-internal.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ #ifndef __API_DEBUG_INTERNAL_H__ #define __API_DEBUG_INTERNAL_H__ diff --git a/tools/lib/api/debug.c b/tools/lib/api/debug.c index 5fa5cf500a1f..69b1ba3d1ee3 100644 --- a/tools/lib/api/debug.c +++ b/tools/lib/api/debug.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 #include <stdio.h> #include <stdarg.h> #include "debug.h" diff --git a/tools/lib/api/debug.h b/tools/lib/api/debug.h index a0872f68fc56..3684dd6e0c02 100644 --- a/tools/lib/api/debug.h +++ b/tools/lib/api/debug.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ #ifndef __API_DEBUG_H__ #define __API_DEBUG_H__ diff --git a/tools/lib/api/fd/array.h b/tools/lib/api/fd/array.h index 71287dddc05f..b39557d1a88f 100644 --- a/tools/lib/api/fd/array.h +++ b/tools/lib/api/fd/array.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ #ifndef __API_FD_ARRAY__ #define __API_FD_ARRAY__ diff --git a/tools/lib/api/fs/fs.c b/tools/lib/api/fs/fs.c index a7ecf8f469f4..b24afc0e6e81 100644 --- a/tools/lib/api/fs/fs.c +++ b/tools/lib/api/fs/fs.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 #include <ctype.h> #include <errno.h> #include <limits.h> diff --git a/tools/lib/api/fs/fs.h b/tools/lib/api/fs/fs.h index 45605348461e..dda49deefb52 100644 --- a/tools/lib/api/fs/fs.h +++ b/tools/lib/api/fs/fs.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ #ifndef __API_FS__ #define __API_FS__ diff --git a/tools/lib/api/fs/tracing_path.c b/tools/lib/api/fs/tracing_path.c index 3e606b9c443e..7b7fd0b18551 100644 --- a/tools/lib/api/fs/tracing_path.c +++ b/tools/lib/api/fs/tracing_path.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 #ifndef _GNU_SOURCE # define _GNU_SOURCE #endif diff --git a/tools/lib/api/fs/tracing_path.h b/tools/lib/api/fs/tracing_path.h index 3f233ac70b6f..0066f06cc381 100644 --- a/tools/lib/api/fs/tracing_path.h +++ b/tools/lib/api/fs/tracing_path.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ #ifndef __API_FS_TRACING_PATH_H #define __API_FS_TRACING_PATH_H |