1b2441318SGreg Kroah-Hartman# SPDX-License-Identifier: GPL-2.0
270b574e7SDominik Brodowskiinclude ../lib.mk
370b574e7SDominik Brodowski
429ee9239SShuah Khan (Samsung OSG)uname_M := $(shell uname -m 2>/dev/null || echo not)
529ee9239SShuah Khan (Samsung OSG)ARCH ?= $(shell echo $(uname_M) | sed -e s/i.86/x86/ -e s/x86_64/x86/)
629ee9239SShuah Khan (Samsung OSG)
72e9a9725SMark BrownTEST_GEN_PROGS := $(OUTPUT)/vdso_test_gettimeofday $(OUTPUT)/vdso_test_getcpu
8*693f5ca0SVincenzo FrascinoTEST_GEN_PROGS += $(OUTPUT)/vdso_test_abi
929ee9239SShuah Khan (Samsung OSG)ifeq ($(ARCH),x86)
1029ee9239SShuah Khan (Samsung OSG)TEST_GEN_PROGS += $(OUTPUT)/vdso_standalone_test_x86
1129ee9239SShuah Khan (Samsung OSG)endif
1229ee9239SShuah Khan (Samsung OSG)
13f9b6b0efSShuah KhanCFLAGS := -std=gnu99
14f9b6b0efSShuah KhanCFLAGS_vdso_standalone_test_x86 := -nostdlib -fno-asynchronous-unwind-tables -fno-stack-protector
15f9b6b0efSShuah Khanifeq ($(CONFIG_X86_32),y)
16f9b6b0efSShuah KhanLDLIBS += -lgcc_s
17f9b6b0efSShuah Khanendif
18f9b6b0efSShuah Khan
1929ee9239SShuah Khan (Samsung OSG)all: $(TEST_GEN_PROGS)
20babf8a97SMark Brown$(OUTPUT)/vdso_test_gettimeofday: parse_vdso.c vdso_test_gettimeofday.c
212e9a9725SMark Brown$(OUTPUT)/vdso_test_getcpu: parse_vdso.c vdso_test_getcpu.c
22*693f5ca0SVincenzo Frascino$(OUTPUT)/vdso_test_abi: parse_vdso.c vdso_test_abi.c
2370b574e7SDominik Brodowski$(OUTPUT)/vdso_standalone_test_x86: vdso_standalone_test_x86.c parse_vdso.c
24f9b6b0efSShuah Khan	$(CC) $(CFLAGS) $(CFLAGS_vdso_standalone_test_x86) \
25f9b6b0efSShuah Khan		vdso_standalone_test_x86.c parse_vdso.c \
2670b574e7SDominik Brodowski		-o $@
27f9b6b0efSShuah Khan
28