diff options
author | Masahiro Yamada <yamada.masahiro@socionext.com> | 2019-04-27 05:33:36 +0200 |
---|---|---|
committer | Masahiro Yamada <yamada.masahiro@socionext.com> | 2019-05-03 16:04:59 +0200 |
commit | d93a18f27e3701a8cdc2228aee1c22451d1292e4 (patch) | |
tree | c6a85c52e5ab3f6e9ffe015af328d46db54653f8 /Makefile | |
parent | modpost: make KBUILD_MODPOST_WARN also configurable for external modules (diff) | |
download | linux-d93a18f27e3701a8cdc2228aee1c22451d1292e4.tar.xz linux-d93a18f27e3701a8cdc2228aee1c22451d1292e4.zip |
kbuild: move samples/ to KBUILD_VMLINUX_OBJS
Handle samples/ like the other top-level directories to simplify
the Makefile.
Include include/config/auto.conf earlier to evaluate
drivers-$(CONFIG_SAMPLES).
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 18 |
1 files changed, 8 insertions, 10 deletions
@@ -598,20 +598,21 @@ endif export KBUILD_MODULES KBUILD_BUILTIN +ifeq ($(dot-config),1) +include include/config/auto.conf +endif + ifeq ($(KBUILD_EXTMOD),) # Objects we will link into vmlinux / subdirs we need to visit init-y := init/ drivers-y := drivers/ sound/ +drivers-$(CONFIG_SAMPLES) += samples/ net-y := net/ libs-y := lib/ core-y := usr/ virt-y := virt/ endif # KBUILD_EXTMOD -ifeq ($(dot-config),1) -include include/config/auto.conf -endif - # The all: target is the default when no target is given on the # command line. # This allow a user to issue only 'make' to build a kernel including modules @@ -1006,7 +1007,7 @@ export KBUILD_VMLINUX_LIBS := $(libs-y1) export KBUILD_LDS := arch/$(SRCARCH)/kernel/vmlinux.lds export LDFLAGS_vmlinux # used by scripts/package/Makefile -export KBUILD_ALLDIRS := $(sort $(filter-out arch/%,$(vmlinux-alldirs)) arch Documentation include samples scripts tools) +export KBUILD_ALLDIRS := $(sort $(filter-out arch/%,$(vmlinux-alldirs)) arch Documentation include scripts tools) vmlinux-deps := $(KBUILD_LDS) $(KBUILD_VMLINUX_OBJS) $(KBUILD_VMLINUX_LIBS) @@ -1043,11 +1044,8 @@ vmlinux: scripts/link-vmlinux.sh autoksyms_recursive $(vmlinux-deps) FORCE targets := vmlinux -# Build samples along the rest of the kernel. This needs headers_install. -ifdef CONFIG_SAMPLES -vmlinux-dirs += samples +# Some samples need headers_install. samples: headers_install -endif # The actual objects are generated when descending, # make sure no implicit rule kicks in @@ -1363,7 +1361,7 @@ MRPROPER_FILES += .config .config.old .version \ # clean: rm-dirs := $(CLEAN_DIRS) clean: rm-files := $(CLEAN_FILES) -clean-dirs := $(addprefix _clean_, . $(vmlinux-alldirs) Documentation samples) +clean-dirs := $(addprefix _clean_, . $(vmlinux-alldirs) Documentation) PHONY += $(clean-dirs) clean archclean vmlinuxclean $(clean-dirs): |