Makefile (abfe041de01f16d74df522d92cf5e3f6523971dd) Makefile (d92cc4d5164398cc6d191084b46e622976c0ba89)
1# SPDX-License-Identifier: GPL-2.0
2VERSION = 5
3PATCHLEVEL = 13
4SUBLEVEL = 0
1# SPDX-License-Identifier: GPL-2.0
2VERSION = 5
3PATCHLEVEL = 13
4SUBLEVEL = 0
5EXTRAVERSION = -rc2
5EXTRAVERSION = -rc3
6NAME = Frozen Wasteland
7
8# *DOCUMENTATION*
9# To see a list of typical targets execute "make help"
10# More info can be located in ./README
11# Comments in this file are targeted only to the developer, do not
12# expect to learn how to build the kernel reading this file.
13

--- 639 unchanged lines hidden (view full) ---

653export KBUILD_MODULES KBUILD_BUILTIN
654
655ifdef need-config
656include include/config/auto.conf
657endif
658
659ifeq ($(KBUILD_EXTMOD),)
660# Objects we will link into vmlinux / subdirs we need to visit
6NAME = Frozen Wasteland
7
8# *DOCUMENTATION*
9# To see a list of typical targets execute "make help"
10# More info can be located in ./README
11# Comments in this file are targeted only to the developer, do not
12# expect to learn how to build the kernel reading this file.
13

--- 639 unchanged lines hidden (view full) ---

653export KBUILD_MODULES KBUILD_BUILTIN
654
655ifdef need-config
656include include/config/auto.conf
657endif
658
659ifeq ($(KBUILD_EXTMOD),)
660# Objects we will link into vmlinux / subdirs we need to visit
661core-y := init/ usr/
661core-y := init/ usr/ arch/$(SRCARCH)/
662drivers-y := drivers/ sound/
663drivers-$(CONFIG_SAMPLES) += samples/
664drivers-$(CONFIG_NET) += net/
665drivers-y += virt/
666libs-y := lib/
667endif # KBUILD_EXTMOD
668
669# The all: target is the default when no target is given on the

--- 278 unchanged lines hidden (view full) ---

948endif
949
950# If LTO flags are filtered out, we must also filter out CFI.
951CC_FLAGS_LTO += $(CC_FLAGS_CFI)
952KBUILD_CFLAGS += $(CC_FLAGS_CFI)
953export CC_FLAGS_CFI
954endif
955
662drivers-y := drivers/ sound/
663drivers-$(CONFIG_SAMPLES) += samples/
664drivers-$(CONFIG_NET) += net/
665drivers-y += virt/
666libs-y := lib/
667endif # KBUILD_EXTMOD
668
669# The all: target is the default when no target is given on the

--- 278 unchanged lines hidden (view full) ---

948endif
949
950# If LTO flags are filtered out, we must also filter out CFI.
951CC_FLAGS_LTO += $(CC_FLAGS_CFI)
952KBUILD_CFLAGS += $(CC_FLAGS_CFI)
953export CC_FLAGS_CFI
954endif
955
956ifdef CONFIG_DEBUG_FORCE_FUNCTION_ALIGN_32B
957KBUILD_CFLAGS += -falign-functions=32
956ifdef CONFIG_DEBUG_FORCE_FUNCTION_ALIGN_64B
957KBUILD_CFLAGS += -falign-functions=64
958endif
959
960# arch Makefile may override CC so keep this after arch Makefile is included
961NOSTDINC_FLAGS += -nostdinc -isystem $(shell $(CC) -print-file-name=include)
962
963# warn about C99 declaration after statement
964KBUILD_CFLAGS += -Wdeclaration-after-statement
965

--- 110 unchanged lines hidden (view full) ---

1076# INSTALL_MOD_PATH specifies a prefix to MODLIB for module directory
1077# relocations required by build roots. This is not defined in the
1078# makefile but the argument can be passed to make if needed.
1079#
1080
1081MODLIB = $(INSTALL_MOD_PATH)/lib/modules/$(KERNELRELEASE)
1082export MODLIB
1083
958endif
959
960# arch Makefile may override CC so keep this after arch Makefile is included
961NOSTDINC_FLAGS += -nostdinc -isystem $(shell $(CC) -print-file-name=include)
962
963# warn about C99 declaration after statement
964KBUILD_CFLAGS += -Wdeclaration-after-statement
965

--- 110 unchanged lines hidden (view full) ---

