Greg Kroah-Hartman | b244131 | 2017-11-01 15:07:57 +0100 | [diff] [blame] | 1 | # SPDX-License-Identifier: GPL-2.0 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 2 | ### |
| 3 | # scripts contains sources for various helper programs used throughout |
| 4 | # the kernel for the build process. |
H. Peter Anvin | 6520fe5 | 2012-05-08 21:22:24 +0300 | [diff] [blame] | 5 | |
Masahiro Yamada | faabed2 | 2020-08-01 21:27:18 +0900 | [diff] [blame] | 6 | hostprogs-always-$(CONFIG_BUILD_BIN2C) += bin2c |
| 7 | hostprogs-always-$(CONFIG_KALLSYMS) += kallsyms |
| 8 | hostprogs-always-$(BUILD_C_RECORDMCOUNT) += recordmcount |
| 9 | hostprogs-always-$(CONFIG_BUILDTIME_TABLE_SORT) += sorttable |
| 10 | hostprogs-always-$(CONFIG_ASN1) += asn1_compiler |
| 11 | hostprogs-always-$(CONFIG_MODULE_SIG_FORMAT) += sign-file |
Masahiro Yamada | faabed2 | 2020-08-01 21:27:18 +0900 | [diff] [blame] | 12 | hostprogs-always-$(CONFIG_SYSTEM_EXTRA_CERTIFICATE) += insert-sys-cert |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 13 | |
Shile Zhang | 1091670 | 2019-12-04 08:46:31 +0800 | [diff] [blame] | 14 | HOSTCFLAGS_sorttable.o = -I$(srctree)/tools/include |
Yinan Liu | 72b3942 | 2021-12-12 19:33:58 +0800 | [diff] [blame] | 15 | HOSTLDLIBS_sorttable = -lpthread |
David Howells | 4520c6a | 2012-09-21 23:31:13 +0100 | [diff] [blame] | 16 | HOSTCFLAGS_asn1_compiler.o = -I$(srctree)/include |
Masahiro Yamada | 340a025 | 2021-12-14 11:53:54 +0900 | [diff] [blame] | 17 | HOSTCFLAGS_sign-file.o = $(shell pkg-config --cflags libcrypto 2> /dev/null) |
| 18 | HOSTLDLIBS_sign-file = $(shell pkg-config --libs libcrypto 2> /dev/null || echo -lcrypto) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 19 | |
Shile Zhang | 57fa189 | 2019-12-04 08:46:32 +0800 | [diff] [blame] | 20 | ifdef CONFIG_UNWINDER_ORC |
| 21 | ifeq ($(ARCH),x86_64) |
| 22 | ARCH := x86 |
| 23 | endif |
| 24 | HOSTCFLAGS_sorttable.o += -I$(srctree)/tools/arch/x86/include |
| 25 | HOSTCFLAGS_sorttable.o += -DUNWINDER_ORC_ENABLED |
Yinan Liu | 72b3942 | 2021-12-12 19:33:58 +0800 | [diff] [blame] | 26 | endif |
| 27 | |
Steven Rostedt (Google) | 4ed308c | 2022-01-25 09:19:10 -0500 | [diff] [blame] | 28 | ifdef CONFIG_BUILDTIME_MCOUNT_SORT |
Yinan Liu | 72b3942 | 2021-12-12 19:33:58 +0800 | [diff] [blame] | 29 | HOSTCFLAGS_sorttable.o += -DMCOUNT_SORT_ENABLED |
Shile Zhang | 57fa189 | 2019-12-04 08:46:32 +0800 | [diff] [blame] | 30 | endif |
| 31 | |
Masahiro Yamada | 5f2fb52 | 2020-02-02 01:49:24 +0900 | [diff] [blame] | 32 | # The following programs are only built on demand |
| 33 | hostprogs += unifdef |
Sam Ravnborg | 07aea3a | 2006-07-23 20:47:50 +0200 | [diff] [blame] | 34 | |
Masahiro Yamada | 596b047 | 2020-09-08 13:27:08 +0900 | [diff] [blame] | 35 | # The module linker script is preprocessed on demand |
| 36 | targets += module.lds |
| 37 | |
Masahiro Yamada | ce2fd53a | 2018-11-29 12:56:31 +0900 | [diff] [blame] | 38 | subdir-$(CONFIG_GCC_PLUGINS) += gcc-plugins |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 39 | subdir-$(CONFIG_MODVERSIONS) += genksyms |
Serge E. Hallyn | 93c06cb | 2008-08-26 14:47:57 -0500 | [diff] [blame] | 40 | subdir-$(CONFIG_SECURITY_SELINUX) += selinux |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 41 | |
| 42 | # Let clean descend into subdirs |
Masahiro Yamada | 46a63d4 | 2019-08-21 16:02:02 +0900 | [diff] [blame] | 43 | subdir- += basic dtc gdb kconfig mod |