xref: /kernel/linux/linux-6.6/scripts/Makefile (revision 62306a36)
162306a36Sopenharmony_ci# SPDX-License-Identifier: GPL-2.0
262306a36Sopenharmony_ci###
362306a36Sopenharmony_ci# scripts contains sources for various helper programs used throughout
462306a36Sopenharmony_ci# the kernel for the build process.
562306a36Sopenharmony_ci
662306a36Sopenharmony_cihostprogs-always-$(CONFIG_KALLSYMS)			+= kallsyms
762306a36Sopenharmony_cihostprogs-always-$(BUILD_C_RECORDMCOUNT)		+= recordmcount
862306a36Sopenharmony_cihostprogs-always-$(CONFIG_BUILDTIME_TABLE_SORT)		+= sorttable
962306a36Sopenharmony_cihostprogs-always-$(CONFIG_ASN1)				+= asn1_compiler
1062306a36Sopenharmony_cihostprogs-always-$(CONFIG_MODULE_SIG_FORMAT)		+= sign-file
1162306a36Sopenharmony_cihostprogs-always-$(CONFIG_SYSTEM_EXTRA_CERTIFICATE)	+= insert-sys-cert
1262306a36Sopenharmony_cihostprogs-always-$(CONFIG_RUST_KERNEL_DOCTESTS)		+= rustdoc_test_builder
1362306a36Sopenharmony_cihostprogs-always-$(CONFIG_RUST_KERNEL_DOCTESTS)		+= rustdoc_test_gen
1462306a36Sopenharmony_cialways-$(CONFIG_RUST)					+= target.json
1562306a36Sopenharmony_ci
1662306a36Sopenharmony_cifilechk_rust_target = $< < include/config/auto.conf
1762306a36Sopenharmony_ci
1862306a36Sopenharmony_ci$(obj)/target.json: scripts/generate_rust_target include/config/auto.conf FORCE
1962306a36Sopenharmony_ci	$(call filechk,rust_target)
2062306a36Sopenharmony_ci
2162306a36Sopenharmony_cihostprogs += generate_rust_target
2262306a36Sopenharmony_cigenerate_rust_target-rust := y
2362306a36Sopenharmony_cirustdoc_test_builder-rust := y
2462306a36Sopenharmony_cirustdoc_test_gen-rust := y
2562306a36Sopenharmony_ci
2662306a36Sopenharmony_ciHOSTCFLAGS_sorttable.o = -I$(srctree)/tools/include
2762306a36Sopenharmony_ciHOSTLDLIBS_sorttable = -lpthread
2862306a36Sopenharmony_ciHOSTCFLAGS_asn1_compiler.o = -I$(srctree)/include
2962306a36Sopenharmony_ciHOSTCFLAGS_sign-file.o = $(shell $(HOSTPKG_CONFIG) --cflags libcrypto 2> /dev/null)
3062306a36Sopenharmony_ciHOSTLDLIBS_sign-file = $(shell $(HOSTPKG_CONFIG) --libs libcrypto 2> /dev/null || echo -lcrypto)
3162306a36Sopenharmony_ci
3262306a36Sopenharmony_ciifdef CONFIG_UNWINDER_ORC
3362306a36Sopenharmony_ciifeq ($(ARCH),x86_64)
3462306a36Sopenharmony_ciARCH := x86
3562306a36Sopenharmony_ciendif
3662306a36Sopenharmony_ciHOSTCFLAGS_sorttable.o += -I$(srctree)/tools/arch/x86/include
3762306a36Sopenharmony_ciHOSTCFLAGS_sorttable.o += -DUNWINDER_ORC_ENABLED
3862306a36Sopenharmony_ciendif
3962306a36Sopenharmony_ci
4062306a36Sopenharmony_ciifdef CONFIG_BUILDTIME_MCOUNT_SORT
4162306a36Sopenharmony_ciHOSTCFLAGS_sorttable.o += -DMCOUNT_SORT_ENABLED
4262306a36Sopenharmony_ciendif
4362306a36Sopenharmony_ci
4462306a36Sopenharmony_ci# The following programs are only built on demand
4562306a36Sopenharmony_cihostprogs += unifdef
4662306a36Sopenharmony_ci
4762306a36Sopenharmony_ci# The module linker script is preprocessed on demand
4862306a36Sopenharmony_citargets += module.lds
4962306a36Sopenharmony_ci
5062306a36Sopenharmony_cisubdir-$(CONFIG_GCC_PLUGINS) += gcc-plugins
5162306a36Sopenharmony_cisubdir-$(CONFIG_MODVERSIONS) += genksyms
5262306a36Sopenharmony_cisubdir-$(CONFIG_SECURITY_SELINUX) += selinux
5362306a36Sopenharmony_ci
5462306a36Sopenharmony_ci# Let clean descend into subdirs
5562306a36Sopenharmony_cisubdir-	+= basic dtc gdb kconfig mod
56