Back to home page

OSCL-LXR

 
 

    


0001 # SPDX-License-Identifier: GPL-2.0
0002 
0003 # When ARCH not overridden for crosscompiling, lookup machine
0004 ARCH ?= $(shell uname -m 2>/dev/null || echo not)
0005 
0006 ifneq (,$(filter $(ARCH),aarch64 arm64))
0007 ARM64_SUBTARGETS ?= tags signal pauth fp mte bti abi
0008 else
0009 ARM64_SUBTARGETS :=
0010 endif
0011 
0012 CFLAGS := -Wall -O2 -g
0013 
0014 # A proper top_srcdir is needed by KSFT(lib.mk)
0015 top_srcdir = $(realpath ../../../../)
0016 
0017 # Additional include paths needed by kselftest.h and local headers
0018 CFLAGS += -I$(top_srcdir)/tools/testing/selftests/
0019 
0020 CFLAGS += $(KHDR_INCLUDES)
0021 
0022 export CFLAGS
0023 export top_srcdir
0024 
0025 all:
0026         @for DIR in $(ARM64_SUBTARGETS); do                             \
0027                 BUILD_TARGET=$(OUTPUT)/$$DIR;                   \
0028                 mkdir -p $$BUILD_TARGET;                        \
0029                 make OUTPUT=$$BUILD_TARGET -C $$DIR $@;         \
0030         done
0031 
0032 install: all
0033         @for DIR in $(ARM64_SUBTARGETS); do                             \
0034                 BUILD_TARGET=$(OUTPUT)/$$DIR;                   \
0035                 make OUTPUT=$$BUILD_TARGET -C $$DIR $@;         \
0036         done
0037 
0038 run_tests: all
0039         @for DIR in $(ARM64_SUBTARGETS); do                             \
0040                 BUILD_TARGET=$(OUTPUT)/$$DIR;                   \
0041                 make OUTPUT=$$BUILD_TARGET -C $$DIR $@;         \
0042         done
0043 
0044 # Avoid any output on non arm64 on emit_tests
0045 emit_tests: all
0046         @for DIR in $(ARM64_SUBTARGETS); do                             \
0047                 BUILD_TARGET=$(OUTPUT)/$$DIR;                   \
0048                 make OUTPUT=$$BUILD_TARGET -C $$DIR $@;         \
0049         done
0050 
0051 clean:
0052         @for DIR in $(ARM64_SUBTARGETS); do                             \
0053                 BUILD_TARGET=$(OUTPUT)/$$DIR;                   \
0054                 make OUTPUT=$$BUILD_TARGET -C $$DIR $@;         \
0055         done
0056 
0057 .PHONY: all clean install run_tests emit_tests