19ce12630SAndrey Konovalov# SPDX-License-Identifier: GPL-2.0 29ce12630SAndrey Konovalov 3313a4db7SCristian Marussi# When ARCH not overridden for crosscompiling, lookup machine 49ce12630SAndrey KonovalovARCH ?= $(shell uname -m 2>/dev/null || echo not) 59ce12630SAndrey Konovalov 69ce12630SAndrey Konovalovifneq (,$(filter $(ARCH),aarch64 arm64)) 7*3d37d430SMark BrownARM64_SUBTARGETS ?= tags signal pauth fp mte bti abi gcs 8313a4db7SCristian Marussielse 9313a4db7SCristian MarussiARM64_SUBTARGETS := 109ce12630SAndrey Konovalovendif 119ce12630SAndrey Konovalov 12313a4db7SCristian MarussiCFLAGS := -Wall -O2 -g 13313a4db7SCristian Marussi 14313a4db7SCristian Marussi# A proper top_srcdir is needed by KSFT(lib.mk) 15313a4db7SCristian Marussitop_srcdir = $(realpath ../../../../) 16313a4db7SCristian Marussi 17313a4db7SCristian Marussi# Additional include paths needed by kselftest.h and local headers 18313a4db7SCristian MarussiCFLAGS += -I$(top_srcdir)/tools/testing/selftests/ 19313a4db7SCristian Marussi 20ae60e076SMark BrownCFLAGS += $(KHDR_INCLUDES) 21313a4db7SCristian Marussi 2235d7bc98SMark BrownCFLAGS += -I$(top_srcdir)/tools/include 2335d7bc98SMark Brown 24313a4db7SCristian Marussiexport CFLAGS 25313a4db7SCristian Marussiexport top_srcdir 26313a4db7SCristian Marussi 27313a4db7SCristian Marussiall: 28313a4db7SCristian Marussi @for DIR in $(ARM64_SUBTARGETS); do \ 29313a4db7SCristian Marussi BUILD_TARGET=$(OUTPUT)/$$DIR; \ 30313a4db7SCristian Marussi mkdir -p $$BUILD_TARGET; \ 31313a4db7SCristian Marussi make OUTPUT=$$BUILD_TARGET -C $$DIR $@; \ 32313a4db7SCristian Marussi done 33313a4db7SCristian Marussi 34313a4db7SCristian Marussiinstall: all 35313a4db7SCristian Marussi @for DIR in $(ARM64_SUBTARGETS); do \ 36313a4db7SCristian Marussi BUILD_TARGET=$(OUTPUT)/$$DIR; \ 37313a4db7SCristian Marussi make OUTPUT=$$BUILD_TARGET -C $$DIR $@; \ 38313a4db7SCristian Marussi done 39313a4db7SCristian Marussi 40313a4db7SCristian Marussirun_tests: all 41313a4db7SCristian Marussi @for DIR in $(ARM64_SUBTARGETS); do \ 42313a4db7SCristian Marussi BUILD_TARGET=$(OUTPUT)/$$DIR; \ 43313a4db7SCristian Marussi make OUTPUT=$$BUILD_TARGET -C $$DIR $@; \ 44313a4db7SCristian Marussi done 45313a4db7SCristian Marussi 46313a4db7SCristian Marussi# Avoid any output on non arm64 on emit_tests 47569f8b50SJohn Hubbardemit_tests: 48313a4db7SCristian Marussi @for DIR in $(ARM64_SUBTARGETS); do \ 49313a4db7SCristian Marussi BUILD_TARGET=$(OUTPUT)/$$DIR; \ 50313a4db7SCristian Marussi make OUTPUT=$$BUILD_TARGET -C $$DIR $@; \ 51313a4db7SCristian Marussi done 52313a4db7SCristian Marussi 53313a4db7SCristian Marussiclean: 54313a4db7SCristian Marussi @for DIR in $(ARM64_SUBTARGETS); do \ 55313a4db7SCristian Marussi BUILD_TARGET=$(OUTPUT)/$$DIR; \ 56313a4db7SCristian Marussi make OUTPUT=$$BUILD_TARGET -C $$DIR $@; \ 57313a4db7SCristian Marussi done 58313a4db7SCristian Marussi 59313a4db7SCristian Marussi.PHONY: all clean install run_tests emit_tests 60