1# SPDX-License-Identifier: GPL-2.0 2include ../lib.mk 3 4uname_M := $(shell uname -m 2>/dev/null || echo not) 5ARCH ?= $(shell echo $(uname_M) | sed -e s/i.86/x86/ -e s/x86_64/x86/) 6 7TEST_GEN_PROGS := $(OUTPUT)/vdso_test 8ifeq ($(ARCH),x86) 9TEST_GEN_PROGS += $(OUTPUT)/vdso_standalone_test_x86 10endif 11 12ifndef CROSS_COMPILE 13CFLAGS := -std=gnu99 14CFLAGS_vdso_standalone_test_x86 := -nostdlib -fno-asynchronous-unwind-tables -fno-stack-protector 15ifeq ($(CONFIG_X86_32),y) 16LDLIBS += -lgcc_s 17endif 18 19all: $(TEST_GEN_PROGS) 20$(OUTPUT)/vdso_test: parse_vdso.c vdso_test.c 21$(OUTPUT)/vdso_standalone_test_x86: vdso_standalone_test_x86.c parse_vdso.c 22 $(CC) $(CFLAGS) $(CFLAGS_vdso_standalone_test_x86) \ 23 vdso_standalone_test_x86.c parse_vdso.c \ 24 -o $@ 25 26endif 27