xref: /linux/tools/testing/selftests/arm64/mte/Makefile (revision 4a423645bc2690376a7a94b4bb7b2f74bc6206ff)
1# SPDX-License-Identifier: GPL-2.0
2# Copyright (C) 2020 ARM Limited
3
4CFLAGS += -std=gnu99 -I. -lpthread
5SRCS := $(filter-out mte_common_util.c,$(wildcard *.c))
6PROGS := $(patsubst %.c,%,$(SRCS))
7
8#Add mte compiler option
9CFLAGS += -march=armv8.5-a+memtag
10
11#check if the compiler works well
12mte_cc_support := $(shell if ($(CC) $(CFLAGS) -E -x c /dev/null -o /dev/null 2>&1) then echo "1"; fi)
13
14ifeq ($(mte_cc_support),1)
15# Generated binaries to be installed by top KSFT script
16TEST_GEN_PROGS := $(PROGS)
17
18# Get Kernel headers installed and use them.
19KSFT_KHDR_INSTALL := 1
20endif
21
22# Include KSFT lib.mk.
23include ../../lib.mk
24
25ifeq ($(mte_cc_support),1)
26$(TEST_GEN_PROGS): mte_common_util.c mte_common_util.h mte_helper.S
27endif
28