Skip to content

Commit 84f887b

Browse files
mpeShuah Khan
authored andcommitted
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>
1 parent 6faeeea commit 84f887b

8 files changed

Lines changed: 5 additions & 9 deletions

File tree

‎tools/testing/selftests/efivarfs/Makefile‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
CC = $(CROSS_COMPILE)gcc
21
CFLAGS = -Wall
32

43
test_objs = open-unlink create-read

‎tools/testing/selftests/exec/Makefile‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
CC = $(CROSS_COMPILE)gcc
21
CFLAGS = -Wall
32
BINARIES = execveat
43
DEPS = execveat.symlink execveat.denatured script subdir

‎tools/testing/selftests/kcmp/Makefile‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
CC := $(CROSS_COMPILE)$(CC)
21
CFLAGS += -I../../../../usr/include/
32

43
all: kcmp_test

‎tools/testing/selftests/lib.mk‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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+
15
define RUN_TESTS
26
@for TEST in $(TEST_PROGS); do \
37
(./$$TEST && echo "selftests: $$TEST [PASS]") || echo "selftests: $$TEST [FAIL]"; \

‎tools/testing/selftests/net/Makefile‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
# Makefile for net selftests
22

3-
CC = $(CROSS_COMPILE)gcc
43
CFLAGS = -Wall -O2 -g
54

65
CFLAGS += -I../../../../usr/include/

‎tools/testing/selftests/powerpc/Makefile‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,9 @@ ifeq ($(ARCH),powerpc)
88

99
GIT_VERSION = $(shell git describe --always --long --dirty || echo "unknown")
1010

11-
CC := $(CROSS_COMPILE)$(CC)
1211
CFLAGS := -Wall -O2 -flto -Wall -Werror -DGIT_VERSION='"$(GIT_VERSION)"' -I$(CURDIR) $(CFLAGS)
1312

14-
export CC CFLAGS
13+
export CFLAGS
1514

1615
TARGETS = pmu copyloops mm tm primitives stringloops
1716

‎tools/testing/selftests/size/Makefile‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
CC = $(CROSS_COMPILE)gcc
2-
31
all: get_size
42

53
get_size: get_size.c

‎tools/testing/selftests/vm/Makefile‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
# Makefile for vm selftests
22

3-
CC = $(CROSS_COMPILE)gcc
43
CFLAGS = -Wall
54
BINARIES = hugepage-mmap hugepage-shm map_hugetlb thuge-gen hugetlbfstest
65
BINARIES += transhuge-stress

0 commit comments

Comments
 (0)