1
0
mirror of https://github.com/Zygo/bees.git synced 2025-06-16 17:46:16 +02:00

Makefile: speedup dependency generation

Dependencies can be generated in parallel which can be much faster. It
also puts away the problem that for may fail multiple times in a row and
leaving behind a broken intermediate file which would be picked up by
successive runs.

Signed-off-by: Kai Krakow <kai@kaishome.de>
This commit is contained in:
Kai Krakow
2018-01-16 01:02:57 +01:00
parent b8f933d360
commit d6b847db0d
4 changed files with 37 additions and 25 deletions

View File

@ -24,8 +24,12 @@ libcrucible.so: $(CRUCIBLE_OBJS)
include ../makeflags
depends.mk: *.cc
for x in $^; do $(CXX) $(CXXFLAGS) -M -MG -MT "$${x/%.cc/.o}" "$$x"; done > $@.new
.depends/%.dep: %.cc Makefile
@mkdir -p .depends
$(CXX) $(CXXFLAGS) -M -MF $@ -MT $(<:.cc=.o) $<
depends.mk: $(CRUCIBLE_OBJS:%.o=.depends/%.dep)
cat $^ > $@.new
mv -f $@.new $@
.version.cc: Makefile ../makeflags *.cc ../include/crucible/*.h