Skip to content

Commit 6944a06

Browse files
committed
samples: guard sub-directories with CONFIG options
Do not descend to sub-directories when unneeded. I used subdir-$(CONFIG_...) for hidraw, seccomp, and vfs because they only contain host programs. While we are here, let's add SPDX License tag, and sort the directories alphabetically. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
1 parent a3bc886 commit 6944a06

3 files changed

Lines changed: 22 additions & 6 deletions

File tree

‎samples/Makefile‎

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,22 @@
1+
# SPDX-License-Identifier: GPL-2.0
12
# Makefile for Linux samples code
23

3-
obj-y += kobject/ kprobes/ trace_events/ livepatch/ \
4-
hw_breakpoint/ kfifo/ kdb/ hidraw/ rpmsg/ seccomp/ \
5-
configfs/ connector/ v4l/ trace_printk/ \
6-
vfio-mdev/ vfs/ qmi/ binderfs/ pidfd/
4+
obj-$(CONFIG_SAMPLE_ANDROID_BINDERFS) += binderfs/
5+
obj-$(CONFIG_SAMPLE_CONFIGFS) += configfs/
6+
obj-$(CONFIG_SAMPLE_CONNECTOR) += connector/
7+
subdir-y += hidraw
8+
obj-$(CONFIG_SAMPLE_HW_BREAKPOINT) += hw_breakpoint/
9+
obj-$(CONFIG_SAMPLE_KDB) += kdb/
10+
obj-$(CONFIG_SAMPLE_KFIFO) += kfifo/
11+
obj-$(CONFIG_SAMPLE_KOBJECT) += kobject/
12+
obj-$(CONFIG_SAMPLE_KPROBES) += kprobes/
13+
obj-$(CONFIG_SAMPLE_LIVEPATCH) += livepatch/
14+
subdir-y += pidfd
15+
obj-$(CONFIG_SAMPLE_QMI_CLIENT) += qmi/
16+
obj-$(CONFIG_SAMPLE_RPMSG_CLIENT) += rpmsg/
17+
subdir-$(CONFIG_SAMPLE_SECCOMP) += seccomp
18+
obj-$(CONFIG_SAMPLE_TRACE_EVENTS) += trace_events/
19+
obj-$(CONFIG_SAMPLE_TRACE_PRINTK) += trace_printk/
20+
obj-$(CONFIG_VIDEO_PCI_SKELETON) += v4l/
21+
obj-y += vfio-mdev/
22+
subdir-$(CONFIG_SAMPLE_VFS) += vfs

‎samples/seccomp/Makefile‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# SPDX-License-Identifier: GPL-2.0
22
ifndef CROSS_COMPILE
3-
hostprogs-$(CONFIG_SAMPLE_SECCOMP) := bpf-fancy dropper bpf-direct user-trap
3+
hostprogs-y := bpf-fancy dropper bpf-direct user-trap
44

55
HOSTCFLAGS_bpf-fancy.o += -I$(objtree)/usr/include
66
HOSTCFLAGS_bpf-fancy.o += -idirafter $(objtree)/include

‎samples/vfs/Makefile‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# List of programs to build
2-
hostprogs-$(CONFIG_SAMPLE_VFS) := \
2+
hostprogs-y := \
33
test-fsmount \
44
test-statx
55

0 commit comments

Comments
 (0)