Skip to content
Snippets Groups Projects
Commit 5f2fb52f authored by Masahiro Yamada's avatar Masahiro Yamada
Browse files

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: default avatarMasahiro Yamada <masahiroy@kernel.org>
parent faa7bdd7
Branches
Tags
No related merge requests found
...@@ -2,5 +2,5 @@ ...@@ -2,5 +2,5 @@
# #
# fixdep: used to generate dependency information during build process # fixdep: used to generate dependency information during build process
hostprogs-y := fixdep hostprogs := fixdep
always := $(hostprogs-y) always-y := $(hostprogs)
# SPDX-License-Identifier: GPL-2.0 # SPDX-License-Identifier: GPL-2.0
# scripts/dtc makefile # scripts/dtc makefile
hostprogs-$(CONFIG_DTC) := dtc hostprogs := dtc
always := $(hostprogs-y) always-$(CONFIG_DTC) := $(hostprogs)
dtc-objs := dtc.o flattree.o fstree.o data.o livetree.o treesource.o \ dtc-objs := dtc.o flattree.o fstree.o data.o livetree.o treesource.o \
srcpos.o checks.o util.o srcpos.o checks.o util.o
......
...@@ -23,7 +23,7 @@ $(objtree)/$(obj)/randomize_layout_seed.h: FORCE ...@@ -23,7 +23,7 @@ $(objtree)/$(obj)/randomize_layout_seed.h: FORCE
targets = randomize_layout_seed.h randomize_layout_hash.h targets = randomize_layout_seed.h randomize_layout_hash.h
$(HOSTLIBS)-y := $(foreach p,$(GCC_PLUGIN),$(if $(findstring /,$(p)),,$(p))) $(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)) $(foreach p,$($(HOSTLIBS)-y:%.so=%),$(eval $(p)-objs := $(p).o))
......
# SPDX-License-Identifier: GPL-2.0 # SPDX-License-Identifier: GPL-2.0
hostprogs-y := genksyms hostprogs := genksyms
always := $(hostprogs-y) always-y := $(hostprogs)
genksyms-objs := genksyms.o parse.tab.o lex.lex.o genksyms-objs := genksyms.o parse.tab.o lex.lex.o
......
...@@ -157,11 +157,11 @@ HOSTCFLAGS_lexer.lex.o := -I $(srctree)/$(src) ...@@ -157,11 +157,11 @@ HOSTCFLAGS_lexer.lex.o := -I $(srctree)/$(src)
HOSTCFLAGS_parser.tab.o := -I $(srctree)/$(src) HOSTCFLAGS_parser.tab.o := -I $(srctree)/$(src)
# conf: Used for defconfig, oldconfig and related targets # conf: Used for defconfig, oldconfig and related targets
hostprogs-y += conf hostprogs += conf
conf-objs := conf.o $(common-objs) conf-objs := conf.o $(common-objs)
# nconf: Used for the nconfig target based on ncurses # nconf: Used for the nconfig target based on ncurses
hostprogs-y += nconf hostprogs += nconf
nconf-objs := nconf.o nconf.gui.o $(common-objs) nconf-objs := nconf.o nconf.gui.o $(common-objs)
HOSTLDLIBS_nconf = $(shell . $(obj)/nconf-cfg && echo $$libs) HOSTLDLIBS_nconf = $(shell . $(obj)/nconf-cfg && echo $$libs)
...@@ -171,7 +171,7 @@ HOSTCFLAGS_nconf.gui.o = $(shell . $(obj)/nconf-cfg && echo $$cflags) ...@@ -171,7 +171,7 @@ HOSTCFLAGS_nconf.gui.o = $(shell . $(obj)/nconf-cfg && echo $$cflags)
$(obj)/nconf.o $(obj)/nconf.gui.o: $(obj)/nconf-cfg $(obj)/nconf.o $(obj)/nconf.gui.o: $(obj)/nconf-cfg
# mconf: Used for the menuconfig target based on lxdialog # mconf: Used for the menuconfig target based on lxdialog
hostprogs-y += mconf hostprogs += mconf
lxdialog := $(addprefix lxdialog/, \ lxdialog := $(addprefix lxdialog/, \
checklist.o inputbox.o menubox.o textbox.o util.o yesno.o) checklist.o inputbox.o menubox.o textbox.o util.o yesno.o)
mconf-objs := mconf.o $(lxdialog) $(common-objs) mconf-objs := mconf.o $(lxdialog) $(common-objs)
...@@ -183,7 +183,7 @@ $(foreach f, mconf.o $(lxdialog), \ ...@@ -183,7 +183,7 @@ $(foreach f, mconf.o $(lxdialog), \
$(addprefix $(obj)/, mconf.o $(lxdialog)): $(obj)/mconf-cfg $(addprefix $(obj)/, mconf.o $(lxdialog)): $(obj)/mconf-cfg
# qconf: Used for the xconfig target based on Qt # qconf: Used for the xconfig target based on Qt
hostprogs-y += qconf hostprogs += qconf
qconf-cxxobjs := qconf.o qconf-cxxobjs := qconf.o
qconf-objs := images.o $(common-objs) qconf-objs := images.o $(common-objs)
...@@ -199,7 +199,7 @@ $(obj)/%.moc: $(src)/%.h $(obj)/qconf-cfg ...@@ -199,7 +199,7 @@ $(obj)/%.moc: $(src)/%.h $(obj)/qconf-cfg
$(call cmd,moc) $(call cmd,moc)
# gconf: Used for the gconfig target based on GTK+ # gconf: Used for the gconfig target based on GTK+
hostprogs-y += gconf hostprogs += gconf
gconf-objs := gconf.o images.o $(common-objs) gconf-objs := gconf.o images.o $(common-objs)
HOSTLDLIBS_gconf = $(shell . $(obj)/gconf-cfg && echo $$libs) HOSTLDLIBS_gconf = $(shell . $(obj)/gconf-cfg && echo $$libs)
......
# SPDX-License-Identifier: GPL-2.0 # SPDX-License-Identifier: GPL-2.0
OBJECT_FILES_NON_STANDARD := y OBJECT_FILES_NON_STANDARD := y
hostprogs-y := modpost mk_elfconfig hostprogs := modpost mk_elfconfig
always := $(hostprogs-y) empty.o always-y := $(hostprogs) empty.o
modpost-objs := modpost.o file2alias.o sumversion.o modpost-objs := modpost.o file2alias.o sumversion.o
......
# SPDX-License-Identifier: GPL-2.0 # SPDX-License-Identifier: GPL-2.0
hostprogs-y := genheaders hostprogs := genheaders
HOST_EXTRACFLAGS += \ HOST_EXTRACFLAGS += \
-I$(srctree)/include/uapi -I$(srctree)/include \ -I$(srctree)/include/uapi -I$(srctree)/include \
-I$(srctree)/security/selinux/include -I$(srctree)/security/selinux/include
always := $(hostprogs-y) always-y := $(hostprogs)
# SPDX-License-Identifier: GPL-2.0 # SPDX-License-Identifier: GPL-2.0
hostprogs-y := mdp hostprogs := mdp
HOST_EXTRACFLAGS += \ HOST_EXTRACFLAGS += \
-I$(srctree)/include/uapi -I$(srctree)/include \ -I$(srctree)/include/uapi -I$(srctree)/include \
-I$(srctree)/security/selinux/include -I$(objtree)/include -I$(srctree)/security/selinux/include -I$(objtree)/include
always := $(hostprogs-y) always-y := $(hostprogs)
clean-files := policy.* file_contexts clean-files := policy.* file_contexts
...@@ -52,7 +52,7 @@ ifeq ($(cpio-data),) ...@@ -52,7 +52,7 @@ ifeq ($(cpio-data),)
cpio-data := $(obj)/initramfs_data.cpio cpio-data := $(obj)/initramfs_data.cpio
hostprogs-y := gen_init_cpio hostprogs := gen_init_cpio
# .initramfs_data.cpio.d is used to identify all files included # .initramfs_data.cpio.d is used to identify all files included
# in initramfs and to detect if any files are added/removed. # in initramfs and to detect if any files are added/removed.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment