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 | |
Rolf Eike Beer | 2cea4a7 | 2018-11-22 16:40:49 +0100 | [diff] [blame] | 6 | CRYPTO_LIBS = $(shell pkg-config --libs libcrypto 2> /dev/null || echo -lcrypto) |
| 7 | CRYPTO_CFLAGS = $(shell pkg-config --cflags libcrypto 2> /dev/null) |
| 8 | |
Masahiro Yamada | faabed2 | 2020-08-01 21:27:18 +0900 | [diff] [blame] | 9 | hostprogs-always-$(CONFIG_BUILD_BIN2C) += bin2c |
| 10 | hostprogs-always-$(CONFIG_KALLSYMS) += kallsyms |
| 11 | hostprogs-always-$(BUILD_C_RECORDMCOUNT) += recordmcount |
| 12 | hostprogs-always-$(CONFIG_BUILDTIME_TABLE_SORT) += sorttable |
| 13 | hostprogs-always-$(CONFIG_ASN1) += asn1_compiler |
| 14 | hostprogs-always-$(CONFIG_MODULE_SIG_FORMAT) += sign-file |
| 15 | hostprogs-always-$(CONFIG_SYSTEM_TRUSTED_KEYRING) += extract-cert |
| 16 | hostprogs-always-$(CONFIG_SYSTEM_EXTRA_CERTIFICATE) += insert-sys-cert |
Eric Snowberg | d1f0441 | 2021-01-22 13:10:53 -0500 | [diff] [blame] | 17 | hostprogs-always-$(CONFIG_SYSTEM_REVOCATION_LIST) += extract-cert |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 18 | |
Shile Zhang | 1091670 | 2019-12-04 08:46:31 +0800 | [diff] [blame] | 19 | HOSTCFLAGS_sorttable.o = -I$(srctree)/tools/include |
David Howells | 4520c6a | 2012-09-21 23:31:13 +0100 | [diff] [blame] | 20 | HOSTCFLAGS_asn1_compiler.o = -I$(srctree)/include |
Rolf Eike Beer | fe968c4 | 2021-02-12 08:22:27 +0100 | [diff] [blame] | 21 | HOSTCFLAGS_sign-file.o = $(CRYPTO_CFLAGS) |
Rolf Eike Beer | 2cea4a7 | 2018-11-22 16:40:49 +0100 | [diff] [blame] | 22 | HOSTLDLIBS_sign-file = $(CRYPTO_LIBS) |
| 23 | HOSTCFLAGS_extract-cert.o = $(CRYPTO_CFLAGS) |
| 24 | HOSTLDLIBS_extract-cert = $(CRYPTO_LIBS) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 25 | |
Shile Zhang | 57fa189 | 2019-12-04 08:46:32 +0800 | [diff] [blame] | 26 | ifdef CONFIG_UNWINDER_ORC |
| 27 | ifeq ($(ARCH),x86_64) |
| 28 | ARCH := x86 |
| 29 | endif |
| 30 | HOSTCFLAGS_sorttable.o += -I$(srctree)/tools/arch/x86/include |
| 31 | HOSTCFLAGS_sorttable.o += -DUNWINDER_ORC_ENABLED |
| 32 | HOSTLDLIBS_sorttable = -lpthread |
| 33 | endif |
| 34 | |
Masahiro Yamada | 5f2fb52 | 2020-02-02 01:49:24 +0900 | [diff] [blame] | 35 | # The following programs are only built on demand |
| 36 | hostprogs += unifdef |
Sam Ravnborg | 07aea3a | 2006-07-23 20:47:50 +0200 | [diff] [blame] | 37 | |
Masahiro Yamada | 596b047 | 2020-09-08 13:27:08 +0900 | [diff] [blame] | 38 | # The module linker script is preprocessed on demand |
| 39 | targets += module.lds |
| 40 | |
Masahiro Yamada | ce2fd53a | 2018-11-29 12:56:31 +0900 | [diff] [blame] | 41 | subdir-$(CONFIG_GCC_PLUGINS) += gcc-plugins |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 42 | subdir-$(CONFIG_MODVERSIONS) += genksyms |
Serge E. Hallyn | 93c06cb | 2008-08-26 14:47:57 -0500 | [diff] [blame] | 43 | subdir-$(CONFIG_SECURITY_SELINUX) += selinux |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 44 | |
| 45 | # Let clean descend into subdirs |
Masahiro Yamada | 46a63d4 | 2019-08-21 16:02:02 +0900 | [diff] [blame] | 46 | subdir- += basic dtc gdb kconfig mod |