mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-22 17:01:14 +00:00
![Masahiro Yamada](/assets/img/avatar_default.png)
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>
31 lines
950 B
Makefile
31 lines
950 B
Makefile
# SPDX-License-Identifier: GPL-2.0
|
|
|
|
hostprogs := genksyms
|
|
always-y := $(hostprogs)
|
|
|
|
genksyms-objs := genksyms.o parse.tab.o lex.lex.o
|
|
|
|
# FIXME: fix the ambiguous grammar in parse.y and delete this hack
|
|
#
|
|
# Suppress shift/reduce, reduce/reduce conflicts warnings
|
|
# unless W=1 is specified.
|
|
#
|
|
# Just in case, run "$(YACC) --version" without suppressing stderr
|
|
# so that 'bison: not found' will be displayed if it is missing.
|
|
ifeq ($(findstring 1,$(KBUILD_EXTRA_WARN)),)
|
|
|
|
quiet_cmd_bison_no_warn = $(quiet_cmd_bison)
|
|
cmd_bison_no_warn = $(YACC) --version >/dev/null; \
|
|
$(cmd_bison) 2>/dev/null
|
|
|
|
$(obj)/pars%.tab.c $(obj)/pars%.tab.h: $(src)/pars%.y FORCE
|
|
$(call if_changed,bison_no_warn)
|
|
|
|
endif
|
|
|
|
# -I needed for generated C source (shipped source)
|
|
HOSTCFLAGS_parse.tab.o := -I $(srctree)/$(src)
|
|
HOSTCFLAGS_lex.lex.o := -I $(srctree)/$(src)
|
|
|
|
# dependencies on generated files need to be listed explicitly
|
|
$(obj)/lex.lex.o: $(obj)/parse.tab.h
|