diff mbox series

[14/16] samples: auxdisplay: use 'userprogs' syntax

Message ID 20200423073929.127521-15-masahiroy@kernel.org (mailing list archive)
State New, archived
Headers show
Series kbuild: support 'userprogs' syntax | expand

Commit Message

Masahiro Yamada April 23, 2020, 7:39 a.m. UTC
Kbuild now supports the 'userprogs' syntax to describe the build rules
of userspace programs for the target architecture (i.e. 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 necessarily provide libc.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
---

 samples/Kconfig             |  4 ++++
 samples/Makefile            |  1 +
 samples/auxdisplay/Makefile | 11 ++---------
 3 files changed, 7 insertions(+), 9 deletions(-)

Comments

Miguel Ojeda April 23, 2020, 11:50 a.m. UTC | #1
Hi Masahiro,

On Thu, Apr 23, 2020 at 9:41 AM Masahiro Yamada <masahiroy@kernel.org> wrote:
>
> Kbuild now supports the 'userprogs' syntax to describe the build rules
> of userspace programs for the target architecture (i.e. 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 necessarily provide libc.
>
> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>

Thanks for this! Looks nice. I guess you take all patches for the
samples/ changes through your tree?

Acked-by: Miguel Ojeda <miguel.ojeda.sandonis@gmail.com>

Cheers,
Miguel
Masahiro Yamada April 24, 2020, 2:59 a.m. UTC | #2
Hi Miguel,

On Thu, Apr 23, 2020 at 8:50 PM Miguel Ojeda
<miguel.ojeda.sandonis@gmail.com> wrote:
>
> Hi Masahiro,
>
> On Thu, Apr 23, 2020 at 9:41 AM Masahiro Yamada <masahiroy@kernel.org> wrote:
> >
> > Kbuild now supports the 'userprogs' syntax to describe the build rules
> > of userspace programs for the target architecture (i.e. 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 necessarily provide libc.
> >
> > Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
>
> Thanks for this! Looks nice. I guess you take all patches for the
> samples/ changes through your tree?

Yes, I will take all to my tree
since this series is mostly Makefile changes.



> Acked-by: Miguel Ojeda <miguel.ojeda.sandonis@gmail.com>
>
> Cheers,
> Miguel
diff mbox series

Patch

diff --git a/samples/Kconfig b/samples/Kconfig
index b9dafee5d3af..cdb0091e4734 100644
--- a/samples/Kconfig
+++ b/samples/Kconfig
@@ -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
diff --git a/samples/Makefile b/samples/Makefile
index bdc168405452..0c43b5d34b15 100644
--- a/samples/Makefile
+++ b/samples/Makefile
@@ -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/
diff --git a/samples/auxdisplay/Makefile b/samples/auxdisplay/Makefile
index 0273bab27233..dbdf939af94a 100644
--- a/samples/auxdisplay/Makefile
+++ b/samples/auxdisplay/Makefile
@@ -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)