1076# INSTALL_MOD_PATH specifies a prefix to MODLIB for module directory
1077# relocations required by build roots. This is not defined in the
1078# makefile but the argument can be passed to make if needed.
1079#
1080
1081MODLIB = $(INSTALL_MOD_PATH)/lib/modules/$(KERNELRELEASE)
1082export MODLIB
1083
1084HOST_LIBELF_LIBS = $(shell pkg-config libelf --libs 2>/dev/null || echo -lelf)
1085
1086has_libelf = $(call try-run,\
1087 echo "int main() {}" | $(HOSTCC) $(KBUILD_HOSTLDFLAGS) -xc -o /dev/null $(HOST_LIBELF_LIBS) -,1,0)
1088
1089ifdef CONFIG_STACK_VALIDATION
1090 ifeq ($(has_libelf),1)
1091 objtool_target := tools/objtool FORCE
1092 else
1093 SKIP_STACK_VALIDATION := 1
1094 export SKIP_STACK_VALIDATION
1095 endif
1096endif
1097
1098PHONY += resolve_btfids_clean
1099
1100resolve_btfids_O = $(abspath $(objtree))/tools/bpf/resolve_btfids
1101
1102# tools/bpf/resolve_btfids directory might not exist
1103# in output directory, skip its clean in that case
1104resolve_btfids_clean:
1105ifneq ($(wildcard $(resolve_btfids_O)),)
1106 $(Q)$(MAKE) -sC $(srctree)/tools/bpf/resolve_btfids O=$(resolve_btfids_O) clean
1107endif
1108
1109ifdef CONFIG_BPF
1110ifdef CONFIG_DEBUG_INFO_BTF
1111 ifeq ($(has_libelf),1)
1112 resolve_btfids_target := tools/bpf/resolve_btfids FORCE
1113 else
1114 ERROR_RESOLVE_BTFIDS := 1
1115 endif
1116endif # CONFIG_DEBUG_INFO_BTF
1117endif # CONFIG_BPF
1118
1119PHONY += prepare0
1120
1121export extmod_prefix = $(if $(KBUILD_EXTMOD),$(KBUILD_EXTMOD)/)
1122export MODORDER := $(extmod_prefix)modules.order
1123export MODULES_NSDEPS := $(extmod_prefix)modules.nsdeps
1124
1125ifeq ($(KBUILD_EXTMOD),)
1126core-y += kernel/ certs/ mm/ fs/ ipc/ security/ crypto/ block/

--- 95 unchanged lines hidden (view full) ---

1222 asm-generic $(version_h) $(autoksyms_h) include/generated/utsrelease.h \
1223 include/generated/autoconf.h remove-stale-files
1224
1225prepare0: archprepare
1226 $(Q)$(MAKE) $(build)=scripts/mod
1227 $(Q)$(MAKE) $(build)=.
1228
1229# All the preparing..
1084PHONY += prepare0
1085
1086export extmod_prefix = $(if $(KBUILD_EXTMOD),$(KBUILD_EXTMOD)/)
1087export MODORDER := $(extmod_prefix)modules.order
1088export MODULES_NSDEPS := $(extmod_prefix)modules.nsdeps
1089
1090ifeq ($(KBUILD_EXTMOD),)
1091core-y += kernel/ certs/ mm/ fs/ ipc/ security/ crypto/ block/

--- 95 unchanged lines hidden (view full) ---

