mirror of
https://github.com/torvalds/linux.git
synced 2026-11-23 23:11:40 +00:00
selftests/nolibc: add a variable for nolibc-test source files
The list of the nolibc-test source files is repeated many times. Another source file is about to be added, adding to the mess. Introduce a common variable instead. Signed-off-by: Thomas Weißschuh <[email protected]> Acked-by: Willy Tarreau <[email protected]> Link: https://patch.msgid.link/[email protected]
This commit is contained in:
@@ -13,9 +13,9 @@ $(OUTPUT)/nolibc-test: CFLAGS = -nostdlib -nostdinc -static \
|
||||
-isystem $(top_srcdir)/tools/include/nolibc -isystem $(top_srcdir)/usr/include \
|
||||
$(CFLAGS_NOLIBC_TEST)
|
||||
$(OUTPUT)/nolibc-test: LDLIBS = $(if $(LLVM),,-lgcc)
|
||||
$(OUTPUT)/nolibc-test: nolibc-test.c nolibc-test-linkage.c | headers
|
||||
$(OUTPUT)/nolibc-test: $(NOLIBC_TEST_SOURCES) | headers
|
||||
|
||||
$(OUTPUT)/libc-test: nolibc-test.c nolibc-test-linkage.c
|
||||
$(OUTPUT)/libc-test: $(NOLIBC_TEST_SOURCES)
|
||||
$(call msg,CC,,$@)
|
||||
$(Q)$(LINK.c) $^ -o $@
|
||||
|
||||
|
||||
@@ -8,3 +8,5 @@ _CFLAGS_SANITIZER ?= $(call cc-option,-fsanitize=undefined -fsanitize-trap=all)
|
||||
CFLAGS_NOLIBC_TEST ?= -Os -fno-ident -fno-asynchronous-unwind-tables -std=c89 -W -Wall -Wextra \
|
||||
$(call cc-option,-fno-stack-protector) $(call cc-option,-Wmissing-prototypes) \
|
||||
$(_CFLAGS_STACKPROTECTOR) $(_CFLAGS_SANITIZER)
|
||||
|
||||
NOLIBC_TEST_SOURCES := nolibc-test.c nolibc-test-linkage.c
|
||||
|
||||
@@ -302,12 +302,12 @@ sysroot/$(ARCH)/include:
|
||||
$(Q)$(MAKE) -C $(srctree)/tools/include/nolibc ARCH=$(ARCH) OUTPUT=$(CURDIR)/sysroot/ headers_standalone headers_check
|
||||
$(Q)mv sysroot/sysroot sysroot/$(ARCH)
|
||||
|
||||
nolibc-test: nolibc-test.c nolibc-test-linkage.c sysroot/$(ARCH)/include
|
||||
nolibc-test: $(NOLIBC_TEST_SOURCES) sysroot/$(ARCH)/include
|
||||
$(QUIET_CC)$(CC) $(CFLAGS) $(LDFLAGS) -o $@ \
|
||||
-nostdlib -nostdinc -static -Isysroot/$(ARCH)/include nolibc-test.c nolibc-test-linkage.c $(LIBGCC)
|
||||
-nostdlib -nostdinc -static -Isysroot/$(ARCH)/include $(NOLIBC_TEST_SOURCES) $(LIBGCC)
|
||||
|
||||
libc-test: nolibc-test.c nolibc-test-linkage.c
|
||||
$(QUIET_CC)$(HOSTCC) -o $@ nolibc-test.c nolibc-test-linkage.c
|
||||
libc-test: $(NOLIBC_TEST_SOURCES)
|
||||
$(QUIET_CC)$(HOSTCC) -o $@ $(NOLIBC_TEST_SOURCES)
|
||||
|
||||
# local libc-test
|
||||
run-libc-test: libc-test
|
||||
|
||||
Reference in New Issue
Block a user