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

Commit 66cde33

Browse files
johnhubbardshuahkh
authored andcommitted
selftests/vDSO: remove duplicate compiler invocations from Makefile
The Makefile open-codes compiler invocations that ../lib.mk already provides. Avoid this by using a Make feature that allows setting per-target variables, which in this case are: CFLAGS and LDFLAGS. This approach generates the exact same compiler invocations as before, but removes all of the code duplication, along with the quirky mangled variable names. So now the Makefile is smaller, less unusual, and easier to read. The new dependencies are listed after including lib.mk, in order to let lib.mk provide the first target ("all:"), and are grouped together with their respective source file dependencies, for visual clarity. Signed-off-by: John Hubbard <jhubbard@nvidia.com> Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
1 parent bb2a605 commit 66cde33

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed

tools/testing/selftests/vDSO/Makefile

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,7 @@ endif
1212
TEST_GEN_PROGS += vdso_test_correctness
1313

1414
CFLAGS := -std=gnu99
15-
CFLAGS_vdso_standalone_test_x86 := -nostdlib -fno-asynchronous-unwind-tables -fno-stack-protector
16-
LDFLAGS_vdso_test_correctness := -ldl
15+
1716
ifeq ($(CONFIG_X86_32),y)
1817
LDLIBS += -lgcc_s
1918
endif
@@ -23,12 +22,9 @@ $(OUTPUT)/vdso_test_gettimeofday: parse_vdso.c vdso_test_gettimeofday.c
2322
$(OUTPUT)/vdso_test_getcpu: parse_vdso.c vdso_test_getcpu.c
2423
$(OUTPUT)/vdso_test_abi: parse_vdso.c vdso_test_abi.c
2524
$(OUTPUT)/vdso_test_clock_getres: vdso_test_clock_getres.c
25+
2626
$(OUTPUT)/vdso_standalone_test_x86: vdso_standalone_test_x86.c parse_vdso.c
27-
$(CC) $(CFLAGS) $(CFLAGS_vdso_standalone_test_x86) \
28-
vdso_standalone_test_x86.c parse_vdso.c \
29-
-o $@
27+
$(OUTPUT)/vdso_standalone_test_x86: CFLAGS +=-nostdlib -fno-asynchronous-unwind-tables -fno-stack-protector
28+
3029
$(OUTPUT)/vdso_test_correctness: vdso_test_correctness.c
31-
$(CC) $(CFLAGS) \
32-
vdso_test_correctness.c \
33-
-o $@ \
34-
$(LDFLAGS_vdso_test_correctness)
30+
$(OUTPUT)/vdso_test_correctness: LDFLAGS += -ldl

0 commit comments

Comments
 (0)