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>
This commit is contained in:
Masahiro Yamada
2020-04-29 12:45:19 +09:00
parent 8a45fe7053
commit 87ecdf4fc9
4 changed files with 12 additions and 6 deletions
+2
View File
@@ -0,0 +1,2 @@
# SPDX-License-Identifier: GPL-2.0-only
/uhid-example
+3 -6
View File
@@ -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