aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Ellerman <mpe@ellerman.id.au>2015-03-04 05:41:31 -0500
committerShuah Khan <shuahkh@osg.samsung.com>2015-03-19 17:16:51 -0400
commit84f887bfb930e7fbc01c060edd68c7cc6e2b824b (patch)
tree4eee03c4146aa2174e4b90b4098c0875ecb08f26
parent6faeeea44b84ce24fc6c1f1beb07ee5de9885dc8 (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>
-rw-r--r--tools/testing/selftests/efivarfs/Makefile1
-rw-r--r--tools/testing/selftests/exec/Makefile1
-rw-r--r--tools/testing/selftests/kcmp/Makefile1
-rw-r--r--tools/testing/selftests/lib.mk4
-rw-r--r--tools/testing/selftests/net/Makefile1
-rw-r--r--tools/testing/selftests/powerpc/Makefile3
-rw-r--r--tools/testing/selftests/size/Makefile2
-rw-r--r--tools/testing/selftests/vm/Makefile1
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 @@
1CC = $(CROSS_COMPILE)gcc
2CFLAGS = -Wall 1CFLAGS = -Wall
3 2
4test_objs = open-unlink create-read 3test_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 @@
1CC = $(CROSS_COMPILE)gcc
2CFLAGS = -Wall 1CFLAGS = -Wall
3BINARIES = execveat 2BINARIES = execveat
4DEPS = execveat.symlink execveat.denatured script subdir 3DEPS = 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 @@
1CC := $(CROSS_COMPILE)$(CC)
2CFLAGS += -I../../../../usr/include/ 1CFLAGS += -I../../../../usr/include/
3 2
4all: kcmp_test 3all: 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.
3CC := $(CROSS_COMPILE)gcc
4
1define RUN_TESTS 5define 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
3CC = $(CROSS_COMPILE)gcc
4CFLAGS = -Wall -O2 -g 3CFLAGS = -Wall -O2 -g
5 4
6CFLAGS += -I../../../../usr/include/ 5CFLAGS += -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
9GIT_VERSION = $(shell git describe --always --long --dirty || echo "unknown") 9GIT_VERSION = $(shell git describe --always --long --dirty || echo "unknown")
10 10
11CC := $(CROSS_COMPILE)$(CC)
12CFLAGS := -Wall -O2 -flto -Wall -Werror -DGIT_VERSION='"$(GIT_VERSION)"' -I$(CURDIR) $(CFLAGS) 11CFLAGS := -Wall -O2 -flto -Wall -Werror -DGIT_VERSION='"$(GIT_VERSION)"' -I$(CURDIR) $(CFLAGS)
13 12
14export CC CFLAGS 13export CFLAGS
15 14
16TARGETS = pmu copyloops mm tm primitives stringloops 15TARGETS = 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 @@
1CC = $(CROSS_COMPILE)gcc
2
3all: get_size 1all: get_size
4 2
5get_size: get_size.c 3get_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
3CC = $(CROSS_COMPILE)gcc
4CFLAGS = -Wall 3CFLAGS = -Wall
5BINARIES = hugepage-mmap hugepage-shm map_hugetlb thuge-gen hugetlbfstest 4BINARIES = hugepage-mmap hugepage-shm map_hugetlb thuge-gen hugetlbfstest
6BINARIES += transhuge-stress 5BINARIES += transhuge-stress