1# SPDX-License-Identifier: GPL-2.0
2# Copyright (C) 2019 ARM Limited
3
4# Additional include paths needed by kselftest.h and local headers
5CFLAGS += -D_GNU_SOURCE -std=gnu99 -I.
6
7SRCS := $(filter-out testcases/testcases.c,$(wildcard testcases/*.c))
8PROGS := $(patsubst %.c,%,$(SRCS))
9
10# Generated binaries to be installed by top KSFT script
11TEST_GEN_PROGS := $(notdir $(PROGS))
12
13# Get Kernel headers installed and use them.
14KSFT_KHDR_INSTALL := 1
15
16# Including KSFT lib.mk here will also mangle the TEST_GEN_PROGS list
17# to account for any OUTPUT target-dirs optionally provided by
18# the toplevel makefile
19include ../../lib.mk
20
21$(TEST_GEN_PROGS): $(PROGS)
22	cp $(PROGS) $(OUTPUT)/
23
24clean:
25	$(CLEAN)
26	rm -f $(PROGS)
27
28# Common test-unit targets to build common-layout test-cases executables
29# Needs secondary expansion to properly include the testcase c-file in pre-reqs
30.SECONDEXPANSION:
31$(PROGS): test_signals.c test_signals_utils.c testcases/testcases.c signals.S $$@.c test_signals.h test_signals_utils.h testcases/testcases.h
32	$(CC) $(CFLAGS) $^ -o $@
33