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>
This commit is contained in:
Michael Ellerman 2015-03-04 21:41:31 +11:00 committed by Shuah Khan
parent 6faeeea44b
commit 84f887bfb9
8 changed files with 5 additions and 9 deletions

View File

@ -1,4 +1,3 @@
CC = $(CROSS_COMPILE)gcc
CFLAGS = -Wall CFLAGS = -Wall
test_objs = open-unlink create-read test_objs = open-unlink create-read

View File

@ -1,4 +1,3 @@
CC = $(CROSS_COMPILE)gcc
CFLAGS = -Wall CFLAGS = -Wall
BINARIES = execveat BINARIES = execveat
DEPS = execveat.symlink execveat.denatured script subdir DEPS = execveat.symlink execveat.denatured script subdir

View File

@ -1,4 +1,3 @@
CC := $(CROSS_COMPILE)$(CC)
CFLAGS += -I../../../../usr/include/ CFLAGS += -I../../../../usr/include/
all: kcmp_test all: kcmp_test

View File

@ -1,3 +1,7 @@
# This mimics the top-level Makefile. We do it explicitly here so that this
# Makefile can operate with or without the kbuild infrastructure.
CC := $(CROSS_COMPILE)gcc
define RUN_TESTS define RUN_TESTS
@for TEST in $(TEST_PROGS); do \ @for TEST in $(TEST_PROGS); do \
(./$$TEST && echo "selftests: $$TEST [PASS]") || echo "selftests: $$TEST [FAIL]"; \ (./$$TEST && echo "selftests: $$TEST [PASS]") || echo "selftests: $$TEST [FAIL]"; \

View File

@ -1,6 +1,5 @@
# Makefile for net selftests # Makefile for net selftests
CC = $(CROSS_COMPILE)gcc
CFLAGS = -Wall -O2 -g CFLAGS = -Wall -O2 -g
CFLAGS += -I../../../../usr/include/ CFLAGS += -I../../../../usr/include/

View File

@ -8,10 +8,9 @@ ifeq ($(ARCH),powerpc)
GIT_VERSION = $(shell git describe --always --long --dirty || echo "unknown") GIT_VERSION = $(shell git describe --always --long --dirty || echo "unknown")
CC := $(CROSS_COMPILE)$(CC)
CFLAGS := -Wall -O2 -flto -Wall -Werror -DGIT_VERSION='"$(GIT_VERSION)"' -I$(CURDIR) $(CFLAGS) CFLAGS := -Wall -O2 -flto -Wall -Werror -DGIT_VERSION='"$(GIT_VERSION)"' -I$(CURDIR) $(CFLAGS)
export CC CFLAGS export CFLAGS
TARGETS = pmu copyloops mm tm primitives stringloops TARGETS = pmu copyloops mm tm primitives stringloops

View File

@ -1,5 +1,3 @@
CC = $(CROSS_COMPILE)gcc
all: get_size all: get_size
get_size: get_size.c get_size: get_size.c

View File

@ -1,6 +1,5 @@
# Makefile for vm selftests # Makefile for vm selftests
CC = $(CROSS_COMPILE)gcc
CFLAGS = -Wall CFLAGS = -Wall
BINARIES = hugepage-mmap hugepage-shm map_hugetlb thuge-gen hugetlbfstest BINARIES = hugepage-mmap hugepage-shm map_hugetlb thuge-gen hugetlbfstest
BINARIES += transhuge-stress BINARIES += transhuge-stress