1 # SPDX-License-Identifier: GPL-2.0
2 # Copyright (C) 2020 ARM Limited
4 CFLAGS += -std=gnu99 -I.
5 SRCS := $(filter-out mte_common_util.c,$(wildcard *.c))
6 PROGS := $(patsubst %.c,%,$(SRCS))
8 #Add mte compiler option
9 ifneq ($(shell $(CC) --version 2>&1 | head -n 1 | grep gcc),)
10 CFLAGS += -march=armv8.5-a+memtag
13 #check if the compiler works well
14 mte_cc_support := $(shell if ($(CC) $(CFLAGS) -E -x c /dev/null -o /dev/null 2>&1) then echo "1"; fi)
16 ifeq ($(mte_cc_support),1)
17 # Generated binaries to be installed by top KSFT script
18 TEST_GEN_PROGS := $(PROGS)
20 # Get Kernel headers installed and use them.
21 KSFT_KHDR_INSTALL := 1
24 # Include KSFT lib.mk.
27 ifeq ($(mte_cc_support),1)
28 $(TEST_GEN_PROGS): mte_common_util.c mte_common_util.h mte_helper.S