1187 asm-generic $(version_h) $(autoksyms_h) include/generated/utsrelease.h \
1188 include/generated/autoconf.h remove-stale-files
1189
1190prepare0: archprepare
1191 $(Q)$(MAKE) $(build)=scripts/mod
1192 $(Q)$(MAKE) $(build)=.
1193
1194# All the preparing..
1230prepare: prepare0 prepare-objtool prepare-resolve_btfids
1195prepare: prepare0
1231
1232PHONY += remove-stale-files
1233remove-stale-files:
1234 $(Q)$(srctree)/scripts/remove-stale-files
1235
1236# Support for using generic headers in asm-generic
1237asm-generic := -f $(srctree)/scripts/Makefile.asm-generic obj
1238
1239PHONY += asm-generic uapi-asm-generic
1240asm-generic: uapi-asm-generic
1241 $(Q)$(MAKE) $(asm-generic)=arch/$(SRCARCH)/include/generated/asm \
1242 generic=include/asm-generic
1243uapi-asm-generic:
1244 $(Q)$(MAKE) $(asm-generic)=arch/$(SRCARCH)/include/generated/uapi/asm \
1245 generic=include/uapi/asm-generic
1246
1196
1197PHONY += remove-stale-files
1198remove-stale-files:
1199 $(Q)$(srctree)/scripts/remove-stale-files
1200
1201# Support for using generic headers in asm-generic
1202asm-generic := -f $(srctree)/scripts/Makefile.asm-generic obj
1203
1204PHONY += asm-generic uapi-asm-generic
1205asm-generic: uapi-asm-generic
1206 $(Q)$(MAKE) $(asm-generic)=arch/$(SRCARCH)/include/generated/asm \
1207 generic=include/asm-generic
1208uapi-asm-generic:
1209 $(Q)$(MAKE) $(asm-generic)=arch/$(SRCARCH)/include/generated/uapi/asm \
1210 generic=include/uapi/asm-generic
1211
1247PHONY += prepare-objtool prepare-resolve_btfids
1248prepare-objtool: $(objtool_target)
1249ifeq ($(SKIP_STACK_VALIDATION),1)
1250ifdef CONFIG_FTRACE_MCOUNT_USE_OBJTOOL
1251 @echo "error: Cannot generate __mcount_loc for CONFIG_DYNAMIC_FTRACE=y, please install libelf-dev, libelf-devel or elfutils-libelf-devel" >&2
1252 @false
1253endif
1254ifdef CONFIG_UNWINDER_ORC
1255 @echo "error: Cannot generate ORC metadata for CONFIG_UNWINDER_ORC=y, please install libelf-dev, libelf-devel or elfutils-libelf-devel" >&2
1256 @false
1257else
1258 @echo "warning: Cannot use CONFIG_STACK_VALIDATION=y, please install libelf-dev, libelf-devel or elfutils-libelf-devel" >&2
1259endif
1260endif
1261
1262prepare-resolve_btfids: $(resolve_btfids_target)
1263ifeq ($(ERROR_RESOLVE_BTFIDS),1)
1264 @echo "error: Cannot resolve BTF IDs for CONFIG_DEBUG_INFO_BTF, please install libelf-dev, libelf-devel or elfutils-libelf-devel" >&2
1265 @false
1266endif
1267# Generate some files
1268# ---------------------------------------------------------------------------
1269
1270# KERNELRELEASE can change from a few different places, meaning version.h
1271# needs to be updated, so this check is forced on all builds
1272
1273uts_len := 64
1274define filechk_utsrelease.h

--- 72 unchanged lines hidden (view full) ---

1347prepare: headers
1348endif
1349
1350PHONY += scripts_unifdef
1351scripts_unifdef: scripts_basic
1352 $(Q)$(MAKE) $(build)=scripts scripts/unifdef
1353
1354# ---------------------------------------------------------------------------
1212# Generate some files
1213# ---------------------------------------------------------------------------
1214
1215# KERNELRELEASE can change from a few different places, meaning version.h
1216# needs to be updated, so this check is forced on all builds
1217
1218uts_len := 64
1219define filechk_utsrelease.h

--- 72 unchanged lines hidden (view full) ---

1292prepare: headers
1293endif
1294
1295PHONY += scripts_unifdef
1296scripts_unifdef: scripts_basic
1297 $(Q)$(MAKE) $(build)=scripts scripts/unifdef
1298
1299# ---------------------------------------------------------------------------
1300# Tools
1301
1302ifdef CONFIG_STACK_VALIDATION
1303prepare: tools/objtool
1304endif
1305
1306ifdef CONFIG_BPF
1307ifdef CONFIG_DEBUG_INFO_BTF
1308prepare: tools/bpf/resolve_btfids
1309endif
1310endif
1311
1312PHONY += resolve_btfids_clean
1313
1314resolve_btfids_O = $(abspath $(objtree))/tools/bpf/resolve_btfids
1315
1316# tools/bpf/resolve_btfids directory might not exist
1317# in output directory, skip its clean in that case
1318resolve_btfids_clean:
1319ifneq ($(wildcard $(resolve_btfids_O)),)
1320 $(Q)$(MAKE) -sC $(srctree)/tools/bpf/resolve_btfids O=$(resolve_btfids_O) clean
1321endif
1322
1323# Clear a bunch of variables before executing the submake
1324ifeq ($(quiet),silent_)
1325tools_silent=s
1326endif
1327
1328tools/: FORCE
1329 $(Q)mkdir -p $(objtree)/tools
1330 $(Q)$(MAKE) LDFLAGS= MAKEFLAGS="$(tools_silent) $(filter --j% -j,$(MAKEFLAGS))" O=$(abspath $(objtree)) subdir=tools -C $(srctree)/tools/
1331
1332tools/%: FORCE
1333 $(Q)mkdir -p $(objtree)/tools
1334 $(Q)$(MAKE) LDFLAGS= MAKEFLAGS="$(tools_silent) $(filter --j% -j,$(MAKEFLAGS))" O=$(abspath $(objtree)) subdir=tools -C $(srctree)/tools/ $*
1335
1336# ---------------------------------------------------------------------------
1355# Kernel selftest
1356
1357PHONY += kselftest
1358kselftest:
1359 $(Q)$(MAKE) -C $(srctree)/tools/testing/selftests run_tests
1360
1361kselftest-%: FORCE
1362 $(Q)$(MAKE) -C $(srctree)/tools/testing/selftests $*

--- 583 unchanged lines hidden (view full) ---

1946 @echo "$(KERNELVERSION)$$($(CONFIG_SHELL) $(srctree)/scripts/setlocalversion $(srctree))"
1947
1948kernelversion:
1949 @echo $(KERNELVERSION)
1950
1951image_name:
1952 @echo $(KBUILD_IMAGE)
1953
1337# Kernel selftest
1338
1339PHONY += kselftest
1340kselftest:
1341 $(Q)$(MAKE) -C $(srctree)/tools/testing/selftests run_tests
1342
1343kselftest-%: FORCE
1344 $(Q)$(MAKE) -C $(srctree)/tools/testing/selftests $*

--- 583 unchanged lines hidden (view full) ---

1928 @echo "$(KERNELVERSION)$$($(CONFIG_SHELL) $(srctree)/scripts/setlocalversion $(srctree))"
1929
1930kernelversion:
1931 @echo $(KERNELVERSION)
1932
1933image_name:
1934 @echo $(KBUILD_IMAGE)
1935
1954# Clear a bunch of variables before executing the submake
1955
1956ifeq ($(quiet),silent_)
1957tools_silent=s
1958endif
1959
1960tools/: FORCE
1961 $(Q)mkdir -p $(objtree)/tools
1962 $(Q)$(MAKE) LDFLAGS= MAKEFLAGS="$(tools_silent) $(filter --j% -j,$(MAKEFLAGS))" O=$(abspath $(objtree)) subdir=tools -C $(srctree)/tools/
1963
1964tools/%: FORCE
1965 $(Q)mkdir -p $(objtree)/tools
1966 $(Q)$(MAKE) LDFLAGS= MAKEFLAGS="$(tools_silent) $(filter --j% -j,$(MAKEFLAGS))" O=$(abspath $(objtree)) subdir=tools -C $(srctree)/tools/ $*
1967
1968quiet_cmd_rmfiles = $(if $(wildcard $(rm-files)),CLEAN $(wildcard $(rm-files)))
1969 cmd_rmfiles = rm -rf $(rm-files)
1970
1971# read saved command lines for existing targets
1972existing-targets := $(wildcard $(sort $(targets)))
1973
1974-include $(foreach f,$(existing-targets),$(dir $(f)).$(notdir $(f)).cmd)
1975
1976endif # config-build
1977endif # mixed-build
1978endif # need-sub-make
1979
1980PHONY += FORCE
1981FORCE:
1982
1983# Declare the contents of the PHONY variable as phony. We keep that
1984# information in a variable so we can use it in if_changed and friends.
1985.PHONY: $(PHONY)
1936quiet_cmd_rmfiles = $(if $(wildcard $(rm-files)),CLEAN $(wildcard $(rm-files)))
1937 cmd_rmfiles = rm -rf $(rm-files)
1938
1939# read saved command lines for existing targets
1940existing-targets := $(wildcard $(sort $(targets)))
1941
1942-include $(foreach f,$(existing-targets),$(dir $(f)).$(notdir $(f)).cmd)
1943
1944endif # config-build
1945endif # mixed-build
1946endif # need-sub-make
1947
1948PHONY += FORCE
1949FORCE:
1950
1951# Declare the contents of the PHONY variable as phony. We keep that
1952# information in a variable so we can use it in if_changed and friends.
1953.PHONY: $(PHONY)