1*4882a593Smuzhiyun# SPDX-License-Identifier: GPL-2.0 2*4882a593Smuzhiyun### 3*4882a593Smuzhiyun# scripts contains sources for various helper programs used throughout 4*4882a593Smuzhiyun# the kernel for the build process. 5*4882a593Smuzhiyun 6*4882a593SmuzhiyunCRYPTO_LIBS = $(shell pkg-config --libs libcrypto 2> /dev/null || echo -lcrypto) 7*4882a593SmuzhiyunCRYPTO_CFLAGS = $(shell pkg-config --cflags libcrypto 2> /dev/null) 8*4882a593Smuzhiyun 9*4882a593Smuzhiyunhostprogs-always-$(CONFIG_BUILD_BIN2C) += bin2c 10*4882a593Smuzhiyunhostprogs-always-$(CONFIG_KALLSYMS) += kallsyms 11*4882a593Smuzhiyunhostprogs-always-$(BUILD_C_RECORDMCOUNT) += recordmcount 12*4882a593Smuzhiyunhostprogs-always-$(CONFIG_ARCH_ROCKCHIP) += resource_tool 13*4882a593Smuzhiyunhostprogs-always-$(CONFIG_BUILDTIME_TABLE_SORT) += sorttable 14*4882a593Smuzhiyunhostprogs-always-$(CONFIG_ASN1) += asn1_compiler 15*4882a593Smuzhiyunhostprogs-always-$(CONFIG_MODULE_SIG_FORMAT) += sign-file 16*4882a593Smuzhiyunhostprogs-always-$(CONFIG_SYSTEM_TRUSTED_KEYRING) += extract-cert 17*4882a593Smuzhiyunhostprogs-always-$(CONFIG_SYSTEM_EXTRA_CERTIFICATE) += insert-sys-cert 18*4882a593Smuzhiyunhostprogs-always-$(CONFIG_SYSTEM_REVOCATION_LIST) += extract-cert 19*4882a593Smuzhiyun 20*4882a593SmuzhiyunHOSTCFLAGS_sorttable.o = -I$(srctree)/tools/include 21*4882a593SmuzhiyunHOSTCFLAGS_asn1_compiler.o = -I$(srctree)/include 22*4882a593SmuzhiyunHOSTCFLAGS_sign-file.o = $(CRYPTO_CFLAGS) 23*4882a593SmuzhiyunHOSTLDLIBS_sign-file = $(CRYPTO_LIBS) 24*4882a593SmuzhiyunHOSTCFLAGS_extract-cert.o = $(CRYPTO_CFLAGS) 25*4882a593SmuzhiyunHOSTLDLIBS_extract-cert = $(CRYPTO_LIBS) 26*4882a593Smuzhiyun 27*4882a593Smuzhiyunifdef CONFIG_UNWINDER_ORC 28*4882a593Smuzhiyunifeq ($(ARCH),x86_64) 29*4882a593SmuzhiyunARCH := x86 30*4882a593Smuzhiyunendif 31*4882a593SmuzhiyunHOSTCFLAGS_sorttable.o += -I$(srctree)/tools/arch/x86/include 32*4882a593SmuzhiyunHOSTCFLAGS_sorttable.o += -DUNWINDER_ORC_ENABLED 33*4882a593SmuzhiyunHOSTLDLIBS_sorttable = -lpthread 34*4882a593Smuzhiyunendif 35*4882a593Smuzhiyun 36*4882a593Smuzhiyun# The following programs are only built on demand 37*4882a593Smuzhiyunhostprogs += unifdef 38*4882a593Smuzhiyun 39*4882a593Smuzhiyun# The module linker script is preprocessed on demand 40*4882a593Smuzhiyuntargets += module.lds 41*4882a593Smuzhiyun 42*4882a593Smuzhiyunsubdir-$(CONFIG_GCC_PLUGINS) += gcc-plugins 43*4882a593Smuzhiyunsubdir-$(CONFIG_MODVERSIONS) += genksyms 44*4882a593Smuzhiyunsubdir-$(CONFIG_SECURITY_SELINUX) += selinux 45*4882a593Smuzhiyun 46*4882a593Smuzhiyun# Let clean descend into subdirs 47*4882a593Smuzhiyunsubdir- += basic dtc gdb kconfig mod 48