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