summaryrefslogtreecommitdiffstats
path: root/samples/uhid
diff options
context:
space:
mode:
authorMasahiro Yamada <masahiroy@kernel.org>2020-04-29 05:45:19 +0200
committerMasahiro Yamada <masahiroy@kernel.org>2020-05-17 11:52:01 +0200
commit87ecdf4fc9fd98f2a4156716d75c342b5bd35c74 (patch)
tree5187dd553475df4a777b68a16c349b5ab300d093 /samples/uhid
parentsamples: uhid: fix warnings in uhid-example (diff)
downloadlinux-87ecdf4fc9fd98f2a4156716d75c342b5bd35c74.tar.xz
linux-87ecdf4fc9fd98f2a4156716d75c342b5bd35c74.zip
samples: uhid: build sample program for target architecture
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. Add the entry to samples/Makefile to put this into the build bot coverage. I also added the CONFIG option guarded by 'depends on CC_CAN_LINK' because $(CC) may not provide libc. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> Acked-by: Sam Ravnborg <sam@ravnborg.org>
Diffstat (limited to 'samples/uhid')
-rw-r--r--samples/uhid/.gitignore2
-rw-r--r--samples/uhid/Makefile9
2 files changed, 5 insertions, 6 deletions
diff --git a/samples/uhid/.gitignore b/samples/uhid/.gitignore
new file mode 100644
index 000000000000..0e0a5a929f5d
--- /dev/null
+++ b/samples/uhid/.gitignore
@@ -0,0 +1,2 @@
+# SPDX-License-Identifier: GPL-2.0-only
+/uhid-example
diff --git a/samples/uhid/Makefile b/samples/uhid/Makefile
index 5f44ea40d6d5..9e652fc34103 100644
--- a/samples/uhid/Makefile
+++ b/samples/uhid/Makefile
@@ -1,8 +1,5 @@
# SPDX-License-Identifier: GPL-2.0-only
-# List of programs to build
-hostprogs := uhid-example
+userprogs := uhid-example
+always-y := $(userprogs)
-# Tell kbuild to always build the programs
-always-y := $(hostprogs)
-
-HOSTCFLAGS_uhid-example.o += -I$(objtree)/usr/include
+userccflags += -I usr/include