1b2441318SGreg Kroah-Hartman# SPDX-License-Identifier: GPL-2.0
229ee9239SShuah Khan (Samsung OSG)uname_M := $(shell uname -m 2>/dev/null || echo not)
329ee9239SShuah Khan (Samsung OSG)ARCH ?= $(shell echo $(uname_M) | sed -e s/i.86/x86/ -e s/x86_64/x86/)
429ee9239SShuah Khan (Samsung OSG)
5*bb2a605dSJohn HubbardTEST_GEN_PROGS := vdso_test_gettimeofday
6*bb2a605dSJohn HubbardTEST_GEN_PROGS += vdso_test_getcpu
7*bb2a605dSJohn HubbardTEST_GEN_PROGS += vdso_test_abi
8*bb2a605dSJohn HubbardTEST_GEN_PROGS += vdso_test_clock_getres
9c7e5789bSVincenzo Frascinoifeq ($(ARCH),$(filter $(ARCH),x86 x86_64))
10*bb2a605dSJohn HubbardTEST_GEN_PROGS += vdso_standalone_test_x86
1129ee9239SShuah Khan (Samsung OSG)endif
12*bb2a605dSJohn HubbardTEST_GEN_PROGS += vdso_test_correctness
1329ee9239SShuah Khan (Samsung OSG)
14f9b6b0efSShuah KhanCFLAGS := -std=gnu99
15f9b6b0efSShuah KhanCFLAGS_vdso_standalone_test_x86 := -nostdlib -fno-asynchronous-unwind-tables -fno-stack-protector
16c7e5789bSVincenzo FrascinoLDFLAGS_vdso_test_correctness := -ldl
17f9b6b0efSShuah Khanifeq ($(CONFIG_X86_32),y)
18f9b6b0efSShuah KhanLDLIBS += -lgcc_s
19f9b6b0efSShuah Khanendif
20f9b6b0efSShuah Khan
21*bb2a605dSJohn Hubbardinclude ../lib.mk
22babf8a97SMark Brown$(OUTPUT)/vdso_test_gettimeofday: parse_vdso.c vdso_test_gettimeofday.c
232e9a9725SMark Brown$(OUTPUT)/vdso_test_getcpu: parse_vdso.c vdso_test_getcpu.c
24693f5ca0SVincenzo Frascino$(OUTPUT)/vdso_test_abi: parse_vdso.c vdso_test_abi.c
2503f55c79SVincenzo Frascino$(OUTPUT)/vdso_test_clock_getres: vdso_test_clock_getres.c
2670b574e7SDominik Brodowski$(OUTPUT)/vdso_standalone_test_x86: vdso_standalone_test_x86.c parse_vdso.c
27f9b6b0efSShuah Khan	$(CC) $(CFLAGS) $(CFLAGS_vdso_standalone_test_x86) \
28f9b6b0efSShuah Khan		vdso_standalone_test_x86.c parse_vdso.c \
2970b574e7SDominik Brodowski		-o $@
30c7e5789bSVincenzo Frascino$(OUTPUT)/vdso_test_correctness: vdso_test_correctness.c
31c7e5789bSVincenzo Frascino	$(CC) $(CFLAGS) \
32c7e5789bSVincenzo Frascino		vdso_test_correctness.c \
33c7e5789bSVincenzo Frascino		-o $@ \
34c7e5789bSVincenzo Frascino		$(LDFLAGS_vdso_test_correctness)
35