@@ -676,11 +676,8 @@ endif
676
676
677
677
ifeq ($(KBUILD_EXTMOD ) ,)
678
678
# Objects we will link into vmlinux / subdirs we need to visit
679
- core-y := init/ usr/ arch/$(SRCARCH ) /
680
- drivers-y := drivers/ sound/
681
- drivers-$(CONFIG_SAMPLES) += samples/
682
- drivers-$(CONFIG_NET) += net/
683
- drivers-y += virt/
679
+ core-y :=
680
+ drivers-y :=
684
681
libs-y := lib/
685
682
endif # KBUILD_EXTMOD
686
683
@@ -1099,31 +1096,24 @@ export MODORDER := $(extmod_prefix)modules.order
1099
1096
export MODULES_NSDEPS := $(extmod_prefix ) modules.nsdeps
1100
1097
1101
1098
ifeq ($(KBUILD_EXTMOD ) ,)
1102
- core-y += kernel/ certs/ mm/ fs/ ipc/ security/ crypto/
1103
- core-$(CONFIG_BLOCK) += block/
1104
- core-$(CONFIG_IO_URING) += io_uring/
1105
1099
1106
- vmlinux-dirs := $(patsubst % /,% ,$(filter % /, \
1107
- $(core-y ) $(core-m ) $(drivers-y ) $(drivers-m ) \
1108
- $(libs-y ) $(libs-m ) ) )
1109
-
1110
- build-dirs := $(vmlinux-dirs )
1111
- clean-dirs := $(sort $(vmlinux-dirs ) Documentation . \
1100
+ build-dir := .
1101
+ clean-dirs := $(sort . Documentation \
1112
1102
$(patsubst % /,% ,$(filter % /, $(core- ) \
1113
1103
$(drivers- ) $(libs- ) ) ) )
1114
1104
1115
- subdir-modorder := $(addsuffix /modules.order, $(build-dirs ) )
1116
-
1105
+ export ARCH_CORE := $(core-y )
1106
+ export ARCH_LIB := $(filter % /, $(libs-y ) )
1107
+ export ARCH_DRIVERS := $(drivers-y ) $(drivers-m )
1117
1108
# Externally visible symbols (used by link-vmlinux.sh)
1118
- KBUILD_VMLINUX_OBJS := $( head-y ) $( patsubst % /, % /built-in.a, $( core-y ) )
1119
- KBUILD_VMLINUX_OBJS + = $(addsuffix built-in.a, $( filter % /, $( libs-y ) ) )
1109
+
1110
+ KBUILD_VMLINUX_OBJS : = $(head-y ) ./ built-in.a
1120
1111
ifdef CONFIG_MODULES
1121
1112
KBUILD_VMLINUX_OBJS += $(patsubst % /, % /lib.a, $(filter % /, $(libs-y ) ) )
1122
1113
KBUILD_VMLINUX_LIBS := $(filter-out % /, $(libs-y ) )
1123
1114
else
1124
1115
KBUILD_VMLINUX_LIBS := $(patsubst % /,% /lib.a, $(libs-y ) )
1125
1116
endif
1126
- KBUILD_VMLINUX_OBJS += $(patsubst % /,% /built-in.a, $(drivers-y ) )
1127
1117
1128
1118
export KBUILD_VMLINUX_OBJS KBUILD_VMLINUX_LIBS
1129
1119
export KBUILD_LDS := arch/$(SRCARCH ) /kernel/vmlinux.lds
@@ -1138,7 +1128,7 @@ ifdef CONFIG_TRIM_UNUSED_KSYMS
1138
1128
# (this can be evaluated only once include/config/auto.conf has been included)
1139
1129
KBUILD_MODULES := 1
1140
1130
1141
- autoksyms_recursive : descend modules.order
1131
+ autoksyms_recursive : $( build-dir ) modules.order
1142
1132
$(Q )$(CONFIG_SHELL ) $(srctree ) /scripts/adjust_autoksyms.sh \
1143
1133
" $( MAKE) -f $( srctree) /Makefile autoksyms_recursive"
1144
1134
endif
@@ -1166,7 +1156,7 @@ targets := vmlinux
1166
1156
1167
1157
# The actual objects are generated when descending,
1168
1158
# make sure no implicit rule kicks in
1169
- $(sort $(vmlinux-deps ) $( subdir-modorder ) ) : descend ;
1159
+ $(sort $(vmlinux-deps ) ) : . ;
1170
1160
1171
1161
filechk_kernel.release = \
1172
1162
echo "$(KERNELVERSION )$$($(CONFIG_SHELL ) $(srctree ) /scripts/setlocalversion $(srctree ) ) "
@@ -1437,13 +1427,6 @@ endif
1437
1427
1438
1428
modules : $(if $(KBUILD_BUILTIN ) ,vmlinux) modules_prepare
1439
1429
1440
- cmd_modules_order = cat $(real-prereqs ) > $@
1441
-
1442
- modules.order : $(subdir-modorder ) FORCE
1443
- $(call if_changed,modules_order)
1444
-
1445
- targets += modules.order
1446
-
1447
1430
# Target to prepare building external modules
1448
1431
modules_prepare : prepare
1449
1432
$(Q )$(MAKE ) $(build ) =scripts scripts/module.lds
@@ -1714,9 +1697,7 @@ else # KBUILD_EXTMOD
1714
1697
KBUILD_BUILTIN :=
1715
1698
KBUILD_MODULES := 1
1716
1699
1717
- build-dirs := $(KBUILD_EXTMOD )
1718
- $(MODORDER ) : descend
1719
- @:
1700
+ build-dir := $(KBUILD_EXTMOD )
1720
1701
1721
1702
compile_commands.json : $(extmod_prefix ) compile_commands.json
1722
1703
PHONY += compile_commands.json
@@ -1754,6 +1735,9 @@ PHONY += modules modules_install modules_prepare
1754
1735
1755
1736
ifdef CONFIG_MODULES
1756
1737
1738
+ $(MODORDER ) : $(build-dir )
1739
+ @:
1740
+
1757
1741
modules : modules_check
1758
1742
$(Q )$(MAKE ) -f $(srctree ) /scripts/Makefile.modpost
1759
1743
@@ -1807,7 +1791,7 @@ single-no-ko := $(filter-out $(single-ko), $(MAKECMDGOALS)) \
1807
1791
1808
1792
$(single-ko ) : single_modpost
1809
1793
@:
1810
- $(single-no-ko ) : descend
1794
+ $(single-no-ko ) : $( build-dir )
1811
1795
@:
1812
1796
1813
1797
# Remove MODORDER when done because it is not the real one.
@@ -1817,24 +1801,17 @@ single_modpost: $(single-no-ko) modules_prepare
1817
1801
$(Q )$(MAKE ) -f $(srctree ) /scripts/Makefile.modpost
1818
1802
$(Q ) rm -f $(MODORDER )
1819
1803
1820
- single-goals := $(addprefix $(extmod_prefix ) , $(single-no-ko ) )
1821
-
1822
- # trim unrelated directories
1823
- build-dirs := $(foreach d, $(build-dirs ) , \
1824
- $(if $(filter $d/% , $(single-goals ) ) , $d) )
1804
+ single-goals := $(addprefix $(build-dir ) /, $(single-no-ko ) )
1825
1805
1826
1806
endif
1827
1807
1828
- # Handle descending into subdirectories listed in $(build-dirs)
1829
1808
# Preset locale variables to speed up the build process. Limit locale
1830
1809
# tweaks to this spot to avoid wrong language settings when running
1831
1810
# make menuconfig etc.
1832
1811
# Error messages still appears in the original language
1833
- PHONY += descend $(build-dirs )
1834
- descend : $(build-dirs )
1835
- $(build-dirs ) : prepare
1836
- $(Q )$(MAKE ) $(build ) =$@ need-builtin=1 need-modorder=1 \
1837
- $(filter $@ /% , $(single-goals ) )
1812
+ PHONY += $(build-dir )
1813
+ $(build-dir ) : prepare
1814
+ $(Q )$(MAKE ) $(build ) =$@ need-builtin=1 need-modorder=1 $(single-goals )
1838
1815
1839
1816
clean-dirs := $(addprefix _clean_, $(clean-dirs ) )
1840
1817
PHONY += $(clean-dirs ) clean
0 commit comments