kbuild: rename hostprogs-y/always to hostprogs/always-y
In old days, the "host-progs" syntax was used for specifying host programs. It was renamed to the current "hostprogs-y" in 2004. It is typically useful in scripts/Makefile because it allows Kbuild to selectively compile host programs based on the kernel configuration. This commit renames like follows: always -> always-y hostprogs-y -> hostprogs So, scripts/Makefile will look like this: always-$(CONFIG_BUILD_BIN2C) += ... always-$(CONFIG_KALLSYMS) += ... ... hostprogs := $(always-y) $(always-m) I think this makes more sense because a host program is always a host program, irrespective of the kernel configuration. We want to specify which ones to compile by CONFIG options, so always-y will be handier. The "always", "hostprogs-y", "hostprogs-m" will be kept for backward compatibility for a while. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
This commit is contained in:
@@ -7,14 +7,14 @@
|
||||
|
||||
HOST_EXTRACFLAGS += -I$(srctree)/tools/include
|
||||
|
||||
hostprogs-$(CONFIG_BUILD_BIN2C) += bin2c
|
||||
hostprogs-$(CONFIG_KALLSYMS) += kallsyms
|
||||
hostprogs-$(BUILD_C_RECORDMCOUNT) += recordmcount
|
||||
hostprogs-$(CONFIG_BUILDTIME_TABLE_SORT) += sorttable
|
||||
hostprogs-$(CONFIG_ASN1) += asn1_compiler
|
||||
hostprogs-$(CONFIG_MODULE_SIG_FORMAT) += sign-file
|
||||
hostprogs-$(CONFIG_SYSTEM_TRUSTED_KEYRING) += extract-cert
|
||||
hostprogs-$(CONFIG_SYSTEM_EXTRA_CERTIFICATE) += insert-sys-cert
|
||||
always-$(CONFIG_BUILD_BIN2C) += bin2c
|
||||
always-$(CONFIG_KALLSYMS) += kallsyms
|
||||
always-$(BUILD_C_RECORDMCOUNT) += recordmcount
|
||||
always-$(CONFIG_BUILDTIME_TABLE_SORT) += sorttable
|
||||
always-$(CONFIG_ASN1) += asn1_compiler
|
||||
always-$(CONFIG_MODULE_SIG_FORMAT) += sign-file
|
||||
always-$(CONFIG_SYSTEM_TRUSTED_KEYRING) += extract-cert
|
||||
always-$(CONFIG_SYSTEM_EXTRA_CERTIFICATE) += insert-sys-cert
|
||||
|
||||
HOSTCFLAGS_sorttable.o = -I$(srctree)/tools/include
|
||||
HOSTCFLAGS_asn1_compiler.o = -I$(srctree)/include
|
||||
@@ -30,10 +30,10 @@ HOSTCFLAGS_sorttable.o += -DUNWINDER_ORC_ENABLED
|
||||
HOSTLDLIBS_sorttable = -lpthread
|
||||
endif
|
||||
|
||||
always := $(hostprogs-y) $(hostprogs-m)
|
||||
hostprogs := $(always-y) $(always-m)
|
||||
|
||||
# The following hostprogs-y programs are only build on demand
|
||||
hostprogs-y += unifdef
|
||||
# The following programs are only built on demand
|
||||
hostprogs += unifdef
|
||||
|
||||
subdir-$(CONFIG_GCC_PLUGINS) += gcc-plugins
|
||||
subdir-$(CONFIG_MODVERSIONS) += genksyms
|
||||
|
@@ -16,6 +16,8 @@ obj-m :=
|
||||
lib-y :=
|
||||
lib-m :=
|
||||
always :=
|
||||
always-y :=
|
||||
always-m :=
|
||||
targets :=
|
||||
subdir-y :=
|
||||
subdir-m :=
|
||||
@@ -44,7 +46,7 @@ include $(kbuild-file)
|
||||
include scripts/Makefile.lib
|
||||
|
||||
# Do not include host rules unless needed
|
||||
ifneq ($(hostprogs-y)$(hostprogs-m)$(hostlibs-y)$(hostlibs-m)$(hostcxxlibs-y)$(hostcxxlibs-m),)
|
||||
ifneq ($(hostprogs)$(hostlibs-y)$(hostlibs-m)$(hostcxxlibs-y)$(hostcxxlibs-m),)
|
||||
include scripts/Makefile.host
|
||||
endif
|
||||
|
||||
@@ -348,7 +350,7 @@ $(obj)/%.o: $(src)/%.S $(objtool_dep) FORCE
|
||||
$(call if_changed_rule,as_o_S)
|
||||
|
||||
targets += $(filter-out $(subdir-obj-y), $(real-obj-y)) $(real-obj-m) $(lib-y)
|
||||
targets += $(extra-y) $(MAKECMDGOALS) $(always)
|
||||
targets += $(extra-y) $(always-y) $(MAKECMDGOALS)
|
||||
|
||||
# Linker scripts preprocessor (.lds.S -> .lds)
|
||||
# ---------------------------------------------------------------------------
|
||||
@@ -490,7 +492,7 @@ else
|
||||
|
||||
__build: $(if $(KBUILD_BUILTIN),$(builtin-target) $(lib-target) $(extra-y)) \
|
||||
$(if $(KBUILD_MODULES),$(obj-m) $(mod-targets) $(modorder-target)) \
|
||||
$(subdir-ym) $(always)
|
||||
$(subdir-ym) $(always-y)
|
||||
@:
|
||||
|
||||
endif
|
||||
|
@@ -28,8 +28,8 @@ subdir-ymn := $(addprefix $(obj)/,$(subdir-ymn))
|
||||
# directory
|
||||
|
||||
__clean-files := $(extra-y) $(extra-m) $(extra-) \
|
||||
$(always) $(targets) $(clean-files) \
|
||||
$(hostprogs-y) $(hostprogs-m) $(hostprogs-) \
|
||||
$(always) $(always-y) $(always-m) $(always-) $(targets) $(clean-files) \
|
||||
$(hostprogs) $(hostprogs-y) $(hostprogs-m) $(hostprogs-) \
|
||||
$(hostlibs-y) $(hostlibs-m) $(hostlibs-) \
|
||||
$(hostcxxlibs-y) $(hostcxxlibs-m)
|
||||
|
||||
|
@@ -24,21 +24,21 @@ $(obj)/%.tab.c $(obj)/%.tab.h: $(src)/%.y FORCE
|
||||
# Both C and C++ are supported, but preferred language is C for such utilities.
|
||||
#
|
||||
# Sample syntax (see Documentation/kbuild/makefiles.rst for reference)
|
||||
# hostprogs-y := bin2hex
|
||||
# hostprogs := bin2hex
|
||||
# Will compile bin2hex.c and create an executable named bin2hex
|
||||
#
|
||||
# hostprogs-y := lxdialog
|
||||
# hostprogs := lxdialog
|
||||
# lxdialog-objs := checklist.o lxdialog.o
|
||||
# Will compile lxdialog.c and checklist.c, and then link the executable
|
||||
# lxdialog, based on checklist.o and lxdialog.o
|
||||
#
|
||||
# hostprogs-y := qconf
|
||||
# hostprogs := qconf
|
||||
# qconf-cxxobjs := qconf.o
|
||||
# qconf-objs := menu.o
|
||||
# Will compile qconf as a C++ program, and menu as a C program.
|
||||
# They are linked as C++ code to the executable qconf
|
||||
|
||||
__hostprogs := $(sort $(hostprogs-y) $(hostprogs-m))
|
||||
__hostprogs := $(sort $(hostprogs))
|
||||
host-cshlib := $(sort $(hostlibs-y) $(hostlibs-m))
|
||||
host-cxxshlib := $(sort $(hostcxxlibs-y) $(hostcxxlibs-m))
|
||||
|
||||
|
@@ -4,6 +4,8 @@ asflags-y += $(EXTRA_AFLAGS)
|
||||
ccflags-y += $(EXTRA_CFLAGS)
|
||||
cppflags-y += $(EXTRA_CPPFLAGS)
|
||||
ldflags-y += $(EXTRA_LDFLAGS)
|
||||
always-y += $(always)
|
||||
hostprogs += $(hostprogs-y) $(hostprogs-m)
|
||||
|
||||
# flags that take effect in current and sub directories
|
||||
KBUILD_AFLAGS += $(subdir-asflags-y)
|
||||
@@ -59,6 +61,8 @@ subdir-obj-y := $(filter %/built-in.a, $(obj-y))
|
||||
real-obj-y := $(foreach m, $(obj-y), $(if $(strip $($(m:.o=-objs)) $($(m:.o=-y)) $($(m:.o=-))),$($(m:.o=-objs)) $($(m:.o=-y)),$(m)))
|
||||
real-obj-m := $(foreach m, $(obj-m), $(if $(strip $($(m:.o=-objs)) $($(m:.o=-y)) $($(m:.o=-m)) $($(m:.o=-))),$($(m:.o=-objs)) $($(m:.o=-y)) $($(m:.o=-m)),$(m)))
|
||||
|
||||
always-y += $(always-m)
|
||||
|
||||
# DTB
|
||||
# If CONFIG_OF_ALL_DTBS is enabled, all DT blobs are built
|
||||
extra-y += $(dtb-y)
|
||||
@@ -72,7 +76,7 @@ endif
|
||||
# Add subdir path
|
||||
|
||||
extra-y := $(addprefix $(obj)/,$(extra-y))
|
||||
always := $(addprefix $(obj)/,$(always))
|
||||
always-y := $(addprefix $(obj)/,$(always-y))
|
||||
targets := $(addprefix $(obj)/,$(targets))
|
||||
modorder := $(addprefix $(obj)/,$(modorder))
|
||||
obj-m := $(addprefix $(obj)/,$(obj-m))
|
||||
|
@@ -2,5 +2,5 @@
|
||||
#
|
||||
# fixdep: used to generate dependency information during build process
|
||||
|
||||
hostprogs-y := fixdep
|
||||
always := $(hostprogs-y)
|
||||
hostprogs := fixdep
|
||||
always-y := $(hostprogs)
|
||||
|
@@ -1,8 +1,8 @@
|
||||
# SPDX-License-Identifier: GPL-2.0
|
||||
# scripts/dtc makefile
|
||||
|
||||
hostprogs-$(CONFIG_DTC) := dtc
|
||||
always := $(hostprogs-y)
|
||||
hostprogs := dtc
|
||||
always-$(CONFIG_DTC) := $(hostprogs)
|
||||
|
||||
dtc-objs := dtc.o flattree.o fstree.o data.o livetree.o treesource.o \
|
||||
srcpos.o checks.o util.o
|
||||
|
@@ -23,7 +23,7 @@ $(objtree)/$(obj)/randomize_layout_seed.h: FORCE
|
||||
targets = randomize_layout_seed.h randomize_layout_hash.h
|
||||
|
||||
$(HOSTLIBS)-y := $(foreach p,$(GCC_PLUGIN),$(if $(findstring /,$(p)),,$(p)))
|
||||
always := $($(HOSTLIBS)-y)
|
||||
always-y := $($(HOSTLIBS)-y)
|
||||
|
||||
$(foreach p,$($(HOSTLIBS)-y:%.so=%),$(eval $(p)-objs := $(p).o))
|
||||
|
||||
|
@@ -1,7 +1,7 @@
|
||||
# SPDX-License-Identifier: GPL-2.0
|
||||
|
||||
hostprogs-y := genksyms
|
||||
always := $(hostprogs-y)
|
||||
hostprogs := genksyms
|
||||
always-y := $(hostprogs)
|
||||
|
||||
genksyms-objs := genksyms.o parse.tab.o lex.lex.o
|
||||
|
||||
|
@@ -157,11 +157,11 @@ HOSTCFLAGS_lexer.lex.o := -I $(srctree)/$(src)
|
||||
HOSTCFLAGS_parser.tab.o := -I $(srctree)/$(src)
|
||||
|
||||
# conf: Used for defconfig, oldconfig and related targets
|
||||
hostprogs-y += conf
|
||||
hostprogs += conf
|
||||
conf-objs := conf.o $(common-objs)
|
||||
|
||||
# nconf: Used for the nconfig target based on ncurses
|
||||
hostprogs-y += nconf
|
||||
hostprogs += nconf
|
||||
nconf-objs := nconf.o nconf.gui.o $(common-objs)
|
||||
|
||||
HOSTLDLIBS_nconf = $(shell . $(obj)/nconf-cfg && echo $$libs)
|
||||
@@ -171,7 +171,7 @@ HOSTCFLAGS_nconf.gui.o = $(shell . $(obj)/nconf-cfg && echo $$cflags)
|
||||
$(obj)/nconf.o $(obj)/nconf.gui.o: $(obj)/nconf-cfg
|
||||
|
||||
# mconf: Used for the menuconfig target based on lxdialog
|
||||
hostprogs-y += mconf
|
||||
hostprogs += mconf
|
||||
lxdialog := $(addprefix lxdialog/, \
|
||||
checklist.o inputbox.o menubox.o textbox.o util.o yesno.o)
|
||||
mconf-objs := mconf.o $(lxdialog) $(common-objs)
|
||||
@@ -183,7 +183,7 @@ $(foreach f, mconf.o $(lxdialog), \
|
||||
$(addprefix $(obj)/, mconf.o $(lxdialog)): $(obj)/mconf-cfg
|
||||
|
||||
# qconf: Used for the xconfig target based on Qt
|
||||
hostprogs-y += qconf
|
||||
hostprogs += qconf
|
||||
qconf-cxxobjs := qconf.o
|
||||
qconf-objs := images.o $(common-objs)
|
||||
|
||||
@@ -199,7 +199,7 @@ $(obj)/%.moc: $(src)/%.h $(obj)/qconf-cfg
|
||||
$(call cmd,moc)
|
||||
|
||||
# gconf: Used for the gconfig target based on GTK+
|
||||
hostprogs-y += gconf
|
||||
hostprogs += gconf
|
||||
gconf-objs := gconf.o images.o $(common-objs)
|
||||
|
||||
HOSTLDLIBS_gconf = $(shell . $(obj)/gconf-cfg && echo $$libs)
|
||||
|
@@ -1,8 +1,8 @@
|
||||
# SPDX-License-Identifier: GPL-2.0
|
||||
OBJECT_FILES_NON_STANDARD := y
|
||||
|
||||
hostprogs-y := modpost mk_elfconfig
|
||||
always := $(hostprogs-y) empty.o
|
||||
hostprogs := modpost mk_elfconfig
|
||||
always-y := $(hostprogs) empty.o
|
||||
|
||||
modpost-objs := modpost.o file2alias.o sumversion.o
|
||||
|
||||
|
@@ -1,7 +1,7 @@
|
||||
# SPDX-License-Identifier: GPL-2.0
|
||||
hostprogs-y := genheaders
|
||||
hostprogs := genheaders
|
||||
HOST_EXTRACFLAGS += \
|
||||
-I$(srctree)/include/uapi -I$(srctree)/include \
|
||||
-I$(srctree)/security/selinux/include
|
||||
|
||||
always := $(hostprogs-y)
|
||||
always-y := $(hostprogs)
|
||||
|
@@ -1,8 +1,8 @@
|
||||
# SPDX-License-Identifier: GPL-2.0
|
||||
hostprogs-y := mdp
|
||||
hostprogs := mdp
|
||||
HOST_EXTRACFLAGS += \
|
||||
-I$(srctree)/include/uapi -I$(srctree)/include \
|
||||
-I$(srctree)/security/selinux/include -I$(objtree)/include
|
||||
|
||||
always := $(hostprogs-y)
|
||||
always-y := $(hostprogs)
|
||||
clean-files := policy.* file_contexts
|
||||
|
Reference in New Issue
Block a user