Files
linux/tools/testing/selftests/alsa/Makefile
T
Jaroslav Kysela b310092e3e selftests: alsa - move shared library configuration code to conf.c
The minimal alsa-lib configuration code is similar in both mixer
and pcm tests. Move this code to the shared conf.c source file.

Also, fix the build rules inspired by rseq tests. Build libatest.so
which is linked to the both test utilities dynamically.

Also, set the TEST_FILES variable for lib.mk.

Cc: [email protected]
Cc: Shuah Khan <[email protected]>
Reported-by: Mark Brown <[email protected]>
Signed-off-by: Jaroslav Kysela <[email protected]>
Tested-by: Mark Brown <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Takashi Iwai <[email protected]>
2022-11-29 15:05:18 +01:00

26 lines
541 B
Makefile

# SPDX-License-Identifier: GPL-2.0
#
CFLAGS += $(shell pkg-config --cflags alsa)
LDLIBS += $(shell pkg-config --libs alsa)
ifeq ($(LDLIBS),)
LDLIBS += -lasound
endif
CFLAGS += -L$(OUTPUT) -Wl,-rpath=./
OVERRIDE_TARGETS = 1
TEST_GEN_PROGS := mixer-test pcm-test
TEST_GEN_PROGS_EXTENDED := libatest.so
TEST_FILES := conf.d
include ../lib.mk
$(OUTPUT)/libatest.so: conf.c alsa-local.h
$(CC) $(CFLAGS) -shared -fPIC $< $(LDLIBS) -o $@
$(OUTPUT)/%: %.c $(TEST_GEN_PROGS_EXTENDED) alsa-local.h
$(CC) $(CFLAGS) $< $(LDLIBS) -latest -o $@