Merge tag 'sfi-removal-5.12-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git...
[platform/kernel/linux-rpi.git] / tools / testing / selftests / vDSO / Makefile
1 # SPDX-License-Identifier: GPL-2.0
2 include ../lib.mk
3
4 uname_M := $(shell uname -m 2>/dev/null || echo not)
5 ARCH ?= $(shell echo $(uname_M) | sed -e s/i.86/x86/ -e s/x86_64/x86/)
6
7 TEST_GEN_PROGS := $(OUTPUT)/vdso_test_gettimeofday $(OUTPUT)/vdso_test_getcpu
8 TEST_GEN_PROGS += $(OUTPUT)/vdso_test_abi
9 TEST_GEN_PROGS += $(OUTPUT)/vdso_test_clock_getres
10 ifeq ($(ARCH),$(filter $(ARCH),x86 x86_64))
11 TEST_GEN_PROGS += $(OUTPUT)/vdso_standalone_test_x86
12 endif
13 TEST_GEN_PROGS += $(OUTPUT)/vdso_test_correctness
14
15 CFLAGS := -std=gnu99
16 CFLAGS_vdso_standalone_test_x86 := -nostdlib -fno-asynchronous-unwind-tables -fno-stack-protector
17 LDFLAGS_vdso_test_correctness := -ldl
18 ifeq ($(CONFIG_X86_32),y)
19 LDLIBS += -lgcc_s
20 endif
21
22 all: $(TEST_GEN_PROGS)
23 $(OUTPUT)/vdso_test_gettimeofday: parse_vdso.c vdso_test_gettimeofday.c
24 $(OUTPUT)/vdso_test_getcpu: parse_vdso.c vdso_test_getcpu.c
25 $(OUTPUT)/vdso_test_abi: parse_vdso.c vdso_test_abi.c
26 $(OUTPUT)/vdso_test_clock_getres: vdso_test_clock_getres.c
27 $(OUTPUT)/vdso_standalone_test_x86: vdso_standalone_test_x86.c parse_vdso.c
28         $(CC) $(CFLAGS) $(CFLAGS_vdso_standalone_test_x86) \
29                 vdso_standalone_test_x86.c parse_vdso.c \
30                 -o $@
31 $(OUTPUT)/vdso_test_correctness: vdso_test_correctness.c
32         $(CC) $(CFLAGS) \
33                 vdso_test_correctness.c \
34                 -o $@ \
35                 $(LDFLAGS_vdso_test_correctness)