[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20190114135144.26096-7-geert+renesas@glider.be>
Date: Mon, 14 Jan 2019 14:51:38 +0100
From: Geert Uytterhoeven <geert+renesas@...der.be>
To: Shuah Khan <shuah@...nel.org>,
Masahiro Yamada <yamada.masahiro@...ionext.com>,
Michal Marek <michal.lkml@...kovi.net>
Cc: Jonathan Corbet <corbet@....net>,
Bamvor Jian Zhang <bamv2005@...il.com>,
Kees Cook <keescook@...omium.org>,
linux-kselftest@...r.kernel.org, linux-kbuild@...r.kernel.org,
linux-kernel@...r.kernel.org,
Geert Uytterhoeven <geert+renesas@...der.be>
Subject: [PATCH 06/12] selftests: lib.mk: Add rule to build object file from C source file
Currently there are rules to compile and link one or more C or
assembler source files into a full executable, and to assemble a single
assembler source into an object file.
Add a generic rule to compile a single C source file into an object
file, for reuse of object files in multiple executables.
Signed-off-by: Geert Uytterhoeven <geert+renesas@...der.be>
---
tools/testing/selftests/lib.mk | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/tools/testing/selftests/lib.mk b/tools/testing/selftests/lib.mk
index 8b0f16409ed7eb53..77a71264d8c5a743 100644
--- a/tools/testing/selftests/lib.mk
+++ b/tools/testing/selftests/lib.mk
@@ -141,6 +141,7 @@ clean:
#
ifneq ($(KBUILD_SRC),)
LINK.c = $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) $(TARGET_ARCH)
+COMPILE.c = $(CC) $(CFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c
COMPILE.S = $(CC) $(ASFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c
LINK.S = $(CC) $(ASFLAGS) $(CPPFLAGS) $(LDFLAGS) $(TARGET_ARCH)
endif
@@ -151,6 +152,9 @@ ifeq ($(OVERRIDE_TARGETS),)
$(OUTPUT)/%:%.c
$(LINK.c) $^ $(LDLIBS) -o $@
+$(OUTPUT)/%.o:%.c
+ $(COMPILE.c) $^ -o $@
+
$(OUTPUT)/%.o:%.S
$(COMPILE.S) $^ -o $@
--
2.17.1
Powered by blists - more mailing lists