mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-12-15 23:14:31 +08:00
091873e47e
The only (forced) static test binary doesn't depend on libcap. Because
using -lcap on systems that don't have such static library would fail
(e.g. on Arch Linux), let's be more specific and require only dynamic
libcap linking.
Fixes: a52540522c
("selftests/landlock: Fix out-of-tree builds")
Cc: Anders Roxell <anders.roxell@linaro.org>
Cc: Guillaume Tucker <guillaume.tucker@collabora.com>
Cc: Mark Brown <broonie@kernel.org>
Cc: Shuah Khan <skhan@linuxfoundation.org>
Cc: stable@vger.kernel.org
Signed-off-by: Mickaël Salaün <mic@digikod.net>
Link: https://lore.kernel.org/r/20221019200536.2771316-1-mic@digikod.net
24 lines
486 B
Makefile
24 lines
486 B
Makefile
# SPDX-License-Identifier: GPL-2.0
|
|
#
|
|
# First run: make -C ../../../.. headers_install
|
|
|
|
CFLAGS += -Wall -O2 $(KHDR_INCLUDES)
|
|
|
|
LOCAL_HDRS += common.h
|
|
|
|
src_test := $(wildcard *_test.c)
|
|
|
|
TEST_GEN_PROGS := $(src_test:.c=)
|
|
|
|
TEST_GEN_PROGS_EXTENDED := true
|
|
|
|
# Short targets:
|
|
$(TEST_GEN_PROGS): LDLIBS += -lcap
|
|
$(TEST_GEN_PROGS_EXTENDED): LDFLAGS += -static
|
|
|
|
include ../lib.mk
|
|
|
|
# Targets with $(OUTPUT)/ prefix:
|
|
$(TEST_GEN_PROGS): LDLIBS += -lcap
|
|
$(TEST_GEN_PROGS_EXTENDED): LDFLAGS += -static
|