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