treewide: remove redundant IS_ERR() before error code check
[linux/fpc-iii.git] / tools / testing / selftests / arm64 / Makefile
blob93b567d23c8b2ed6343f73a8f5e531374e680c91
1 # SPDX-License-Identifier: GPL-2.0
3 # When ARCH not overridden for crosscompiling, lookup machine
4 ARCH ?= $(shell uname -m 2>/dev/null || echo not)
6 ifneq (,$(filter $(ARCH),aarch64 arm64))
7 ARM64_SUBTARGETS ?= tags signal
8 else
9 ARM64_SUBTARGETS :=
10 endif
12 CFLAGS := -Wall -O2 -g
14 # A proper top_srcdir is needed by KSFT(lib.mk)
15 top_srcdir = $(realpath ../../../../)
17 # Additional include paths needed by kselftest.h and local headers
18 CFLAGS += -I$(top_srcdir)/tools/testing/selftests/
20 # Guessing where the Kernel headers could have been installed
21 # depending on ENV config
22 ifeq ($(KBUILD_OUTPUT),)
23 khdr_dir = $(top_srcdir)/usr/include
24 else
25 # the KSFT preferred location when KBUILD_OUTPUT is set
26 khdr_dir = $(KBUILD_OUTPUT)/kselftest/usr/include
27 endif
29 CFLAGS += -I$(khdr_dir)
31 export CFLAGS
32 export top_srcdir
34 all:
35 @for DIR in $(ARM64_SUBTARGETS); do \
36 BUILD_TARGET=$(OUTPUT)/$$DIR; \
37 mkdir -p $$BUILD_TARGET; \
38 make OUTPUT=$$BUILD_TARGET -C $$DIR $@; \
39 done
41 install: all
42 @for DIR in $(ARM64_SUBTARGETS); do \
43 BUILD_TARGET=$(OUTPUT)/$$DIR; \
44 make OUTPUT=$$BUILD_TARGET -C $$DIR $@; \
45 done
47 run_tests: all
48 @for DIR in $(ARM64_SUBTARGETS); do \
49 BUILD_TARGET=$(OUTPUT)/$$DIR; \
50 make OUTPUT=$$BUILD_TARGET -C $$DIR $@; \
51 done
53 # Avoid any output on non arm64 on emit_tests
54 emit_tests: all
55 @for DIR in $(ARM64_SUBTARGETS); do \
56 BUILD_TARGET=$(OUTPUT)/$$DIR; \
57 make OUTPUT=$$BUILD_TARGET -C $$DIR $@; \
58 done
60 clean:
61 @for DIR in $(ARM64_SUBTARGETS); do \
62 BUILD_TARGET=$(OUTPUT)/$$DIR; \
63 make OUTPUT=$$BUILD_TARGET -C $$DIR $@; \
64 done
66 .PHONY: all clean install run_tests emit_tests