samples: auxdisplay: use 'userprogs' syntax

Kbuild now supports the 'userprogs' syntax to compile userspace
programs for the same architecture as the kernel.

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: Miguel Ojeda <miguel.ojeda.sandonis@gmail.com>
Acked-by: Sam Ravnborg <sam@ravnborg.org>
This commit is contained in:
Masahiro Yamada 2020-04-29 12:45:25 +09:00
parent c4c10996b1
commit 87ffbba9a9
3 changed files with 7 additions and 9 deletions

View File

@ -6,6 +6,10 @@ menuconfig SAMPLES
if SAMPLES if SAMPLES
config SAMPLE_AUXDISPLAY
bool "auxdisplay sample"
depends on CC_CAN_LINK
config SAMPLE_TRACE_EVENTS config SAMPLE_TRACE_EVENTS
tristate "Build trace_events examples -- loadable modules only" tristate "Build trace_events examples -- loadable modules only"
depends on EVENT_TRACING && m depends on EVENT_TRACING && m

View File

@ -1,6 +1,7 @@
# SPDX-License-Identifier: GPL-2.0 # SPDX-License-Identifier: GPL-2.0
# Makefile for Linux samples code # Makefile for Linux samples code
subdir-$(CONFIG_SAMPLE_AUXDISPLAY) += auxdisplay
obj-$(CONFIG_SAMPLE_ANDROID_BINDERFS) += binderfs/ obj-$(CONFIG_SAMPLE_ANDROID_BINDERFS) += binderfs/
obj-$(CONFIG_SAMPLE_CONFIGFS) += configfs/ obj-$(CONFIG_SAMPLE_CONFIGFS) += configfs/
obj-$(CONFIG_SAMPLE_CONNECTOR) += connector/ obj-$(CONFIG_SAMPLE_CONNECTOR) += connector/

View File

@ -1,10 +1,3 @@
# SPDX-License-Identifier: GPL-2.0 # SPDX-License-Identifier: GPL-2.0
CC := $(CROSS_COMPILE)gcc userprogs := cfag12864b-example
CFLAGS := -I../../usr/include always-y := $(userprogs)
PROGS := cfag12864b-example
all: $(PROGS)
clean:
rm -fr $(PROGS)