kbuild: add %.lex.c and %.tab.[ch] to 'targets' automatically
Linux commit b23d1a2
(adjust commit log for barebox)

This will be needed for Barebox to switch to the compile-time
generation of lexers and parsers.

Files generated by if_changed* must be added to 'targets' to include
*.cmd files.  Otherwise, they would be regenerated every time.

The build system automatically adds objects to 'targets' where
appropriate, such as obj-y, extra-y, etc. but does nothing for
intermediate files.  So, each Makefile needs to add them by itself.

There are some common cases where objects are generated by chained
rules.  Lexers and parsers are compiled like follows:

   %.lex.o <- %.lex.c <- %.l
   %.tab.o <- %.tab.c <- %.y

They are common patterns, so it is reasonable to take care of them
in the core Makefile instead of requiring each Makefile to do so.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
1 parent b2a0934 commit 733028bb647730a1f0c66cded92e684b84fd6100
@Masahiro Yamada Masahiro Yamada authored on 30 Dec 2018
Sascha Hauer committed on 3 Jan 2019
Showing 1 changed file
View
scripts/Makefile.build