samples: auxdisplay: use 'userprogs' syntax
authorMasahiro Yamada <masahiroy@kernel.org>
Wed, 29 Apr 2020 03:45:25 +0000 (12:45 +0900)
committerMasahiro Yamada <masahiroy@kernel.org>
Sun, 17 May 2020 09:52:02 +0000 (18:52 +0900)
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>
samples/Kconfig
samples/Makefile
samples/auxdisplay/Makefile

index 69699db4967559f5dd1134a1c30de8319062ff44..2322e11e8b80ee211945cba163152d8782fbd820 100644 (file)
@@ -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
index bdc16840545274e5882bf74bb8b93c9f84e4bf9e..0c43b5d34b1560c541be4b99f05b871ad1a117aa 100644 (file)
@@ -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/
index 0273bab27233c52aac6196272a343b51983e4f47..dbdf939af94a6945fc13f2943a08d28bbb882b6b 100644 (file)
@@ -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)