diff options
| author | Michael Ellerman <mpe@ellerman.id.au> | 2015-03-04 05:41:31 -0500 |
|---|---|---|
| committer | Shuah Khan <shuahkh@osg.samsung.com> | 2015-03-19 17:16:51 -0400 |
| commit | 84f887bfb930e7fbc01c060edd68c7cc6e2b824b (patch) | |
| tree | 4eee03c4146aa2174e4b90b4098c0875ecb08f26 /tools/testing/selftests | |
| parent | 6faeeea44b84ce24fc6c1f1beb07ee5de9885dc8 (diff) | |
selftests: Set CC using CROSS_COMPILE once in lib.mk
This avoids repeating the logic in every Makefile. We mimic the
top-level Makefile and use $(CROSS_COMPILE)gcc.
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
Diffstat (limited to 'tools/testing/selftests')
| -rw-r--r-- | tools/testing/selftests/efivarfs/Makefile | 1 | ||||
| -rw-r--r-- | tools/testing/selftests/exec/Makefile | 1 | ||||
| -rw-r--r-- | tools/testing/selftests/kcmp/Makefile | 1 | ||||
| -rw-r--r-- | tools/testing/selftests/lib.mk | 4 | ||||
| -rw-r--r-- | tools/testing/selftests/net/Makefile | 1 | ||||
| -rw-r--r-- | tools/testing/selftests/powerpc/Makefile | 3 | ||||
| -rw-r--r-- | tools/testing/selftests/size/Makefile | 2 | ||||
| -rw-r--r-- | tools/testing/selftests/vm/Makefile | 1 |
8 files changed, 5 insertions, 9 deletions
diff --git a/tools/testing/selftests/efivarfs/Makefile b/tools/testing/selftests/efivarfs/Makefile index 9ff04f154bd5..736c3ddfc787 100644 --- a/tools/testing/selftests/efivarfs/Makefile +++ b/tools/testing/selftests/efivarfs/Makefile | |||
| @@ -1,4 +1,3 @@ | |||
| 1 | CC = $(CROSS_COMPILE)gcc | ||
| 2 | CFLAGS = -Wall | 1 | CFLAGS = -Wall |
| 3 | 2 | ||
| 4 | test_objs = open-unlink create-read | 3 | test_objs = open-unlink create-read |
diff --git a/tools/testing/selftests/exec/Makefile b/tools/testing/selftests/exec/Makefile index 886cabe307b1..4edb7d0da29b 100644 --- a/tools/testing/selftests/exec/Makefile +++ b/tools/testing/selftests/exec/Makefile | |||
| @@ -1,4 +1,3 @@ | |||
| 1 | CC = $(CROSS_COMPILE)gcc | ||
| 2 | CFLAGS = -Wall | 1 | CFLAGS = -Wall |
| 3 | BINARIES = execveat | 2 | BINARIES = execveat |
| 4 | DEPS = execveat.symlink execveat.denatured script subdir | 3 | DEPS = execveat.symlink execveat.denatured script subdir |
diff --git a/tools/testing/selftests/kcmp/Makefile b/tools/testing/selftests/kcmp/Makefile index 0eecd183058c..2ae7450a9a89 100644 --- a/tools/testing/selftests/kcmp/Makefile +++ b/tools/testing/selftests/kcmp/Makefile | |||
| @@ -1,4 +1,3 @@ | |||
| 1 | CC := $(CROSS_COMPILE)$(CC) | ||
| 2 | CFLAGS += -I../../../../usr/include/ | 1 | CFLAGS += -I../../../../usr/include/ |
| 3 | 2 | ||
| 4 | all: kcmp_test | 3 | all: kcmp_test |
diff --git a/tools/testing/selftests/lib.mk b/tools/testing/selftests/lib.mk index 0baf7d32a67d..2194155ae62a 100644 --- a/tools/testing/selftests/lib.mk +++ b/tools/testing/selftests/lib.mk | |||
| @@ -1,3 +1,7 @@ | |||
| 1 | # This mimics the top-level Makefile. We do it explicitly here so that this | ||
| 2 | # Makefile can operate with or without the kbuild infrastructure. | ||
| 3 | CC := $(CROSS_COMPILE)gcc | ||
| 4 | |||
| 1 | define RUN_TESTS | 5 | define RUN_TESTS |
| 2 | @for TEST in $(TEST_PROGS); do \ | 6 | @for TEST in $(TEST_PROGS); do \ |
| 3 | (./$$TEST && echo "selftests: $$TEST [PASS]") || echo "selftests: $$TEST [FAIL]"; \ | 7 | (./$$TEST && echo "selftests: $$TEST [PASS]") || echo "selftests: $$TEST [FAIL]"; \ |
diff --git a/tools/testing/selftests/net/Makefile b/tools/testing/selftests/net/Makefile index 6ba2ac7bbb0d..fac4782c51d8 100644 --- a/tools/testing/selftests/net/Makefile +++ b/tools/testing/selftests/net/Makefile | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | # Makefile for net selftests | 1 | # Makefile for net selftests |
| 2 | 2 | ||
| 3 | CC = $(CROSS_COMPILE)gcc | ||
| 4 | CFLAGS = -Wall -O2 -g | 3 | CFLAGS = -Wall -O2 -g |
| 5 | 4 | ||
| 6 | CFLAGS += -I../../../../usr/include/ | 5 | CFLAGS += -I../../../../usr/include/ |
diff --git a/tools/testing/selftests/powerpc/Makefile b/tools/testing/selftests/powerpc/Makefile index 22c4f8ffa422..2958fe9a74e9 100644 --- a/tools/testing/selftests/powerpc/Makefile +++ b/tools/testing/selftests/powerpc/Makefile | |||
| @@ -8,10 +8,9 @@ ifeq ($(ARCH),powerpc) | |||
| 8 | 8 | ||
| 9 | GIT_VERSION = $(shell git describe --always --long --dirty || echo "unknown") | 9 | GIT_VERSION = $(shell git describe --always --long --dirty || echo "unknown") |
| 10 | 10 | ||
| 11 | CC := $(CROSS_COMPILE)$(CC) | ||
| 12 | CFLAGS := -Wall -O2 -flto -Wall -Werror -DGIT_VERSION='"$(GIT_VERSION)"' -I$(CURDIR) $(CFLAGS) | 11 | CFLAGS := -Wall -O2 -flto -Wall -Werror -DGIT_VERSION='"$(GIT_VERSION)"' -I$(CURDIR) $(CFLAGS) |
| 13 | 12 | ||
| 14 | export CC CFLAGS | 13 | export CFLAGS |
| 15 | 14 | ||
| 16 | TARGETS = pmu copyloops mm tm primitives stringloops | 15 | TARGETS = pmu copyloops mm tm primitives stringloops |
| 17 | 16 | ||
diff --git a/tools/testing/selftests/size/Makefile b/tools/testing/selftests/size/Makefile index e4353d74ea6e..bbd0b5398b61 100644 --- a/tools/testing/selftests/size/Makefile +++ b/tools/testing/selftests/size/Makefile | |||
| @@ -1,5 +1,3 @@ | |||
| 1 | CC = $(CROSS_COMPILE)gcc | ||
| 2 | |||
| 3 | all: get_size | 1 | all: get_size |
| 4 | 2 | ||
| 5 | get_size: get_size.c | 3 | get_size: get_size.c |
diff --git a/tools/testing/selftests/vm/Makefile b/tools/testing/selftests/vm/Makefile index 1a49761df6ed..a5ce9534eb15 100644 --- a/tools/testing/selftests/vm/Makefile +++ b/tools/testing/selftests/vm/Makefile | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | # Makefile for vm selftests | 1 | # Makefile for vm selftests |
| 2 | 2 | ||
| 3 | CC = $(CROSS_COMPILE)gcc | ||
| 4 | CFLAGS = -Wall | 3 | CFLAGS = -Wall |
| 5 | BINARIES = hugepage-mmap hugepage-shm map_hugetlb thuge-gen hugetlbfstest | 4 | BINARIES = hugepage-mmap hugepage-shm map_hugetlb thuge-gen hugetlbfstest |
| 6 | BINARIES += transhuge-stress | 5 | BINARIES += transhuge-stress |
