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 14*e30f8e61SSteven Rostedthostprogs-always-$(CONFIG_TRACEPOINTS) += tracepoint-update 152f7ab126SMiguel Ojeda 16b055f4c4SSteven Rostedtsorttable-objs := sorttable.o elf-parse.o 17*e30f8e61SSteven Rostedttracepoint-update-objs := tracepoint-update.o elf-parse.o 18b055f4c4SSteven Rostedt 19ab0f4cedSDavid Gowifneq ($(or $(CONFIG_X86_64),$(CONFIG_X86_32)),) 20f82811e2SJamie Cunliffealways-$(CONFIG_RUST) += target.json 21c83b16ceSMasahiro Yamadafilechk_rust_target = $< < include/config/auto.conf 22c83b16ceSMasahiro Yamada 23c83b16ceSMasahiro Yamada$(obj)/target.json: scripts/generate_rust_target include/config/auto.conf FORCE 24c83b16ceSMasahiro Yamada $(call filechk,rust_target) 25f82811e2SJamie Cunliffeendif 26c83b16ceSMasahiro Yamada 27c83b16ceSMasahiro Yamadahostprogs += generate_rust_target 282f7ab126SMiguel Ojedagenerate_rust_target-rust := y 29a66d733dSMiguel Ojedarustdoc_test_builder-rust := y 30a66d733dSMiguel Ojedarustdoc_test_gen-rust := y 311da177e4SLinus Torvalds 32*e30f8e61SSteven RostedtHOSTCFLAGS_tracepoint-update.o = -I$(srctree)/tools/include 33b055f4c4SSteven RostedtHOSTCFLAGS_elf-parse.o = -I$(srctree)/tools/include 3410916706SShile ZhangHOSTCFLAGS_sorttable.o = -I$(srctree)/tools/include 3572b3942aSYinan LiuHOSTLDLIBS_sorttable = -lpthread 364520c6a4SDavid HowellsHOSTCFLAGS_asn1_compiler.o = -I$(srctree)/include 37d5ea4fecSChun-Tse ShaoHOSTCFLAGS_sign-file.o = $(shell $(HOSTPKG_CONFIG) --cflags libcrypto 2> /dev/null) 38d5ea4fecSChun-Tse ShaoHOSTLDLIBS_sign-file = $(shell $(HOSTPKG_CONFIG) --libs libcrypto 2> /dev/null || echo -lcrypto) 391da177e4SLinus Torvalds 4057fa1899SShile Zhangifdef CONFIG_UNWINDER_ORC 4157fa1899SShile Zhangifeq ($(ARCH),x86_64) 42cb8a2ef0STiezhu YangSRCARCH := x86 4357fa1899SShile Zhangendif 44cb8a2ef0STiezhu Yangifeq ($(ARCH),loongarch) 45cb8a2ef0STiezhu YangSRCARCH := loongarch 46cb8a2ef0STiezhu Yangendif 47cb8a2ef0STiezhu YangHOSTCFLAGS_sorttable.o += -I$(srctree)/tools/arch/$(SRCARCH)/include 4857fa1899SShile ZhangHOSTCFLAGS_sorttable.o += -DUNWINDER_ORC_ENABLED 4972b3942aSYinan Liuendif 5072b3942aSYinan Liu 514ed308c4SSteven Rostedt (Google)ifdef CONFIG_BUILDTIME_MCOUNT_SORT 5272b3942aSYinan LiuHOSTCFLAGS_sorttable.o += -DMCOUNT_SORT_ENABLED 5357fa1899SShile Zhangendif 5457fa1899SShile Zhang 555f2fb52fSMasahiro Yamada# The following programs are only built on demand 5641d7ea30SVladimir Olteanhostprogs += unifdef gen_packed_field_checks 5707aea3a7SSam Ravnborg 58596b0474SMasahiro Yamada# The module linker script is preprocessed on demand 59596b0474SMasahiro Yamadatargets += module.lds 60596b0474SMasahiro Yamada 61ce2fd53aSMasahiro Yamadasubdir-$(CONFIG_GCC_PLUGINS) += gcc-plugins 629c3681f9SSami Tolvanensubdir-$(CONFIG_GENKSYMS) += genksyms 63f2856884SSami Tolvanensubdir-$(CONFIG_GENDWARFKSYMS) += gendwarfksyms 6493c06cbbSSerge E. Hallynsubdir-$(CONFIG_SECURITY_SELINUX) += selinux 65ba199dc9SDeven Bowerssubdir-$(CONFIG_SECURITY_IPE) += ipe 661da177e4SLinus Torvalds 671da177e4SLinus Torvalds# Let clean descend into subdirs 6846a63d4bSMasahiro Yamadasubdir- += basic dtc gdb kconfig mod 69