2017-11-01 15:07:57 +01:00
|
|
|
# SPDX-License-Identifier: GPL-2.0
|
2005-04-16 15:20:36 -07:00
|
|
|
###
|
|
|
|
|
# scripts contains sources for various helper programs used throughout
|
|
|
|
|
# the kernel for the build process.
|
2012-05-08 21:22:24 +03:00
|
|
|
|
2020-08-01 21:27:18 +09:00
|
|
|
hostprogs-always-$(CONFIG_KALLSYMS) += kallsyms
|
|
|
|
|
hostprogs-always-$(BUILD_C_RECORDMCOUNT) += recordmcount
|
|
|
|
|
hostprogs-always-$(CONFIG_BUILDTIME_TABLE_SORT) += sorttable
|
|
|
|
|
hostprogs-always-$(CONFIG_ASN1) += asn1_compiler
|
|
|
|
|
hostprogs-always-$(CONFIG_MODULE_SIG_FORMAT) += sign-file
|
|
|
|
|
hostprogs-always-$(CONFIG_SYSTEM_EXTRA_CERTIFICATE) += insert-sys-cert
|
2023-07-18 07:27:51 +02:00
|
|
|
hostprogs-always-$(CONFIG_RUST_KERNEL_DOCTESTS) += rustdoc_test_builder
|
|
|
|
|
hostprogs-always-$(CONFIG_RUST_KERNEL_DOCTESTS) += rustdoc_test_gen
|
2025-10-21 20:43:40 -04:00
|
|
|
hostprogs-always-$(CONFIG_TRACEPOINTS) += tracepoint-update
|
2021-07-03 16:42:57 +02:00
|
|
|
|
2025-10-21 20:43:39 -04:00
|
|
|
sorttable-objs := sorttable.o elf-parse.o
|
2025-10-21 20:43:40 -04:00
|
|
|
tracepoint-update-objs := tracepoint-update.o elf-parse.o
|
2025-10-21 20:43:39 -04:00
|
|
|
|
2024-06-05 06:40:50 +08:00
|
|
|
ifneq ($(or $(CONFIG_X86_64),$(CONFIG_X86_32)),)
|
2023-10-20 16:50:55 +01:00
|
|
|
always-$(CONFIG_RUST) += target.json
|
2023-01-07 18:45:45 +09:00
|
|
|
filechk_rust_target = $< < include/config/auto.conf
|
|
|
|
|
|
|
|
|
|
$(obj)/target.json: scripts/generate_rust_target include/config/auto.conf FORCE
|
|
|
|
|
$(call filechk,rust_target)
|
2023-10-20 16:50:55 +01:00
|
|
|
endif
|
2023-01-07 18:45:45 +09:00
|
|
|
|
|
|
|
|
hostprogs += generate_rust_target
|
2021-07-03 16:42:57 +02:00
|
|
|
generate_rust_target-rust := y
|
2023-07-18 07:27:51 +02:00
|
|
|
rustdoc_test_builder-rust := y
|
|
|
|
|
rustdoc_test_gen-rust := y
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2025-10-21 20:43:40 -04:00
|
|
|
HOSTCFLAGS_tracepoint-update.o = -I$(srctree)/tools/include
|
2025-10-21 20:43:39 -04:00
|
|
|
HOSTCFLAGS_elf-parse.o = -I$(srctree)/tools/include
|
2019-12-04 08:46:31 +08:00
|
|
|
HOSTCFLAGS_sorttable.o = -I$(srctree)/tools/include
|
2021-12-12 19:33:58 +08:00
|
|
|
HOSTLDLIBS_sorttable = -lpthread
|
2012-09-21 23:31:13 +01:00
|
|
|
HOSTCFLAGS_asn1_compiler.o = -I$(srctree)/include
|
2022-04-01 23:18:02 +00:00
|
|
|
HOSTCFLAGS_sign-file.o = $(shell $(HOSTPKG_CONFIG) --cflags libcrypto 2> /dev/null)
|
2026-03-05 10:31:43 +01:00
|
|
|
HOSTCFLAGS_sign-file.o += -I$(srctree)/tools/include/uapi/
|
2022-04-01 23:18:02 +00:00
|
|
|
HOSTLDLIBS_sign-file = $(shell $(HOSTPKG_CONFIG) --libs libcrypto 2> /dev/null || echo -lcrypto)
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2019-12-04 08:46:32 +08:00
|
|
|
ifdef CONFIG_UNWINDER_ORC
|
|
|
|
|
ifeq ($(ARCH),x86_64)
|
2024-03-11 22:23:47 +08:00
|
|
|
SRCARCH := x86
|
2019-12-04 08:46:32 +08:00
|
|
|
endif
|
2024-03-11 22:23:47 +08:00
|
|
|
ifeq ($(ARCH),loongarch)
|
|
|
|
|
SRCARCH := loongarch
|
|
|
|
|
endif
|
|
|
|
|
HOSTCFLAGS_sorttable.o += -I$(srctree)/tools/arch/$(SRCARCH)/include
|
2019-12-04 08:46:32 +08:00
|
|
|
HOSTCFLAGS_sorttable.o += -DUNWINDER_ORC_ENABLED
|
2021-12-12 19:33:58 +08:00
|
|
|
endif
|
|
|
|
|
|
2022-01-25 09:19:10 -05:00
|
|
|
ifdef CONFIG_BUILDTIME_MCOUNT_SORT
|
2021-12-12 19:33:58 +08:00
|
|
|
HOSTCFLAGS_sorttable.o += -DMCOUNT_SORT_ENABLED
|
2019-12-04 08:46:32 +08:00
|
|
|
endif
|
|
|
|
|
|
2020-02-02 01:49:24 +09:00
|
|
|
# The following programs are only built on demand
|
2024-12-10 12:27:12 -08:00
|
|
|
hostprogs += unifdef gen_packed_field_checks
|
2006-07-23 20:47:50 +02:00
|
|
|
|
2020-09-08 13:27:08 +09:00
|
|
|
# The module linker script is preprocessed on demand
|
|
|
|
|
targets += module.lds
|
|
|
|
|
|
2018-11-29 12:56:31 +09:00
|
|
|
subdir-$(CONFIG_GCC_PLUGINS) += gcc-plugins
|
2025-01-03 20:45:39 +00:00
|
|
|
subdir-$(CONFIG_GENKSYMS) += genksyms
|
2025-01-03 20:45:23 +00:00
|
|
|
subdir-$(CONFIG_GENDWARFKSYMS) += gendwarfksyms
|
2008-08-26 14:47:57 -05:00
|
|
|
subdir-$(CONFIG_SECURITY_SELINUX) += selinux
|
2024-08-02 23:08:31 -07:00
|
|
|
subdir-$(CONFIG_SECURITY_IPE) += ipe
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
# Let clean descend into subdirs
|
2019-08-21 16:02:02 +09:00
|
|
|
subdir- += basic dtc gdb kconfig mod
|