Skip to content

Commit

Permalink
samples: auxdisplay: use 'userprogs' syntax
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
masahir0y committed May 17, 2020
1 parent c4c1099 commit 87ffbba
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 9 deletions.
4 changes: 4 additions & 0 deletions samples/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ menuconfig SAMPLES

if SAMPLES

config SAMPLE_AUXDISPLAY
bool "auxdisplay sample"
depends on CC_CAN_LINK

config SAMPLE_TRACE_EVENTS
tristate "Build trace_events examples -- loadable modules only"
depends on EVENT_TRACING && m
Expand Down
1 change: 1 addition & 0 deletions samples/Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# SPDX-License-Identifier: GPL-2.0
# Makefile for Linux samples code

subdir-$(CONFIG_SAMPLE_AUXDISPLAY) += auxdisplay
obj-$(CONFIG_SAMPLE_ANDROID_BINDERFS) += binderfs/
obj-$(CONFIG_SAMPLE_CONFIGFS) += configfs/
obj-$(CONFIG_SAMPLE_CONNECTOR) += connector/
Expand Down
11 changes: 2 additions & 9 deletions samples/auxdisplay/Makefile
Original file line number Diff line number Diff line change
@@ -1,10 +1,3 @@
# SPDX-License-Identifier: GPL-2.0
CC := $(CROSS_COMPILE)gcc
CFLAGS := -I../../usr/include

PROGS := cfag12864b-example

all: $(PROGS)

clean:
rm -fr $(PROGS)
userprogs := cfag12864b-example
always-y := $(userprogs)

0 comments on commit 87ffbba

Please sign in to comment.