Merge tag 'amd-drm-next-5.9-2020-07-01' of git://people.freedesktop.org/~agd5f/linux...
[linux-2.6-microblaze.git] / tools / testing / selftests / vDSO / Makefile
1 # SPDX-License-Identifier: GPL-2.0
2 include ../lib.mk
3
4 uname_M := $(shell uname -m 2>/dev/null || echo not)
5 ARCH ?= $(shell echo $(uname_M) | sed -e s/i.86/x86/ -e s/x86_64/x86/)
6
7 TEST_GEN_PROGS := $(OUTPUT)/vdso_test_gettimeofday $(OUTPUT)/vdso_test_getcpu
8 ifeq ($(ARCH),x86)
9 TEST_GEN_PROGS += $(OUTPUT)/vdso_standalone_test_x86
10 endif
11
12 ifndef CROSS_COMPILE
13 CFLAGS := -std=gnu99
14 CFLAGS_vdso_standalone_test_x86 := -nostdlib -fno-asynchronous-unwind-tables -fno-stack-protector
15 ifeq ($(CONFIG_X86_32),y)
16 LDLIBS += -lgcc_s
17 endif
18
19 all: $(TEST_GEN_PROGS)
20 $(OUTPUT)/vdso_test_gettimeofday: parse_vdso.c vdso_test_gettimeofday.c
21 $(OUTPUT)/vdso_test_getcpu: parse_vdso.c vdso_test_getcpu.c
22 $(OUTPUT)/vdso_standalone_test_x86: vdso_standalone_test_x86.c parse_vdso.c
23         $(CC) $(CFLAGS) $(CFLAGS_vdso_standalone_test_x86) \
24                 vdso_standalone_test_x86.c parse_vdso.c \
25                 -o $@
26
27 endif