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