summaryrefslogtreecommitdiffstats
path: root/scripts/Makefile.build
Commit message (Collapse)AuthorAgeFilesLines
* kbuild: add %.lex.c and %.tab.[ch] to 'targets' automaticallyMasahiro Yamada2019-01-031-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | Linux commit b23d1a241f4eb44ae55785c9b65274717c8e2c1e (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>
* kbuild: filter-out PHONY targets from "targets"Masahiro Yamada2019-01-031-1/+1
| | | | | | | | | | | | | | | | | | Linux commit 591f66899784ae0afa13ff9a3eb5ce0a4358e48b The variable "targets" contains object paths for which existing .*.cmd files should be included. scripts/Makefile.build automatically adds $(MAKECMDGOALS) to "targets" as follows: targets += $(extra-y) $(MAKECMDGOALS) $(always) The $(MAKECMDGOALS) is a PHONY target in several places. PHONY targets never create .*.cmd files. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* kbuild: handle multi-objs dependency appropriatelyMasahiro Yamada2014-11-271-6/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | The comment in scripts/Makefile.build says as follows: We would rather have a list of rules like foo.o: $(foo-objs) but that's not so easy, so we rather make all composite objects depend on the set of all their parts This commit makes it possible! For example, assume a Makefile like this obj-m = foo.o bar.o foo-objs := foo1.o foo2.o bar-objs := bar1.o bar2.o Without this patch, foo.o depends on all of foo1.o foo2.o bar1.o bar2.o. It looks funny that foo.o is regenerated when bar1.c is updated. Now we can handle the dependency of foo.o and bar.o separately. Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com> Signed-off-by: Michal Marek <mmarek@suse.cz>
* pbl: Fix typo in make causing pbl files to be rebuiltSascha Hauer2013-05-251-1/+1
| | | | | | | We had pbl_cc__o_c instead of pbl_cc_o_c. This caused all pbl object files to be rebuilt everytime due to missing .cmd file. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* pbl: Add missing FORCESascha Hauer2012-10-261-2/+2
| | | | | | Otherwise the pbl files do not get rebuilt when the CFLAGS change. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* kbuild: allow to have custom cppflags for pblJean-Christophe PLAGNIOL-VILLARD2012-08-031-2/+2
| | | | Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
* kbuild: add pre-bootloader (pbl) targetJean-Christophe PLAGNIOL-VILLARD2012-08-031-3/+45
| | | | | | | | | | This will allow to link compiled object to the built-in-pbl.o across the source tree that will be finally link to the pbl. Now we compile the source %.c in pbl-%.o and provide -D__PBL__ so we can known in the source when it's compile for barebox or the pbl. Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
* kbuild: Init all relevant variables used in kbuild filesJean-Christophe PLAGNIOL-VILLARD2012-07-301-1/+24
| | | | | | | import from linux 3.5-rc5 Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Only pass -P to cpp when generating ld scriptsLoïc Minier2011-10-181-1/+1
| | | | | | | | | | | | | | | | | | | | | | | When building sandbox with ccache, one would hit warnings such as: warning: 'struct mmsghdr' declared inside parameter list on random files; a way to reproduce this issue is to build a simple file doing just: #include <sys/socket.h> int main(void) { return 0; } gcc -Wall -P -c -o foo foo.c But actually the -P flag is only useful when generating non-C files, such as linker scripts in the case of barebox. Removing the -P flag from all the gcc invocations, except when generating .lds files makes the warning go away. It turns out that this is what linux/scripts/Makefile.build also does nowadays. Signed-off-by: Loïc Minier <loic.minier@linaro.org> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* svn_rev_008Sascha Hauer2007-07-051-0/+349
add missing Kconfig