mirror of
https://github.com/Zygo/bees.git
synced 2025-06-15 17:26:15 +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:
@ -17,9 +17,13 @@ include ../makeflags
|
||||
LIBS = -lcrucible -lpthread
|
||||
LDFLAGS = -L../lib -Wl,-rpath=$(shell realpath ../lib)
|
||||
|
||||
depends.mk: *.cc
|
||||
for x in *.cc; do $(CXX) $(CXXFLAGS) -M "$$x"; done > depends.mk.new
|
||||
mv -fv depends.mk.new depends.mk
|
||||
.depends/%.dep: %.cc
|
||||
@mkdir -p .depends
|
||||
$(CXX) $(CXXFLAGS) -M -MF $@ -MT $(<:.cc=.o) $<
|
||||
|
||||
depends.mk: $(PROGRAMS:%=.depends/%.dep)
|
||||
cat $^ > $@.new
|
||||
mv -f $@.new $@
|
||||
|
||||
include depends.mk
|
||||
|
||||
|
Reference in New Issue
Block a user