xref: /linux/tools/testing/selftests/arm64/fp/Makefile (revision 7255fcc80d4b525cc10cfaaf7f485830d4ed2000)
1# SPDX-License-Identifier: GPL-2.0
2
3# A proper top_srcdir is needed by KSFT(lib.mk)
4top_srcdir = $(realpath ../../../../../)
5
6CFLAGS += $(KHDR_INCLUDES)
7
8TEST_GEN_PROGS := \
9	fp-ptrace \
10	fp-stress \
11	sve-ptrace sve-probe-vls \
12	vec-syscfg \
13	za-fork za-ptrace
14TEST_GEN_PROGS_EXTENDED := fp-pidbench fpsimd-test \
15	rdvl-sme rdvl-sve \
16	sve-test \
17	ssve-test \
18	za-test \
19	zt-ptrace \
20	zt-test \
21	vlset
22TEST_PROGS_EXTENDED := fpsimd-stress sve-stress ssve-stress za-stress
23
24EXTRA_CLEAN += $(OUTPUT)/asm-utils.o $(OUTPUT)/rdvl.o $(OUTPUT)/za-fork-asm.o
25
26# Build with nolibc to avoid effects due to libc's clone() support
27$(OUTPUT)/fp-pidbench: fp-pidbench.S $(OUTPUT)/asm-utils.o
28	$(CC) -nostdlib $^ -o $@
29$(OUTPUT)/fp-ptrace: fp-ptrace.c fp-ptrace-asm.S
30$(OUTPUT)/fpsimd-test: fpsimd-test.S $(OUTPUT)/asm-utils.o
31	$(CC) -nostdlib $^ -o $@
32$(OUTPUT)/rdvl-sve: rdvl-sve.c $(OUTPUT)/rdvl.o
33$(OUTPUT)/rdvl-sme: rdvl-sme.c $(OUTPUT)/rdvl.o
34$(OUTPUT)/sve-ptrace: sve-ptrace.c
35$(OUTPUT)/sve-probe-vls: sve-probe-vls.c $(OUTPUT)/rdvl.o
36$(OUTPUT)/sve-test: sve-test.S $(OUTPUT)/asm-utils.o
37	$(CC) -nostdlib $^ -o $@
38$(OUTPUT)/ssve-test: sve-test.S $(OUTPUT)/asm-utils.o
39	$(CC) -DSSVE -nostdlib $^ -o $@
40$(OUTPUT)/vec-syscfg: vec-syscfg.c $(OUTPUT)/rdvl.o
41$(OUTPUT)/vlset: vlset.c
42$(OUTPUT)/za-fork: za-fork.c $(OUTPUT)/za-fork-asm.o
43	$(CC) -fno-asynchronous-unwind-tables -fno-ident -s -Os -nostdlib \
44		-include ../../../../include/nolibc/nolibc.h -I../..\
45		-static -ffreestanding -Wall $^ -o $@
46$(OUTPUT)/za-ptrace: za-ptrace.c
47$(OUTPUT)/za-test: za-test.S $(OUTPUT)/asm-utils.o
48	$(CC) -nostdlib $^ -o $@
49$(OUTPUT)/zt-ptrace: zt-ptrace.c
50$(OUTPUT)/zt-test: zt-test.S $(OUTPUT)/asm-utils.o
51	$(CC) -nostdlib $^ -o $@
52
53include ../../lib.mk
54