]> git.baikalelectronics.ru Git - kernel.git/commitdiff
samples: timers: use 'userprogs' syntax
authorMasahiro Yamada <masahiroy@kernel.org>
Wed, 29 Apr 2020 03:45:26 +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: Sam Ravnborg <sam@ravnborg.org>
samples/Kconfig
samples/Makefile
samples/timers/Makefile

index 2322e11e8b80ee211945cba163152d8782fbd820..a8629a0d4f96c40799f3f5cbb833fd67c4205a2d 100644 (file)
@@ -135,6 +135,10 @@ config SAMPLE_SECCOMP
          Build samples of seccomp filters using various methods of
          BPF filter construction.
 
+config SAMPLE_TIMER
+       bool "Timer sample"
+       depends on CC_CAN_LINK && HEADERS_INSTALL
+
 config SAMPLE_UHID
        bool "UHID sample"
        depends on CC_CAN_LINK && HEADERS_INSTALL
index 0c43b5d34b1560c541be4b99f05b871ad1a117aa..042208326689b0286583de825493b44abb4a2b6c 100644 (file)
@@ -16,6 +16,7 @@ subdir-$(CONFIG_SAMPLE_PIDFD)         += pidfd
 obj-$(CONFIG_SAMPLE_QMI_CLIENT)                += qmi/
 obj-$(CONFIG_SAMPLE_RPMSG_CLIENT)      += rpmsg/
 subdir-$(CONFIG_SAMPLE_SECCOMP)                += seccomp
+subdir-$(CONFIG_SAMPLE_TIMER)          += timers
 obj-$(CONFIG_SAMPLE_TRACE_EVENTS)      += trace_events/
 obj-$(CONFIG_SAMPLE_TRACE_PRINTK)      += trace_printk/
 obj-$(CONFIG_SAMPLE_FTRACE_DIRECT)     += ftrace/
index f9fa074608029b7efc0e9e8039d751d26f1c95c4..15c7ddbc8c5132aa0e7b422ae8ed213db752a34e 100644 (file)
@@ -1,16 +1,5 @@
 # SPDX-License-Identifier: GPL-2.0
-ifndef CROSS_COMPILE
-uname_M := $(shell uname -m 2>/dev/null || echo not)
-ARCH ?= $(shell echo $(uname_M) | sed -e s/i.86/x86/ -e s/x86_64/x86/)
+userprogs := hpet_example
+always-y := $(userprogs)
 
-ifeq ($(ARCH),x86)
-CC := $(CROSS_COMPILE)gcc
-PROGS := hpet_example
-
-all: $(PROGS)
-
-clean:
-       rm -fr $(PROGS)
-
-endif
-endif
+userccflags += -I usr/include