1e093256dSMark Brown# SPDX-License-Identifier: GPL-2.0
2e093256dSMark Brown
33a23a42dSMark Brown# A proper top_srcdir is needed by KSFT(lib.mk)
43a23a42dSMark Browntop_srcdir = $(realpath ../../../../../)
53a23a42dSMark Brown
67482c191SMathieu DesnoyersCFLAGS += $(KHDR_INCLUDES)
73a23a42dSMark Brown
8fd5c2c6fSMark BrownTEST_GEN_PROGS := fp-stress \
9fd5c2c6fSMark Brown	sve-ptrace sve-probe-vls \
10fd5c2c6fSMark Brown	vec-syscfg \
11fd5c2c6fSMark Brown	za-fork za-ptrace
12a59f7a7fSMark BrownTEST_GEN_PROGS_EXTENDED := fp-pidbench fpsimd-test \
13a0f2eb64SMark Brown	rdvl-sme rdvl-sve \
14a59f7a7fSMark Brown	sve-test \
15a59f7a7fSMark Brown	ssve-test \
16a59f7a7fSMark Brown	za-test \
174e1aa1a1SMark Brown	zt-ptrace \
181c07425eSMark Brown	zt-test \
1977108610SMark Brown	vlset
20a59f7a7fSMark BrownTEST_PROGS_EXTENDED := fpsimd-stress sve-stress ssve-stress za-stress
21e093256dSMark Brown
22399cf0a3SMark BrownEXTRA_CLEAN += $(OUTPUT)/asm-utils.o $(OUTPUT)/rdvl.o $(OUTPUT)/za-fork-asm.o
23399cf0a3SMark Brown
24212b0426SMark Brown# Build with nolibc to avoid effects due to libc's clone() support
25aca43ad5SMark Brown$(OUTPUT)/fp-pidbench: fp-pidbench.S $(OUTPUT)/asm-utils.o
262c94ebedSMark Brown	$(CC) -nostdlib $^ -o $@
27aca43ad5SMark Brown$(OUTPUT)/fpsimd-test: fpsimd-test.S $(OUTPUT)/asm-utils.o
28e093256dSMark Brown	$(CC) -nostdlib $^ -o $@
29aca43ad5SMark Brown$(OUTPUT)/rdvl-sve: rdvl-sve.c $(OUTPUT)/rdvl.o
30aca43ad5SMark Brown$(OUTPUT)/rdvl-sme: rdvl-sme.c $(OUTPUT)/rdvl.o
31aca43ad5SMark Brown$(OUTPUT)/sve-ptrace: sve-ptrace.c
32aca43ad5SMark Brown$(OUTPUT)/sve-probe-vls: sve-probe-vls.c $(OUTPUT)/rdvl.o
33aca43ad5SMark Brown$(OUTPUT)/sve-test: sve-test.S $(OUTPUT)/asm-utils.o
34e093256dSMark Brown	$(CC) -nostdlib $^ -o $@
35aca43ad5SMark Brown$(OUTPUT)/ssve-test: sve-test.S $(OUTPUT)/asm-utils.o
364126bde0SMark Brown	$(CC) -DSSVE -nostdlib $^ -o $@
37aca43ad5SMark Brown$(OUTPUT)/vec-syscfg: vec-syscfg.c $(OUTPUT)/rdvl.o
38aca43ad5SMark Brown$(OUTPUT)/vlset: vlset.c
39aca43ad5SMark Brown$(OUTPUT)/za-fork: za-fork.c $(OUTPUT)/za-fork-asm.o
40aca43ad5SMark Brown	$(CC) -fno-asynchronous-unwind-tables -fno-ident -s -Os -nostdlib \
41*266679ffSMark Brown		-include ../../../../include/nolibc/nolibc.h -I../..\
42aca43ad5SMark Brown		-static -ffreestanding -Wall $^ -o $@
43aca43ad5SMark Brown$(OUTPUT)/za-ptrace: za-ptrace.c
44aca43ad5SMark Brown$(OUTPUT)/za-test: za-test.S $(OUTPUT)/asm-utils.o
455aa45cc5SMark Brown	$(CC) -nostdlib $^ -o $@
464e1aa1a1SMark Brown$(OUTPUT)/zt-ptrace: zt-ptrace.c
471c07425eSMark Brown$(OUTPUT)/zt-test: zt-test.S $(OUTPUT)/asm-utils.o
481c07425eSMark Brown	$(CC) -nostdlib $^ -o $@
49e093256dSMark Brown
50e093256dSMark Browninclude ../../lib.mk
51