diff options
author | Masahiro Yamada <yamada.masahiro@socionext.com> | 2019-06-04 06:13:59 -0400 |
---|---|---|
committer | Masahiro Yamada <yamada.masahiro@socionext.com> | 2019-06-15 06:57:01 -0400 |
commit | e949f4c2d6a3df2b7fd00e56c0f081b15284906f (patch) | |
tree | c5b592d884e6eef3680177e384dfd567cc6e03e5 /Makefile | |
parent | c6509a24d6ba0f8560a81c032c30d169ba467b0a (diff) |
kbuild: add CONFIG_HEADERS_INSTALL and loosen the dependency of samples
Commit 5318321d367c ("samples: disable CONFIG_SAMPLES for UML") used
a big hammer to fix the build errors under the samples/ directory.
Only some samples actually include uapi headers from usr/include.
Introduce CONFIG_HEADERS_INSTALL since 'depends on HEADERS_INSTALL' is
clearer than 'depends on !UML'. If this option is enabled, uapi headers
are installed before starting directory descending.
I added 'depends on HEADERS_INSTALL' to per-sample CONFIG options.
This allows UML to compile some samples.
$ make ARCH=um allmodconfig samples/
[ snip ]
CC [M] samples/configfs/configfs_sample.o
CC [M] samples/kfifo/bytestream-example.o
CC [M] samples/kfifo/dma-example.o
CC [M] samples/kfifo/inttype-example.o
CC [M] samples/kfifo/record-example.o
CC [M] samples/kobject/kobject-example.o
CC [M] samples/kobject/kset-example.o
CC [M] samples/trace_events/trace-events-sample.o
CC [M] samples/trace_printk/trace-printk.o
AR samples/vfio-mdev/built-in.a
AR samples/built-in.a
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -1053,9 +1053,6 @@ vmlinux: scripts/link-vmlinux.sh autoksyms_recursive $(vmlinux-deps) FORCE | |||
1053 | 1053 | ||
1054 | targets := vmlinux | 1054 | targets := vmlinux |
1055 | 1055 | ||
1056 | # Some samples need headers_install. | ||
1057 | samples: headers_install | ||
1058 | |||
1059 | # The actual objects are generated when descending, | 1056 | # The actual objects are generated when descending, |
1060 | # make sure no implicit rule kicks in | 1057 | # make sure no implicit rule kicks in |
1061 | $(sort $(vmlinux-deps)): $(vmlinux-dirs) ; | 1058 | $(sort $(vmlinux-deps)): $(vmlinux-dirs) ; |
@@ -1199,6 +1196,10 @@ headers_check: headers_install | |||
1199 | $(Q)$(MAKE) $(hdr-inst)=include/uapi dst=include HDRCHECK=1 | 1196 | $(Q)$(MAKE) $(hdr-inst)=include/uapi dst=include HDRCHECK=1 |
1200 | $(Q)$(MAKE) $(hdr-inst)=arch/$(SRCARCH)/include/uapi dst=include HDRCHECK=1 | 1197 | $(Q)$(MAKE) $(hdr-inst)=arch/$(SRCARCH)/include/uapi dst=include HDRCHECK=1 |
1201 | 1198 | ||
1199 | ifdef CONFIG_HEADERS_INSTALL | ||
1200 | prepare: headers_install | ||
1201 | endif | ||
1202 | |||
1202 | ifdef CONFIG_HEADERS_CHECK | 1203 | ifdef CONFIG_HEADERS_CHECK |
1203 | all: headers_check | 1204 | all: headers_check |
1204 | endif | 1205 | endif |
@@ -1744,7 +1745,6 @@ build-dir = $(patsubst %/,%,$(dir $(build-target))) | |||
1744 | PHONY += / | 1745 | PHONY += / |
1745 | /: ./ | 1746 | /: ./ |
1746 | 1747 | ||
1747 | samples/: headers_install | ||
1748 | %/: prepare FORCE | 1748 | %/: prepare FORCE |
1749 | $(Q)$(MAKE) KBUILD_MODULES=1 $(build)=$(build-dir) | 1749 | $(Q)$(MAKE) KBUILD_MODULES=1 $(build)=$(build-dir) |
1750 | 1750 | ||