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)
7babf8a97SMark BrownTEST_GEN_PROGS := $(OUTPUT)/vdso_test_gettimeofday
829ee9239SShuah Khan (Samsung OSG)ifeq ($(ARCH),x86)
929ee9239SShuah Khan (Samsung OSG)TEST_GEN_PROGS += $(OUTPUT)/vdso_standalone_test_x86
1029ee9239SShuah Khan (Samsung OSG)endif
1129ee9239SShuah Khan (Samsung OSG)
12f9b6b0efSShuah Khanifndef CROSS_COMPILE
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
2170b574e7SDominik Brodowski$(OUTPUT)/vdso_standalone_test_x86: vdso_standalone_test_x86.c parse_vdso.c
22f9b6b0efSShuah Khan	$(CC) $(CFLAGS) $(CFLAGS_vdso_standalone_test_x86) \
23f9b6b0efSShuah Khan		vdso_standalone_test_x86.c parse_vdso.c \
2470b574e7SDominik Brodowski		-o $@
25f9b6b0efSShuah Khan
26f9b6b0efSShuah Khanendif
27