blob: ecd3acacd0ec5209569400851e8832e8c295d809 [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.
H. Peter Anvin6520fe52012-05-08 21:22:24 +03005
Masahiro Yamadafaabed22020-08-01 21:27:18 +09006hostprogs-always-$(CONFIG_BUILD_BIN2C) += bin2c
7hostprogs-always-$(CONFIG_KALLSYMS) += kallsyms
8hostprogs-always-$(BUILD_C_RECORDMCOUNT) += recordmcount
9hostprogs-always-$(CONFIG_BUILDTIME_TABLE_SORT) += sorttable
10hostprogs-always-$(CONFIG_ASN1) += asn1_compiler
11hostprogs-always-$(CONFIG_MODULE_SIG_FORMAT) += sign-file
Masahiro Yamadafaabed22020-08-01 21:27:18 +090012hostprogs-always-$(CONFIG_SYSTEM_EXTRA_CERTIFICATE) += insert-sys-cert
Linus Torvalds1da177e2005-04-16 15:20:36 -070013
Shile Zhang10916702019-12-04 08:46:31 +080014HOSTCFLAGS_sorttable.o = -I$(srctree)/tools/include
Yinan Liu72b39422021-12-12 19:33:58 +080015HOSTLDLIBS_sorttable = -lpthread
David Howells4520c6a2012-09-21 23:31:13 +010016HOSTCFLAGS_asn1_compiler.o = -I$(srctree)/include
Masahiro Yamada340a0252021-12-14 11:53:54 +090017HOSTCFLAGS_sign-file.o = $(shell pkg-config --cflags libcrypto 2> /dev/null)
18HOSTLDLIBS_sign-file = $(shell pkg-config --libs libcrypto 2> /dev/null || echo -lcrypto)
Linus Torvalds1da177e2005-04-16 15:20:36 -070019
Shile Zhang57fa1892019-12-04 08:46:32 +080020ifdef CONFIG_UNWINDER_ORC
21ifeq ($(ARCH),x86_64)
22ARCH := x86
23endif
24HOSTCFLAGS_sorttable.o += -I$(srctree)/tools/arch/x86/include
25HOSTCFLAGS_sorttable.o += -DUNWINDER_ORC_ENABLED
Yinan Liu72b39422021-12-12 19:33:58 +080026endif
27
28ifdef CONFIG_DYNAMIC_FTRACE
29HOSTCFLAGS_sorttable.o += -DMCOUNT_SORT_ENABLED
Shile Zhang57fa1892019-12-04 08:46:32 +080030endif
31
Masahiro Yamada5f2fb522020-02-02 01:49:24 +090032# The following programs are only built on demand
33hostprogs += unifdef
Sam Ravnborg07aea3a2006-07-23 20:47:50 +020034
Masahiro Yamada596b0472020-09-08 13:27:08 +090035# The module linker script is preprocessed on demand
36targets += module.lds
37
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