Skip to content
This repository was archived by the owner on Nov 8, 2023. It is now read-only.

Commit bb2a605

Browse files
johnhubbardshuahkh
authored andcommitted
selftests/vDSO: remove partially duplicated "all:" target in Makefile
There were a couple of errors here: 1. TEST_GEN_PROGS was incorrectly prepending $(OUTPUT) to each program to be built. However, lib.mk already does that because it assumes "bare" program names are passed in, so this ended up creating $(OUTPUT)/$(OUTPUT)/file.c, which of course won't work as intended. 2. lib.mk was included before TEST_GEN_PROGS was set, which led to lib.mk's "all:" target not seeing anything to rebuild. So nothing worked, which caused the author to force things by creating an "all:" target locally--while still including ../lib.mk. Fix all of this by including ../lib.mk at the right place, and removing the $(OUTPUT) prefix to the programs to be built, and removing the duplicate "all:" target. Reviewed-by: Muhammad Usama Anjum <usama.anjum@collabora.com> Signed-off-by: John Hubbard <jhubbard@nvidia.com> Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
1 parent 73810cd commit bb2a605

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

tools/testing/selftests/vDSO/Makefile

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,15 @@
11
# SPDX-License-Identifier: GPL-2.0
2-
include ../lib.mk
3-
42
uname_M := $(shell uname -m 2>/dev/null || echo not)
53
ARCH ?= $(shell echo $(uname_M) | sed -e s/i.86/x86/ -e s/x86_64/x86/)
64

7-
TEST_GEN_PROGS := $(OUTPUT)/vdso_test_gettimeofday $(OUTPUT)/vdso_test_getcpu
8-
TEST_GEN_PROGS += $(OUTPUT)/vdso_test_abi
9-
TEST_GEN_PROGS += $(OUTPUT)/vdso_test_clock_getres
5+
TEST_GEN_PROGS := vdso_test_gettimeofday
6+
TEST_GEN_PROGS += vdso_test_getcpu
7+
TEST_GEN_PROGS += vdso_test_abi
8+
TEST_GEN_PROGS += vdso_test_clock_getres
109
ifeq ($(ARCH),$(filter $(ARCH),x86 x86_64))
11-
TEST_GEN_PROGS += $(OUTPUT)/vdso_standalone_test_x86
10+
TEST_GEN_PROGS += vdso_standalone_test_x86
1211
endif
13-
TEST_GEN_PROGS += $(OUTPUT)/vdso_test_correctness
12+
TEST_GEN_PROGS += vdso_test_correctness
1413

1514
CFLAGS := -std=gnu99
1615
CFLAGS_vdso_standalone_test_x86 := -nostdlib -fno-asynchronous-unwind-tables -fno-stack-protector
@@ -19,7 +18,7 @@ ifeq ($(CONFIG_X86_32),y)
1918
LDLIBS += -lgcc_s
2019
endif
2120

22-
all: $(TEST_GEN_PROGS)
21+
include ../lib.mk
2322
$(OUTPUT)/vdso_test_gettimeofday: parse_vdso.c vdso_test_gettimeofday.c
2423
$(OUTPUT)/vdso_test_getcpu: parse_vdso.c vdso_test_getcpu.c
2524
$(OUTPUT)/vdso_test_abi: parse_vdso.c vdso_test_abi.c

0 commit comments

Comments
 (0)