blob: 1e3d91668878b05be4a9695af7bb5e7e6a0f428d [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
7# pnmttologo: Convert pnm files to logo files
David Woodhouse556b0f52009-01-10 14:53:15 +00008# conmakehash: Create chartable
Linus Torvalds1da177e2005-04-16 15:20:36 -07009# conmakehash: Create arrays for initializing the kernel console tables
10
H. Peter Anvin6520fe52012-05-08 21:22:24 +030011HOST_EXTRACFLAGS += -I$(srctree)/tools/include
12
Rolf Eike Beer4094a922021-03-04 08:25:01 +010013CRYPTO_LIBS = $(shell pkg-config --libs libcrypto 2> /dev/null || echo -lcrypto)
14CRYPTO_CFLAGS = $(shell pkg-config --cflags libcrypto 2> /dev/null)
15
Linus Torvalds1da177e2005-04-16 15:20:36 -070016hostprogs-$(CONFIG_KALLSYMS) += kallsyms
17hostprogs-$(CONFIG_LOGO) += pnmtologo
18hostprogs-$(CONFIG_VT) += conmakehash
Steven Rostedt72441cb2010-10-13 17:12:30 -040019hostprogs-$(BUILD_C_RECORDMCOUNT) += recordmcount
David Daneya79f2482012-04-19 14:59:55 -070020hostprogs-$(CONFIG_BUILDTIME_EXTABLE_SORT) += sortextable
David Howells4520c6a2012-09-21 23:31:13 +010021hostprogs-$(CONFIG_ASN1) += asn1_compiler
David Woodhouse770f2b92015-07-20 21:16:34 +010022hostprogs-$(CONFIG_MODULE_SIG) += sign-file
23hostprogs-$(CONFIG_SYSTEM_TRUSTED_KEYRING) += extract-cert
Mehmet Kayaalpc4c36102015-11-24 16:18:05 -050024hostprogs-$(CONFIG_SYSTEM_EXTRA_CERTIFICATE) += insert-sys-cert
Linus Torvalds1da177e2005-04-16 15:20:36 -070025
David Daneyd59a1682012-04-24 11:23:14 -070026HOSTCFLAGS_sortextable.o = -I$(srctree)/tools/include
David Howells4520c6a2012-09-21 23:31:13 +010027HOSTCFLAGS_asn1_compiler.o = -I$(srctree)/include
Rolf Eike Beer3037d542021-03-04 08:26:28 +010028HOSTCFLAGS_sign-file.o = $(CRYPTO_CFLAGS)
Rolf Eike Beer4094a922021-03-04 08:25:01 +010029HOSTLOADLIBES_sign-file = $(CRYPTO_LIBS)
30HOSTCFLAGS_extract-cert.o = $(CRYPTO_CFLAGS)
31HOSTLOADLIBES_extract-cert = $(CRYPTO_LIBS)
Linus Torvalds1da177e2005-04-16 15:20:36 -070032
Ross Birof2443ab2006-09-30 23:27:25 -070033always := $(hostprogs-y) $(hostprogs-m)
Linus Torvalds1da177e2005-04-16 15:20:36 -070034
Sam Ravnborg07aea3a2006-07-23 20:47:50 +020035# The following hostprogs-y programs are only build on demand
Jonathan Corbet52b3f232017-06-23 14:17:38 -060036hostprogs-y += unifdef
Sam Ravnborg07aea3a2006-07-23 20:47:50 +020037
Sami Tolvanenbf3b3bb2020-03-31 14:32:27 -070038extra-$(CONFIG_LTO_CLANG) += module-lto.lds
39
Peter Foleybffd2022011-05-02 22:48:03 +020040# These targets are used internally to avoid "is up to date" messages
Jonathan Corbet52b3f232017-06-23 14:17:38 -060041PHONY += build_unifdef
Masahiro Yamadabfdfaea2014-01-20 14:08:08 +090042build_unifdef: $(obj)/unifdef
Mike Waychisone1b702c2011-03-14 23:34:25 -070043 @:
44
Linus Torvalds1da177e2005-04-16 15:20:36 -070045subdir-$(CONFIG_MODVERSIONS) += genksyms
Sam Ravnborg12715d22006-08-08 20:43:39 +020046subdir-y += mod
Serge E. Hallyn93c06cb2008-08-26 14:47:57 -050047subdir-$(CONFIG_SECURITY_SELINUX) += selinux
David Gibson9fffb552009-04-30 15:25:53 +100048subdir-$(CONFIG_DTC) += dtc
Jan Kiszka3ee7b3f2015-02-17 13:46:36 -080049subdir-$(CONFIG_GDB_SCRIPTS) += gdb
Linus Torvalds1da177e2005-04-16 15:20:36 -070050
51# Let clean descend into subdirs
Emese Revfy6b90bd42016-05-24 00:09:38 +020052subdir- += basic kconfig package gcc-plugins