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_BUILD_BIN2C) += bin2c 7faabed29SMasahiro Yamadahostprogs-always-$(CONFIG_KALLSYMS) += kallsyms 8faabed29SMasahiro Yamadahostprogs-always-$(BUILD_C_RECORDMCOUNT) += recordmcount 9faabed29SMasahiro Yamadahostprogs-always-$(CONFIG_BUILDTIME_TABLE_SORT) += sorttable 10faabed29SMasahiro Yamadahostprogs-always-$(CONFIG_ASN1) += asn1_compiler 11faabed29SMasahiro Yamadahostprogs-always-$(CONFIG_MODULE_SIG_FORMAT) += sign-file 12faabed29SMasahiro Yamadahostprogs-always-$(CONFIG_SYSTEM_EXTRA_CERTIFICATE) += insert-sys-cert 13*c83b16ceSMasahiro Yamadaalways-$(CONFIG_RUST) += target.json 142f7ab126SMiguel Ojeda 15*c83b16ceSMasahiro Yamadafilechk_rust_target = $< < include/config/auto.conf 16*c83b16ceSMasahiro Yamada 17*c83b16ceSMasahiro Yamada$(obj)/target.json: scripts/generate_rust_target include/config/auto.conf FORCE 18*c83b16ceSMasahiro Yamada $(call filechk,rust_target) 19*c83b16ceSMasahiro Yamada 20*c83b16ceSMasahiro Yamadahostprogs += generate_rust_target 212f7ab126SMiguel Ojedagenerate_rust_target-rust := y 221da177e4SLinus Torvalds 2310916706SShile ZhangHOSTCFLAGS_sorttable.o = -I$(srctree)/tools/include 2472b3942aSYinan LiuHOSTLDLIBS_sorttable = -lpthread 254520c6a4SDavid HowellsHOSTCFLAGS_asn1_compiler.o = -I$(srctree)/include 26d5ea4fecSChun-Tse ShaoHOSTCFLAGS_sign-file.o = $(shell $(HOSTPKG_CONFIG) --cflags libcrypto 2> /dev/null) 27d5ea4fecSChun-Tse ShaoHOSTLDLIBS_sign-file = $(shell $(HOSTPKG_CONFIG) --libs libcrypto 2> /dev/null || echo -lcrypto) 281da177e4SLinus Torvalds 2957fa1899SShile Zhangifdef CONFIG_UNWINDER_ORC 3057fa1899SShile Zhangifeq ($(ARCH),x86_64) 3157fa1899SShile ZhangARCH := x86 3257fa1899SShile Zhangendif 3357fa1899SShile ZhangHOSTCFLAGS_sorttable.o += -I$(srctree)/tools/arch/x86/include 3457fa1899SShile ZhangHOSTCFLAGS_sorttable.o += -DUNWINDER_ORC_ENABLED 3572b3942aSYinan Liuendif 3672b3942aSYinan Liu 374ed308c4SSteven Rostedt (Google)ifdef CONFIG_BUILDTIME_MCOUNT_SORT 3872b3942aSYinan LiuHOSTCFLAGS_sorttable.o += -DMCOUNT_SORT_ENABLED 3957fa1899SShile Zhangendif 4057fa1899SShile Zhang 415f2fb52fSMasahiro Yamada# The following programs are only built on demand 425f2fb52fSMasahiro Yamadahostprogs += unifdef 4307aea3a7SSam Ravnborg 44596b0474SMasahiro Yamada# The module linker script is preprocessed on demand 45596b0474SMasahiro Yamadatargets += module.lds 46596b0474SMasahiro Yamada 47ce2fd53aSMasahiro Yamadasubdir-$(CONFIG_GCC_PLUGINS) += gcc-plugins 481da177e4SLinus Torvaldssubdir-$(CONFIG_MODVERSIONS) += genksyms 4993c06cbbSSerge E. Hallynsubdir-$(CONFIG_SECURITY_SELINUX) += selinux 501da177e4SLinus Torvalds 511da177e4SLinus Torvalds# Let clean descend into subdirs 5246a63d4bSMasahiro Yamadasubdir- += basic dtc gdb kconfig mod 53