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 12c83b16ceSMasahiro Yamadaalways-$(CONFIG_RUST) += target.json 132f7ab126SMiguel Ojeda 14c83b16ceSMasahiro Yamadafilechk_rust_target = $< < include/config/auto.conf 15c83b16ceSMasahiro Yamada 16c83b16ceSMasahiro Yamada$(obj)/target.json: scripts/generate_rust_target include/config/auto.conf FORCE 17c83b16ceSMasahiro Yamada $(call filechk,rust_target) 18c83b16ceSMasahiro Yamada 19c83b16ceSMasahiro Yamadahostprogs += generate_rust_target 202f7ab126SMiguel Ojedagenerate_rust_target-rust := y 211da177e4SLinus Torvalds 2210916706SShile ZhangHOSTCFLAGS_sorttable.o = -I$(srctree)/tools/include 2372b3942aSYinan LiuHOSTLDLIBS_sorttable = -lpthread 244520c6a4SDavid HowellsHOSTCFLAGS_asn1_compiler.o = -I$(srctree)/include 25d5ea4fecSChun-Tse ShaoHOSTCFLAGS_sign-file.o = $(shell $(HOSTPKG_CONFIG) --cflags libcrypto 2> /dev/null) 26d5ea4fecSChun-Tse ShaoHOSTLDLIBS_sign-file = $(shell $(HOSTPKG_CONFIG) --libs libcrypto 2> /dev/null || echo -lcrypto) 271da177e4SLinus Torvalds 2857fa1899SShile Zhangifdef CONFIG_UNWINDER_ORC 2957fa1899SShile Zhangifeq ($(ARCH),x86_64) 3057fa1899SShile ZhangARCH := x86 3157fa1899SShile Zhangendif 3257fa1899SShile ZhangHOSTCFLAGS_sorttable.o += -I$(srctree)/tools/arch/x86/include 3357fa1899SShile ZhangHOSTCFLAGS_sorttable.o += -DUNWINDER_ORC_ENABLED 3472b3942aSYinan Liuendif 3572b3942aSYinan Liu 364ed308c4SSteven Rostedt (Google)ifdef CONFIG_BUILDTIME_MCOUNT_SORT 3772b3942aSYinan LiuHOSTCFLAGS_sorttable.o += -DMCOUNT_SORT_ENABLED 3857fa1899SShile Zhangendif 3957fa1899SShile Zhang 405f2fb52fSMasahiro Yamada# The following programs are only built on demand 41*05e96e96SMasahiro Yamadahostprogs += unifdef 4207aea3a7SSam Ravnborg 43596b0474SMasahiro Yamada# The module linker script is preprocessed on demand 44596b0474SMasahiro Yamadatargets += module.lds 45596b0474SMasahiro Yamada 46ce2fd53aSMasahiro Yamadasubdir-$(CONFIG_GCC_PLUGINS) += gcc-plugins 471da177e4SLinus Torvaldssubdir-$(CONFIG_MODVERSIONS) += genksyms 4893c06cbbSSerge E. Hallynsubdir-$(CONFIG_SECURITY_SELINUX) += selinux 491da177e4SLinus Torvalds 501da177e4SLinus Torvalds# Let clean descend into subdirs 5146a63d4bSMasahiro Yamadasubdir- += basic dtc gdb kconfig mod 52