From patchwork Mon Jan 14 13:51:38 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geert Uytterhoeven X-Patchwork-Id: 10762611 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 699C2186E for ; Mon, 14 Jan 2019 13:52:25 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5B61B28BDB for ; Mon, 14 Jan 2019 13:52:25 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 59EBE28C06; Mon, 14 Jan 2019 13:52:25 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EE56D28BDB for ; Mon, 14 Jan 2019 13:52:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726752AbfANNwE (ORCPT ); Mon, 14 Jan 2019 08:52:04 -0500 Received: from andre.telenet-ops.be ([195.130.132.53]:51424 "EHLO andre.telenet-ops.be" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726688AbfANNvt (ORCPT ); Mon, 14 Jan 2019 08:51:49 -0500 Received: from ramsan ([84.194.111.163]) by andre.telenet-ops.be with bizsmtp id QDrm1z0083XaVaC01DrmK7; Mon, 14 Jan 2019 14:51:47 +0100 Received: from rox.of.borg ([192.168.97.57]) by ramsan with esmtp (Exim 4.90_1) (envelope-from ) id 1gj2eY-0000El-2c; Mon, 14 Jan 2019 14:51:46 +0100 Received: from geert by rox.of.borg with local (Exim 4.90_1) (envelope-from ) id 1gj2eY-0006o9-1c; Mon, 14 Jan 2019 14:51:46 +0100 From: Geert Uytterhoeven To: Shuah Khan , Masahiro Yamada , Michal Marek Cc: Jonathan Corbet , Bamvor Jian Zhang , Kees Cook , linux-kselftest@vger.kernel.org, linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org, Geert Uytterhoeven Subject: [PATCH 06/12] selftests: lib.mk: Add rule to build object file from C source file Date: Mon, 14 Jan 2019 14:51:38 +0100 Message-Id: <20190114135144.26096-7-geert+renesas@glider.be> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190114135144.26096-1-geert+renesas@glider.be> References: <20190114135144.26096-1-geert+renesas@glider.be> Sender: linux-kselftest-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kselftest@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- 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 $@