samples: mei: use hostprogs kbuild constructs
authorTomas Winkler <tomas.winkler@intel.com>
Thu, 10 Oct 2019 13:27:10 +0000 (16:27 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 21 Oct 2019 16:33:12 +0000 (12:33 -0400)
Use hostprogs kbuild constructs to compile
mei sample program mei-amt-version

Add CONFIG_SAMPLE_INTEL_MEI option to enable/disable
the feature.

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Link: https://lore.kernel.org/r/20191010132710.4075-1-tomas.winkler@intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
samples/Kconfig
samples/Makefile
samples/mei/Makefile

index c8dacb4dda80c0d44548e81391bd4a65f276048b..b663d9d241145a59f6ff928cf38dbfb1de59815c 100644 (file)
@@ -169,4 +169,11 @@ config SAMPLE_VFS
          as mount API and statx().  Note that this is restricted to the x86
          arch whilst it accesses system calls that aren't yet in all arches.
 
+config SAMPLE_INTEL_MEI
+       bool "Build example program working with intel mei driver"
+       depends on INTEL_MEI
+       help
+         Build a sample program to work with mei device.
+
+
 endif # SAMPLES
index 7d6e4ca28d696ac539f1e690eee8d36c8635f917..d6062ab25347d89e50f4db77bb6758643bd15986 100644 (file)
@@ -20,3 +20,4 @@ obj-$(CONFIG_SAMPLE_TRACE_PRINTK)     += trace_printk/
 obj-$(CONFIG_VIDEO_PCI_SKELETON)       += v4l/
 obj-y                                  += vfio-mdev/
 subdir-$(CONFIG_SAMPLE_VFS)            += vfs
+obj-$(CONFIG_SAMPLE_INTEL_MEI)         += mei/
index c7e52e9e92caf313f7c248fdb2091dc589f466f5..27f37efdadb4712b4b0f98e2912f83757c81f81f 100644 (file)
@@ -1,10 +1,10 @@
 # SPDX-License-Identifier: GPL-2.0
-CC := $(CROSS_COMPILE)gcc
-CFLAGS := -I../../usr/include
+# Copyright (c) 2012-2019, Intel Corporation. All rights reserved.
 
-PROGS := mei-amt-version
+hostprogs-y := mei-amt-version
 
-all: $(PROGS)
+HOSTCFLAGS_mei-amt-version.o += -I$(objtree)/usr/include
 
-clean:
-       rm -fr $(PROGS)
+always := $(hostprogs-y)
+
+all: mei-amt-version