xref: /openbmc/linux/scripts/Makefile (revision 596b0474)
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_TRUSTED_KEYRING)	+= extract-cert
13faabed29SMasahiro Yamadahostprogs-always-$(CONFIG_SYSTEM_EXTRA_CERTIFICATE)	+= insert-sys-cert
141da177e4SLinus Torvalds
1510916706SShile ZhangHOSTCFLAGS_sorttable.o = -I$(srctree)/tools/include
164520c6a4SDavid HowellsHOSTCFLAGS_asn1_compiler.o = -I$(srctree)/include
178377bd2bSLaura AbbottHOSTLDLIBS_sign-file = -lcrypto
188377bd2bSLaura AbbottHOSTLDLIBS_extract-cert = -lcrypto
191da177e4SLinus Torvalds
2057fa1899SShile Zhangifdef CONFIG_UNWINDER_ORC
2157fa1899SShile Zhangifeq ($(ARCH),x86_64)
2257fa1899SShile ZhangARCH := x86
2357fa1899SShile Zhangendif
2457fa1899SShile ZhangHOSTCFLAGS_sorttable.o += -I$(srctree)/tools/arch/x86/include
2557fa1899SShile ZhangHOSTCFLAGS_sorttable.o += -DUNWINDER_ORC_ENABLED
2657fa1899SShile ZhangHOSTLDLIBS_sorttable = -lpthread
2757fa1899SShile Zhangendif
2857fa1899SShile Zhang
295f2fb52fSMasahiro Yamada# The following programs are only built on demand
305f2fb52fSMasahiro Yamadahostprogs += unifdef
3107aea3a7SSam Ravnborg
32596b0474SMasahiro Yamada# The module linker script is preprocessed on demand
33596b0474SMasahiro Yamadatargets += module.lds
34596b0474SMasahiro Yamada
35ce2fd53aSMasahiro Yamadasubdir-$(CONFIG_GCC_PLUGINS) += gcc-plugins
361da177e4SLinus Torvaldssubdir-$(CONFIG_MODVERSIONS) += genksyms
3793c06cbbSSerge E. Hallynsubdir-$(CONFIG_SECURITY_SELINUX) += selinux
381da177e4SLinus Torvalds
391da177e4SLinus Torvalds# Let clean descend into subdirs
4046a63d4bSMasahiro Yamadasubdir-	+= basic dtc gdb kconfig mod
41