From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752158AbdBIJF3 (ORCPT ); Thu, 9 Feb 2017 04:05:29 -0500 Received: from ozlabs.org ([103.22.144.67]:38089 "EHLO ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752061AbdBIJFF (ORCPT ); Thu, 9 Feb 2017 04:05:05 -0500 From: Michael Ellerman To: shuahkh@osg.samsung.com, bamvor.zhangjian@huawei.com Cc: linux-kernel@vger.kernel.org, linuxppc-dev@ozlabs.org, linux-kselftest@vger.kernel.org, linux-api@vger.kernel.org Subject: [PATCH 3/5] selftests: Fix the .S and .S -> .o rules Date: Thu, 9 Feb 2017 19:56:28 +1100 Message-Id: <1486630590-9410-3-git-send-email-mpe@ellerman.id.au> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1486630590-9410-1-git-send-email-mpe@ellerman.id.au> References: <1486630590-9410-1-git-send-email-mpe@ellerman.id.au> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Both these rules incorrectly use $< (first prerequisite) rather than $^ (all prerequisites), meaning they don't work if we're using more than one .S file as input. Switch them to using $^. They also don't include $(CPPFLAGS) and other variables used in the default rules, which breaks targets that require those. Fix that by using the builtin $(COMPILE.S) and $(LINK.S) rules. Fixes: a8ba798bc8ec ("selftests: enable O and KBUILD_OUTPUT") Signed-off-by: Michael Ellerman --- tools/testing/selftests/lib.mk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/testing/selftests/lib.mk b/tools/testing/selftests/lib.mk index 98841c54763a..ce96d80ad64f 100644 --- a/tools/testing/selftests/lib.mk +++ b/tools/testing/selftests/lib.mk @@ -54,9 +54,9 @@ $(OUTPUT)/%:%.c $(LINK.c) $^ $(LDLIBS) -o $@ $(OUTPUT)/%.o:%.S - $(CC) $(ASFLAGS) -c $< -o $@ + $(COMPILE.S) $^ -o $@ $(OUTPUT)/%:%.S - $(CC) $(ASFLAGS) $< -o $@ + $(LINK.S) $^ $(LDLIBS) -o $@ .PHONY: run_tests all clean install emit_tests -- 2.7.4