From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.1 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1F3A7C55191 for ; Thu, 23 Apr 2020 07:40:46 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id F3D7E208E4 for ; Thu, 23 Apr 2020 07:40:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1587627646; bh=Hc+cR7zFIF8KR0kcTIamuv9uat6Jpl54qFc4xFE91+U=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=Qhy7M6qqW2oL0ZYrulvOjiGlLgpoOWdJvFKcbTKmxcSA7vZgUJmYI1p8H9N0+TVR9 P3t1H3jh0neeY1EjoH/KnImXnb0KFzgRG1TaF191t6Na//uEm3bboTcZ5GzD2T7Oc6 eElXIKGbtZuALmO2u3MpWpRWgVosbLFicFaLU9tc= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726965AbgDWHkl (ORCPT ); Thu, 23 Apr 2020 03:40:41 -0400 Received: from conuserg-10.nifty.com ([210.131.2.77]:31770 "EHLO conuserg-10.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726854AbgDWHkd (ORCPT ); Thu, 23 Apr 2020 03:40:33 -0400 Received: from oscar.flets-west.jp (softbank126090202047.bbtec.net [126.90.202.47]) (authenticated) by conuserg-10.nifty.com with ESMTP id 03N7dV9Y000368; Thu, 23 Apr 2020 16:39:45 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-10.nifty.com 03N7dV9Y000368 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1587627585; bh=hZ8+fwVp7+ov3O6upNJo7VpVTfDPY/IvaiBo3lVHLJ4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Hqz14zUC1I7SppGewxhPGdV5Rk7+84OzsClwJY3RdIQQyRnlMJt30rTut/FN2RlCw hQtc3eJg9rYrgq2sPR49eaXYxvpFcFghjJZHdmhwDJ0ZzFw5x4yR+IPBHm0nUFkmSr Uaez3b6d1KOI1OK/5qIvoAgIeFaxWe6KXc1WRQS6DcpiTEKxVkiUlGOKbAbgxEJR8o XQVebwL2iIfKzw8eaIbxNVuuq3osVUo6DxBBVE9Qlf0uoIyZCYFs6tOrHUlpiS5azZ 4qMG6K7kuyI8PH+wuerB9lkXzMJVvHDneNys7zjK6BIrX1ph0uO+ADx1lLCN7esx+R 3lEivQ7AxCc5A== X-Nifty-SrcIP: [126.90.202.47] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: bpf@vger.kernel.org, Sam Ravnborg , Masahiro Yamada , Tomas Winkler , linux-kernel@vger.kernel.org Subject: [PATCH 13/16] samples: mei: build sample program for target architecture Date: Thu, 23 Apr 2020 16:39:26 +0900 Message-Id: <20200423073929.127521-14-masahiroy@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200423073929.127521-1-masahiroy@kernel.org> References: <20200423073929.127521-1-masahiroy@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This userspace program includes UAPI headers exported to usr/include/. 'make headers' always works for the target architecture (i.e. the same architecture as the kernel), so the sample program must be built for the target as well. Kbuild now supports the 'userprogs' syntax to describe it cleanly. I also guarded the CONFIG option by 'depends on CC_CAN_LINK' because $(CC) may not necessarily provide libc. Signed-off-by: Masahiro Yamada --- samples/Kconfig | 1 + samples/mei/Makefile | 9 +++------ 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/samples/Kconfig b/samples/Kconfig index b8113555aa6c..b9dafee5d3af 100644 --- a/samples/Kconfig +++ b/samples/Kconfig @@ -193,6 +193,7 @@ config SAMPLE_VFS config SAMPLE_INTEL_MEI bool "Build example program working with intel mei driver" depends on INTEL_MEI + depends on CC_CAN_LINK && HEADERS_INSTALL help Build a sample program to work with mei device. diff --git a/samples/mei/Makefile b/samples/mei/Makefile index f5b9d02be2cd..ced5532cbbee 100644 --- a/samples/mei/Makefile +++ b/samples/mei/Makefile @@ -1,10 +1,7 @@ # SPDX-License-Identifier: GPL-2.0 # Copyright (c) 2012-2019, Intel Corporation. All rights reserved. -hostprogs := mei-amt-version +userprogs := mei-amt-version +always-y := $(userprogs) -HOSTCFLAGS_mei-amt-version.o += -I$(objtree)/usr/include - -always-y := $(hostprogs) - -all: mei-amt-version +user-ccflags += -I usr/include -- 2.25.1