Debian Codegraph @

tools/testing/selftests/arm64/Makefile

raw
1 # SPDX-License-Identifier: GPL-2.0
2
3 # When ARCH not overridden for crosscompiling, lookup machine
4 ARCH ?= $(shell uname -m 2>/dev/null || echo not)
5
6 ifneq (,$(filter $(ARCH),aarch64 arm64))
7 ARM64_SUBTARGETS ?= tags signal pauth fp mte bti abi gcs
8 else
9 ARM64_SUBTARGETS :=
10 endif
11
12 CFLAGS := -Wall -O2 -g
13
14 # A proper top_srcdir is needed by KSFT(lib.mk)
15 top_srcdir = $(realpath ../../../../)
16
17 # Additional include paths needed by kselftest.h and local headers
18 CFLAGS += -I$(top_srcdir)/tools/testing/selftests/
19
20 CFLAGS += $(KHDR_INCLUDES)
21
22 CFLAGS += -I$(top_srcdir)/tools/include
23
24 OUTPUT ?= $(CURDIR)
25
26 export CFLAGS
27 export top_srcdir
28
29 all:
30 @for DIR in $(ARM64_SUBTARGETS); do \
31 BUILD_TARGET=$(OUTPUT)/$$DIR; \
32 mkdir -p $$BUILD_TARGET; \
33 make OUTPUT=$$BUILD_TARGET -C $$DIR $@ \
34 $(if $(FORCE_TARGETS),|| exit); \
35 done
36
37 install: all
38 @for DIR in $(ARM64_SUBTARGETS); do \
39 BUILD_TARGET=$(OUTPUT)/$$DIR; \
40 make OUTPUT=$$BUILD_TARGET -C $$DIR $@ \
41 $(if $(FORCE_TARGETS),|| exit); \
42 done
43
44 run_tests: all
45 @for DIR in $(ARM64_SUBTARGETS); do \
46 BUILD_TARGET=$(OUTPUT)/$$DIR; \
47 make OUTPUT=$$BUILD_TARGET -C $$DIR $@; \
48 done
49
50 # Avoid any output on non arm64 on emit_tests
51 emit_tests:
52 @for DIR in $(ARM64_SUBTARGETS); do \
53 BUILD_TARGET=$(OUTPUT)/$$DIR; \
54 make OUTPUT=$$BUILD_TARGET -C $$DIR $@; \
55 done
56
57 clean:
58 @for DIR in $(ARM64_SUBTARGETS); do \
59 BUILD_TARGET=$(OUTPUT)/$$DIR; \
60 make OUTPUT=$$BUILD_TARGET -C $$DIR $@; \
61 done
62
63 .PHONY: all clean install run_tests emit_tests