summaryrefslogtreecommitdiffstats
path: root/samples/timers
diff options
context:
space:
mode:
authorMasahiro Yamada <masahiroy@kernel.org>2020-04-29 12:45:26 +0900
committerMasahiro Yamada <masahiroy@kernel.org>2020-05-17 18:52:02 +0900
commitb98ccc7150c7bfce60671ad1928d5f1220446b39 (patch)
tree0d69f1aad4f3d65e665e73f14b6dce51d9e23843 /samples/timers
parent87ffbba9a9a1a74da44917a207c7e57dac98f2f8 (diff)
downloadlinux-b98ccc7150c7bfce60671ad1928d5f1220446b39.tar.bz2
samples: timers: 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: Sam Ravnborg <sam@ravnborg.org>
Diffstat (limited to 'samples/timers')
-rw-r--r--samples/timers/Makefile17
1 files changed, 3 insertions, 14 deletions
diff --git a/samples/timers/Makefile b/samples/timers/Makefile
index f9fa07460802..15c7ddbc8c51 100644
--- a/samples/timers/Makefile
+++ b/samples/timers/Makefile
@@ -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