Commit 8b5f4eb3 authored by Masahiro Yamada's avatar Masahiro Yamada Committed by Jakub Kicinski

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: default avatarMasahiro Yamada <masahiroy@kernel.org>
Link: https://lore.kernel.org/r/20210125231659.106201-1-masahiroy@kernel.orgSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 69783429
...@@ -649,7 +649,8 @@ ifeq ($(KBUILD_EXTMOD),) ...@@ -649,7 +649,8 @@ ifeq ($(KBUILD_EXTMOD),)
core-y := init/ usr/ core-y := init/ usr/
drivers-y := drivers/ sound/ drivers-y := drivers/ sound/
drivers-$(CONFIG_SAMPLES) += samples/ drivers-$(CONFIG_SAMPLES) += samples/
drivers-y += net/ virt/ drivers-$(CONFIG_NET) += net/
drivers-y += virt/
libs-y := lib/ libs-y := lib/
endif # KBUILD_EXTMOD endif # KBUILD_EXTMOD
......
...@@ -6,20 +6,19 @@ ...@@ -6,20 +6,19 @@
# Rewritten to use lists instead of if-statements. # Rewritten to use lists instead of if-statements.
# #
obj-$(CONFIG_NET) := devres.o socket.o core/ obj-y := devres.o socket.o core/
tmp-$(CONFIG_COMPAT) := compat.o obj-$(CONFIG_COMPAT) += compat.o
obj-$(CONFIG_NET) += $(tmp-y)
# LLC has to be linked before the files in net/802/ # LLC has to be linked before the files in net/802/
obj-$(CONFIG_LLC) += llc/ obj-$(CONFIG_LLC) += llc/
obj-$(CONFIG_NET) += ethernet/ 802/ sched/ netlink/ bpf/ ethtool/ obj-y += ethernet/ 802/ sched/ netlink/ bpf/ ethtool/
obj-$(CONFIG_NETFILTER) += netfilter/ obj-$(CONFIG_NETFILTER) += netfilter/
obj-$(CONFIG_INET) += ipv4/ obj-$(CONFIG_INET) += ipv4/
obj-$(CONFIG_TLS) += tls/ obj-$(CONFIG_TLS) += tls/
obj-$(CONFIG_XFRM) += xfrm/ obj-$(CONFIG_XFRM) += xfrm/
obj-$(CONFIG_UNIX_SCM) += unix/ obj-$(CONFIG_UNIX_SCM) += unix/
obj-$(CONFIG_NET) += ipv6/ obj-y += ipv6/
obj-$(CONFIG_BPFILTER) += bpfilter/ obj-$(CONFIG_BPFILTER) += bpfilter/
obj-$(CONFIG_PACKET) += packet/ obj-$(CONFIG_PACKET) += packet/
obj-$(CONFIG_NET_KEY) += key/ obj-$(CONFIG_NET_KEY) += key/
...@@ -63,9 +62,7 @@ obj-$(CONFIG_6LOWPAN) += 6lowpan/ ...@@ -63,9 +62,7 @@ obj-$(CONFIG_6LOWPAN) += 6lowpan/
obj-$(CONFIG_IEEE802154) += ieee802154/ obj-$(CONFIG_IEEE802154) += ieee802154/
obj-$(CONFIG_MAC802154) += mac802154/ obj-$(CONFIG_MAC802154) += mac802154/
ifeq ($(CONFIG_NET),y)
obj-$(CONFIG_SYSCTL) += sysctl_net.o obj-$(CONFIG_SYSCTL) += sysctl_net.o
endif
obj-$(CONFIG_DNS_RESOLVER) += dns_resolver/ obj-$(CONFIG_DNS_RESOLVER) += dns_resolver/
obj-$(CONFIG_CEPH_LIB) += ceph/ obj-$(CONFIG_CEPH_LIB) += ceph/
obj-$(CONFIG_BATMAN_ADV) += batman-adv/ obj-$(CONFIG_BATMAN_ADV) += batman-adv/
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment