1b2441318SGreg Kroah-Hartman# SPDX-License-Identifier: GPL-2.0 21da177e4SLinus Torvalds### 31da177e4SLinus Torvalds# scripts contains sources for various helper programs used throughout 41da177e4SLinus Torvalds# the kernel for the build process. 56520fe55SH. Peter Anvin 6faabed29SMasahiro Yamadahostprogs-always-$(CONFIG_KALLSYMS) += kallsyms 7faabed29SMasahiro Yamadahostprogs-always-$(BUILD_C_RECORDMCOUNT) += recordmcount 8faabed29SMasahiro Yamadahostprogs-always-$(CONFIG_BUILDTIME_TABLE_SORT) += sorttable 9faabed29SMasahiro Yamadahostprogs-always-$(CONFIG_ASN1) += asn1_compiler 10faabed29SMasahiro Yamadahostprogs-always-$(CONFIG_MODULE_SIG_FORMAT) += sign-file 11faabed29SMasahiro Yamadahostprogs-always-$(CONFIG_SYSTEM_EXTRA_CERTIFICATE) += insert-sys-cert 12a66d733dSMiguel Ojedahostprogs-always-$(CONFIG_RUST_KERNEL_DOCTESTS) += rustdoc_test_builder 13a66d733dSMiguel Ojedahostprogs-always-$(CONFIG_RUST_KERNEL_DOCTESTS) += rustdoc_test_gen 14c83b16ceSMasahiro Yamadaalways-$(CONFIG_RUST) += target.json 152f7ab126SMiguel Ojeda 16c83b16ceSMasahiro Yamadafilechk_rust_target = $< < include/config/auto.conf 17c83b16ceSMasahiro Yamada 18c83b16ceSMasahiro Yamada$(obj)/target.json: scripts/generate_rust_target include/config/auto.conf FORCE 19c83b16ceSMasahiro Yamada $(call filechk,rust_target) 20c83b16ceSMasahiro Yamada 21c83b16ceSMasahiro Yamadahostprogs += generate_rust_target 222f7ab126SMiguel Ojedagenerate_rust_target-rust := y 23a66d733dSMiguel Ojedarustdoc_test_builder-rust := y 24a66d733dSMiguel Ojedarustdoc_test_gen-rust := y 251da177e4SLinus Torvalds 2610916706SShile ZhangHOSTCFLAGS_sorttable.o = -I$(srctree)/tools/include 2772b3942aSYinan LiuHOSTLDLIBS_sorttable = -lpthread 284520c6a4SDavid HowellsHOSTCFLAGS_asn1_compiler.o = -I$(srctree)/include 29d5ea4fecSChun-Tse ShaoHOSTCFLAGS_sign-file.o = $(shell $(HOSTPKG_CONFIG) --cflags libcrypto 2> /dev/null) 30d5ea4fecSChun-Tse ShaoHOSTLDLIBS_sign-file = $(shell $(HOSTPKG_CONFIG) --libs libcrypto 2> /dev/null || echo -lcrypto) 311da177e4SLinus Torvalds 3257fa1899SShile Zhangifdef CONFIG_UNWINDER_ORC 3357fa1899SShile Zhangifeq ($(ARCH),x86_64) 34*cb8a2ef0STiezhu YangSRCARCH := x86 3557fa1899SShile Zhangendif 36*cb8a2ef0STiezhu Yangifeq ($(ARCH),loongarch) 37*cb8a2ef0STiezhu YangSRCARCH := loongarch 38*cb8a2ef0STiezhu Yangendif 39*cb8a2ef0STiezhu YangHOSTCFLAGS_sorttable.o += -I$(srctree)/tools/arch/$(SRCARCH)/include 4057fa1899SShile ZhangHOSTCFLAGS_sorttable.o += -DUNWINDER_ORC_ENABLED 4172b3942aSYinan Liuendif 4272b3942aSYinan Liu 434ed308c4SSteven Rostedt (Google)ifdef CONFIG_BUILDTIME_MCOUNT_SORT 4472b3942aSYinan LiuHOSTCFLAGS_sorttable.o += -DMCOUNT_SORT_ENABLED 4557fa1899SShile Zhangendif 4657fa1899SShile Zhang 475f2fb52fSMasahiro Yamada# The following programs are only built on demand 4805e96e96SMasahiro Yamadahostprogs += unifdef 4907aea3a7SSam Ravnborg 50596b0474SMasahiro Yamada# The module linker script is preprocessed on demand 51596b0474SMasahiro Yamadatargets += module.lds 52596b0474SMasahiro Yamada 53ce2fd53aSMasahiro Yamadasubdir-$(CONFIG_GCC_PLUGINS) += gcc-plugins 541da177e4SLinus Torvaldssubdir-$(CONFIG_MODVERSIONS) += genksyms 5593c06cbbSSerge E. Hallynsubdir-$(CONFIG_SECURITY_SELINUX) += selinux 561da177e4SLinus Torvalds 571da177e4SLinus Torvalds# Let clean descend into subdirs 5846a63d4bSMasahiro Yamadasubdir- += basic dtc gdb kconfig mod 59