]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
kbuild: move flex and bison rules to Makefile.host
authorMasahiro Yamada <yamada.masahiro@socionext.com>
Sat, 20 Jul 2019 16:27:40 +0000 (01:27 +0900)
committerMasahiro Yamada <yamada.masahiro@socionext.com>
Tue, 13 Aug 2019 16:10:42 +0000 (01:10 +0900)
Flex and bison are used for kconfig, dtc, genksyms, all of which are
host programs. I never imagine the kernel embeds a parser or a lexer.

Move the flex and bison rules to scripts/Makefile.host. This file is
included only when hostprogs-y etc. is present in the Makefile in the
directory. So, parsing these rules are skipped in most of directories.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
scripts/Makefile.host
scripts/Makefile.lib

index 2208ebbd8c4c02243fc6a9717110ac90450f25b8..b402c619147d9e18b6283f0f1ddb3acb47b2b99e 100644 (file)
@@ -1,4 +1,21 @@
 # SPDX-License-Identifier: GPL-2.0
+
+# LEX
+# ---------------------------------------------------------------------------
+quiet_cmd_flex = LEX     $@
+      cmd_flex = $(LEX) -o$@ -L $<
+
+$(obj)/%.lex.c: $(src)/%.l FORCE
+       $(call if_changed,flex)
+
+# YACC
+# ---------------------------------------------------------------------------
+quiet_cmd_bison = YACC    $(basename $@).[ch]
+      cmd_bison = $(YACC) -o $(basename $@).c --defines=$(basename $@).h -t -l $<
+
+$(obj)/%.tab.c $(obj)/%.tab.h: $(src)/%.y FORCE
+       $(call if_changed,bison)
+
 # ==========================================================================
 # Building binaries on the host system
 # Binaries are used during the compilation of the kernel, for example
index 67d1165ab2ab9005c14d2c1d41796b60fd63b844..49d20f3562639dbd218425e5e184d3cf585be6d0 100644 (file)
@@ -187,22 +187,6 @@ $(foreach m, $(notdir $1), \
        $(addprefix $(obj)/, $(foreach s, $3, $($(m:%$(strip $2)=%$(s)))))))
 endef
 
-# LEX
-# ---------------------------------------------------------------------------
-quiet_cmd_flex = LEX     $@
-      cmd_flex = $(LEX) -o$@ -L $<
-
-$(obj)/%.lex.c: $(src)/%.l FORCE
-       $(call if_changed,flex)
-
-# YACC
-# ---------------------------------------------------------------------------
-quiet_cmd_bison = YACC    $(basename $@).[ch]
-      cmd_bison = $(YACC) -o $(basename $@).c --defines=$(basename $@).h -t -l $<
-
-$(obj)/%.tab.c $(obj)/%.tab.h: $(src)/%.y FORCE
-       $(call if_changed,bison)
-
 # Shipped files
 # ===========================================================================