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 E7C77C83006 for ; Wed, 29 Apr 2020 03:46:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id BF81420731 for ; Wed, 29 Apr 2020 03:46:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1588132011; bh=ZMHUFOzjMKmHaBY86nqRN13bAbe1H5JyDFaKwM09lww=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=hdj6rVJS45D0OuvpSBZAkFVBR+Z6r/U7D1wfZqyhHkck89ia2I8tr8/dIQIZJ3VkY ZXP7M5wd6tpwp6It4DPtrSkj2ve1qmtUqtvaCpHZSJ0kzL6HhEdfRVOy6co3i2qgzA wXyfy/SOl/Eo4m9OnSlpMRQcM5jw3gKyC5dBM73w= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726686AbgD2Dqu (ORCPT ); Tue, 28 Apr 2020 23:46:50 -0400 Received: from conuserg-12.nifty.com ([210.131.2.79]:30976 "EHLO conuserg-12.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726765AbgD2Dqh (ORCPT ); Tue, 28 Apr 2020 23:46:37 -0400 Received: from oscar.flets-west.jp (softbank126090202047.bbtec.net [126.90.202.47]) (authenticated) by conuserg-12.nifty.com with ESMTP id 03T3jXln020748; Wed, 29 Apr 2020 12:45:43 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-12.nifty.com 03T3jXln020748 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1588131943; bh=O4L7XF+xZH3Fa+t8uXqe3t5Njxb0XPvUWzwpGlKOHhw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=euNQVcgUDchAg9Axw45cSEgaFg3cACAdtfJGPWOQ1pZQ/XfLL1l3NkwTV4fgxlL1V 4+dHKwta+O9PBXHkAJkfJT34QKmeNW+MBj2uJ1iw3c27TtRzAw+S0Y8ByLPvr8UQAI E9zAOjfIZG1M73Z+v36ozzpNKuRQKUHQ7Z6yEVp7C4I3LeHqSvclzkRXUcGLCEwVKW CIxYbV4hXWTY2QUi7R85umqJ38wsiYo28eKcAZMAsjlvUDb4ui1eCMjzzx2ODx3Nch yOC0YOsAJzbFnM4xekuAtgJWNj0aqHTVPwFJgTGsSrmV4oA87x1/9H+AY0CAQgGvsO W2PJMtZcx6rrg== X-Nifty-SrcIP: [126.90.202.47] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: bpf , Arnd Bergmann , Sam Ravnborg , linux-kernel@vger.kernel.org, Masahiro Yamada Subject: [PATCH v2 12/15] samples: mei: build sample program for target architecture Date: Wed, 29 Apr 2020 12:45:24 +0900 Message-Id: <20200429034527.590520-13-masahiroy@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200429034527.590520-1-masahiroy@kernel.org> References: <20200429034527.590520-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 should be built for the target as well. Kbuild now supports 'userprogs' for that. I also guarded the CONFIG option by 'depends on CC_CAN_LINK' because $(CC) may not provide libc. Signed-off-by: Masahiro Yamada Acked-by: Sam Ravnborg --- Changes in v2: None samples/Kconfig | 1 + samples/mei/Makefile | 9 +++------ 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/samples/Kconfig b/samples/Kconfig index c68d391c0602..69699db49675 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..329411f82369 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 +userccflags += -I usr/include -- 2.25.1