b24413180f560 (Greg Kroah-Hartman 2017-11-01 15:07:57 +0100 1) # SPDX-License-Identifier: GPL-2.0
^1da177e4c3f4 (Linus Torvalds 2005-04-16 15:20:36 -0700 2) ###
^1da177e4c3f4 (Linus Torvalds 2005-04-16 15:20:36 -0700 3) # scripts contains sources for various helper programs used throughout
^1da177e4c3f4 (Linus Torvalds 2005-04-16 15:20:36 -0700 4) # the kernel for the build process.
6520fe5564acf (H. Peter Anvin 2012-05-08 21:22:24 +0300 5)
2cea4a7a1885b (Rolf Eike Beer 2018-11-22 16:40:49 +0100 6) CRYPTO_LIBS = $(shell pkg-config --libs libcrypto 2> /dev/null || echo -lcrypto)
2cea4a7a1885b (Rolf Eike Beer 2018-11-22 16:40:49 +0100 7) CRYPTO_CFLAGS = $(shell pkg-config --cflags libcrypto 2> /dev/null)
2cea4a7a1885b (Rolf Eike Beer 2018-11-22 16:40:49 +0100 8)
faabed295cccc (Masahiro Yamada 2020-08-01 21:27:18 +0900 9) hostprogs-always-$(CONFIG_BUILD_BIN2C) += bin2c
faabed295cccc (Masahiro Yamada 2020-08-01 21:27:18 +0900 10) hostprogs-always-$(CONFIG_KALLSYMS) += kallsyms
faabed295cccc (Masahiro Yamada 2020-08-01 21:27:18 +0900 11) hostprogs-always-$(BUILD_C_RECORDMCOUNT) += recordmcount
faabed295cccc (Masahiro Yamada 2020-08-01 21:27:18 +0900 12) hostprogs-always-$(CONFIG_BUILDTIME_TABLE_SORT) += sorttable
faabed295cccc (Masahiro Yamada 2020-08-01 21:27:18 +0900 13) hostprogs-always-$(CONFIG_ASN1) += asn1_compiler
faabed295cccc (Masahiro Yamada 2020-08-01 21:27:18 +0900 14) hostprogs-always-$(CONFIG_MODULE_SIG_FORMAT) += sign-file
faabed295cccc (Masahiro Yamada 2020-08-01 21:27:18 +0900 15) hostprogs-always-$(CONFIG_SYSTEM_TRUSTED_KEYRING) += extract-cert
faabed295cccc (Masahiro Yamada 2020-08-01 21:27:18 +0900 16) hostprogs-always-$(CONFIG_SYSTEM_EXTRA_CERTIFICATE) += insert-sys-cert
d1f044103dad7 (Eric Snowberg 2021-01-22 13:10:53 -0500 17) hostprogs-always-$(CONFIG_SYSTEM_REVOCATION_LIST) += extract-cert
^1da177e4c3f4 (Linus Torvalds 2005-04-16 15:20:36 -0700 18)
1091670637be8 (Shile Zhang 2019-12-04 08:46:31 +0800 19) HOSTCFLAGS_sorttable.o = -I$(srctree)/tools/include
4520c6a49af83 (David Howells 2012-09-21 23:31:13 +0100 20) HOSTCFLAGS_asn1_compiler.o = -I$(srctree)/include
fe968c41ac4f4 (Rolf Eike Beer 2021-02-12 08:22:27 +0100 21) HOSTCFLAGS_sign-file.o = $(CRYPTO_CFLAGS)
2cea4a7a1885b (Rolf Eike Beer 2018-11-22 16:40:49 +0100 22) HOSTLDLIBS_sign-file = $(CRYPTO_LIBS)
2cea4a7a1885b (Rolf Eike Beer 2018-11-22 16:40:49 +0100 23) HOSTCFLAGS_extract-cert.o = $(CRYPTO_CFLAGS)
2cea4a7a1885b (Rolf Eike Beer 2018-11-22 16:40:49 +0100 24) HOSTLDLIBS_extract-cert = $(CRYPTO_LIBS)
^1da177e4c3f4 (Linus Torvalds 2005-04-16 15:20:36 -0700 25)
57fa189942853 (Shile Zhang 2019-12-04 08:46:32 +0800 26) ifdef CONFIG_UNWINDER_ORC
57fa189942853 (Shile Zhang 2019-12-04 08:46:32 +0800 27) ifeq ($(ARCH),x86_64)
57fa189942853 (Shile Zhang 2019-12-04 08:46:32 +0800 28) ARCH := x86
57fa189942853 (Shile Zhang 2019-12-04 08:46:32 +0800 29) endif
57fa189942853 (Shile Zhang 2019-12-04 08:46:32 +0800 30) HOSTCFLAGS_sorttable.o += -I$(srctree)/tools/arch/x86/include
57fa189942853 (Shile Zhang 2019-12-04 08:46:32 +0800 31) HOSTCFLAGS_sorttable.o += -DUNWINDER_ORC_ENABLED
57fa189942853 (Shile Zhang 2019-12-04 08:46:32 +0800 32) HOSTLDLIBS_sorttable = -lpthread
57fa189942853 (Shile Zhang 2019-12-04 08:46:32 +0800 33) endif
57fa189942853 (Shile Zhang 2019-12-04 08:46:32 +0800 34)
5f2fb52fac15a (Masahiro Yamada 2020-02-02 01:49:24 +0900 35) # The following programs are only built on demand
5f2fb52fac15a (Masahiro Yamada 2020-02-02 01:49:24 +0900 36) hostprogs += unifdef
07aea3a71fc6b (Sam Ravnborg 2006-07-23 20:47:50 +0200 37)
596b0474d3d9b (Masahiro Yamada 2020-09-08 13:27:08 +0900 38) # The module linker script is preprocessed on demand
596b0474d3d9b (Masahiro Yamada 2020-09-08 13:27:08 +0900 39) targets += module.lds
596b0474d3d9b (Masahiro Yamada 2020-09-08 13:27:08 +0900 40)
ce2fd53a10c7d (Masahiro Yamada 2018-11-29 12:56:31 +0900 41) subdir-$(CONFIG_GCC_PLUGINS) += gcc-plugins
^1da177e4c3f4 (Linus Torvalds 2005-04-16 15:20:36 -0700 42) subdir-$(CONFIG_MODVERSIONS) += genksyms
93c06cbbf9fea (Serge Hallyn 2008-08-26 14:47:57 -0500 43) subdir-$(CONFIG_SECURITY_SELINUX) += selinux
^1da177e4c3f4 (Linus Torvalds 2005-04-16 15:20:36 -0700 44)
^1da177e4c3f4 (Linus Torvalds 2005-04-16 15:20:36 -0700 45) # Let clean descend into subdirs
46a63d4b0d79c (Masahiro Yamada 2019-08-21 16:02:02 +0900 46) subdir- += basic dtc gdb kconfig mod