net: move CONFIG_NET guard to top Makefile

When CONFIG_NET is disabled, nothing under the net/ directory is
compiled. Move the CONFIG_NET guard to the top Makefile so the net/
directory is entirely skipped.

When Kbuild visits net/Makefile, CONFIG_NET is obvioulsy 'y' because
CONFIG_NET is a bool option. Clean up net/Makefile.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Link: https://lore.kernel.org/r/20210125231659.106201-1-masahiroy@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
Masahiro Yamada
2021-01-26 08:16:55 +09:00
committed by Jakub Kicinski
parent 69783429cd
commit 8b5f4eb3ab
2 changed files with 6 additions and 8 deletions

View File

@@ -649,7 +649,8 @@ ifeq ($(KBUILD_EXTMOD),)
core-y := init/ usr/
drivers-y := drivers/ sound/
drivers-$(CONFIG_SAMPLES) += samples/
drivers-y += net/ virt/
drivers-$(CONFIG_NET) += net/
drivers-y += virt/
libs-y := lib/
endif # KBUILD_EXTMOD