1b2441318SGreg Kroah-Hartman# SPDX-License-Identifier: GPL-2.0 267a121acSJason A. Donenfeldinclude ../../../scripts/Makefile.arch 329ee9239SShuah Khan (Samsung OSG) 4bb2a605dSJohn HubbardTEST_GEN_PROGS := vdso_test_gettimeofday 5bb2a605dSJohn HubbardTEST_GEN_PROGS += vdso_test_getcpu 6bb2a605dSJohn HubbardTEST_GEN_PROGS += vdso_test_abi 7bb2a605dSJohn HubbardTEST_GEN_PROGS += vdso_test_clock_getres 8c7e5789bSVincenzo Frascinoifeq ($(ARCH),$(filter $(ARCH),x86 x86_64)) 9bb2a605dSJohn HubbardTEST_GEN_PROGS += vdso_standalone_test_x86 1029ee9239SShuah Khan (Samsung OSG)endif 11bb2a605dSJohn HubbardTEST_GEN_PROGS += vdso_test_correctness 124920a259SJason A. DonenfeldTEST_GEN_PROGS += vdso_test_getrandom 133b5992eaSJason A. DonenfeldTEST_GEN_PROGS += vdso_test_chacha 1429ee9239SShuah Khan (Samsung OSG) 15*58265d64SThomas WeißschuhCFLAGS := -std=gnu99 -O2 -Wall -Wstrict-prototypes 1666cde337SJohn Hubbard 17f9b6b0efSShuah Khanifeq ($(CONFIG_X86_32),y) 18f9b6b0efSShuah KhanLDLIBS += -lgcc_s 19f9b6b0efSShuah Khanendif 20f9b6b0efSShuah Khan 21bb2a605dSJohn Hubbardinclude ../lib.mk 22c9fbaa87SThomas Weißschuh 23c9fbaa87SThomas WeißschuhCFLAGS += $(TOOLS_INCLUDES) 24c9fbaa87SThomas Weißschuh 258770a918SThomas WeißschuhCFLAGS_NOLIBC := -nostdlib -nostdinc -ffreestanding -fno-asynchronous-unwind-tables \ 268770a918SThomas Weißschuh -fno-stack-protector -include $(top_srcdir)/tools/include/nolibc/nolibc.h \ 278770a918SThomas Weißschuh -I$(top_srcdir)/tools/include/nolibc/ $(KHDR_INCLUDES) 288770a918SThomas Weißschuh 29babf8a97SMark Brown$(OUTPUT)/vdso_test_gettimeofday: parse_vdso.c vdso_test_gettimeofday.c 302e9a9725SMark Brown$(OUTPUT)/vdso_test_getcpu: parse_vdso.c vdso_test_getcpu.c 31693f5ca0SVincenzo Frascino$(OUTPUT)/vdso_test_abi: parse_vdso.c vdso_test_abi.c 3203f55c79SVincenzo Frascino$(OUTPUT)/vdso_test_clock_getres: vdso_test_clock_getres.c 3366cde337SJohn Hubbard 348770a918SThomas Weißschuh$(OUTPUT)/vdso_standalone_test_x86: vdso_standalone_test_x86.c parse_vdso.c | headers 358770a918SThomas Weißschuh$(OUTPUT)/vdso_standalone_test_x86: CFLAGS:=$(CFLAGS_NOLIBC) $(CFLAGS) 3666cde337SJohn Hubbard 37c7e5789bSVincenzo Frascino$(OUTPUT)/vdso_test_correctness: vdso_test_correctness.c 3866cde337SJohn Hubbard$(OUTPUT)/vdso_test_correctness: LDFLAGS += -ldl 394920a259SJason A. Donenfeld 404920a259SJason A. Donenfeld$(OUTPUT)/vdso_test_getrandom: parse_vdso.c 414920a259SJason A. Donenfeld$(OUTPUT)/vdso_test_getrandom: CFLAGS += -isystem $(top_srcdir)/tools/include \ 42b90eeff1SXi Ruoyao $(KHDR_INCLUDES) \ 434920a259SJason A. Donenfeld -isystem $(top_srcdir)/include/uapi 444920a259SJason A. Donenfeld 453b5992eaSJason A. Donenfeld$(OUTPUT)/vdso_test_chacha: vgetrandom-chacha.S 464920a259SJason A. Donenfeld$(OUTPUT)/vdso_test_chacha: CFLAGS += -idirafter $(top_srcdir)/tools/include \ 478bc7c5e5SJason A. Donenfeld -idirafter $(top_srcdir)/tools/include/generated \ 4867a121acSJason A. Donenfeld -idirafter $(top_srcdir)/arch/$(SRCARCH)/include \ 49f8d92fc5SChristophe Leroy -idirafter $(top_srcdir)/include \ 503b5992eaSJason A. Donenfeld -Wa,--noexecstack 51