blob: 5e75802b1a4425270bc237101e0a2abdcf84919a [file] [log] [blame]
Greg Kroah-Hartmanb2441312017-11-01 15:07:57 +01001# SPDX-License-Identifier: GPL-2.0
Linus Torvalds1da177e2005-04-16 15:20:36 -07002###
3# scripts contains sources for various helper programs used throughout
4# the kernel for the build process.
5# ---------------------------------------------------------------------------
6# kallsyms: Find all symbols in vmlinux
Linus Torvalds1da177e2005-04-16 15:20:36 -07007
H. Peter Anvin6520fe52012-05-08 21:22:24 +03008HOST_EXTRACFLAGS += -I$(srctree)/tools/include
9
Masahiro Yamada5f2fb522020-02-02 01:49:24 +090010always-$(CONFIG_BUILD_BIN2C) += bin2c
11always-$(CONFIG_KALLSYMS) += kallsyms
12always-$(BUILD_C_RECORDMCOUNT) += recordmcount
13always-$(CONFIG_BUILDTIME_TABLE_SORT) += sorttable
14always-$(CONFIG_ASN1) += asn1_compiler
15always-$(CONFIG_MODULE_SIG_FORMAT) += sign-file
16always-$(CONFIG_SYSTEM_TRUSTED_KEYRING) += extract-cert
17always-$(CONFIG_SYSTEM_EXTRA_CERTIFICATE) += insert-sys-cert
Linus Torvalds1da177e2005-04-16 15:20:36 -070018
Shile Zhang10916702019-12-04 08:46:31 +080019HOSTCFLAGS_sorttable.o = -I$(srctree)/tools/include
David Howells4520c6a2012-09-21 23:31:13 +010020HOSTCFLAGS_asn1_compiler.o = -I$(srctree)/include
Laura Abbott8377bd22018-07-09 17:46:01 -070021HOSTLDLIBS_sign-file = -lcrypto
22HOSTLDLIBS_extract-cert = -lcrypto
Linus Torvalds1da177e2005-04-16 15:20:36 -070023
Shile Zhang57fa1892019-12-04 08:46:32 +080024ifdef CONFIG_UNWINDER_ORC
25ifeq ($(ARCH),x86_64)
26ARCH := x86
27endif
28HOSTCFLAGS_sorttable.o += -I$(srctree)/tools/arch/x86/include
29HOSTCFLAGS_sorttable.o += -DUNWINDER_ORC_ENABLED
30HOSTLDLIBS_sorttable = -lpthread
31endif
32
Masahiro Yamada5f2fb522020-02-02 01:49:24 +090033hostprogs := $(always-y) $(always-m)
Linus Torvalds1da177e2005-04-16 15:20:36 -070034
Masahiro Yamada5f2fb522020-02-02 01:49:24 +090035# The following programs are only built on demand
36hostprogs += unifdef
Sam Ravnborg07aea3a2006-07-23 20:47:50 +020037
Masahiro Yamadace2fd53a2018-11-29 12:56:31 +090038subdir-$(CONFIG_GCC_PLUGINS) += gcc-plugins
Linus Torvalds1da177e2005-04-16 15:20:36 -070039subdir-$(CONFIG_MODVERSIONS) += genksyms
Serge E. Hallyn93c06cb2008-08-26 14:47:57 -050040subdir-$(CONFIG_SECURITY_SELINUX) += selinux
Linus Torvalds1da177e2005-04-16 15:20:36 -070041
42# Let clean descend into subdirs
Masahiro Yamada46a63d42019-08-21 16:02:02 +090043subdir- += basic dtc gdb kconfig mod