Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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>

authored by

John Hubbard and committed by
Shuah Khan
66cde337 bb2a605d

+5 -9
+5 -9
tools/testing/selftests/vDSO/Makefile
··· 12 12 TEST_GEN_PROGS += vdso_test_correctness 13 13 14 14 CFLAGS := -std=gnu99 15 - CFLAGS_vdso_standalone_test_x86 := -nostdlib -fno-asynchronous-unwind-tables -fno-stack-protector 16 - LDFLAGS_vdso_test_correctness := -ldl 15 + 17 16 ifeq ($(CONFIG_X86_32),y) 18 17 LDLIBS += -lgcc_s 19 18 endif ··· 22 23 $(OUTPUT)/vdso_test_getcpu: parse_vdso.c vdso_test_getcpu.c 23 24 $(OUTPUT)/vdso_test_abi: parse_vdso.c vdso_test_abi.c 24 25 $(OUTPUT)/vdso_test_clock_getres: vdso_test_clock_getres.c 26 + 25 27 $(OUTPUT)/vdso_standalone_test_x86: vdso_standalone_test_x86.c parse_vdso.c 26 - $(CC) $(CFLAGS) $(CFLAGS_vdso_standalone_test_x86) \ 27 - vdso_standalone_test_x86.c parse_vdso.c \ 28 - -o $@ 28 + $(OUTPUT)/vdso_standalone_test_x86: CFLAGS +=-nostdlib -fno-asynchronous-unwind-tables -fno-stack-protector 29 + 29 30 $(OUTPUT)/vdso_test_correctness: vdso_test_correctness.c 30 - $(CC) $(CFLAGS) \ 31 - vdso_test_correctness.c \ 32 - -o $@ \ 33 - $(LDFLAGS_vdso_test_correctness) 31 + $(OUTPUT)/vdso_test_correctness: LDFLAGS += -ldl