1
0
mirror of https://github.com/Zygo/bees.git synced 2025-05-17 21:35:45 +02:00
bees/lib/Makefile
Kai Krakow d6b847db0d 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>
2018-01-18 22:53:00 +01:00

46 lines
840 B
Makefile

TAG := $(shell git describe --always --dirty || echo UNKNOWN)
default: libcrucible.so
%.so: Makefile
CRUCIBLE_OBJS = \
chatter.o \
cleanup.o \
crc64.o \
error.o \
extentwalker.o \
fd.o \
fs.o \
ntoa.o \
path.o \
process.o \
string.o \
task.o \
time.o \
uuid.o \
.version.o \
libcrucible.so: $(CRUCIBLE_OBJS)
include ../makeflags
.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
echo "namespace crucible { const char *VERSION = \"$(TAG)\"; }" > $@.new
mv -f $@.new $@
include depends.mk
%.o: %.cc ../makeflags
$(CXX) $(CXXFLAGS) -fPIC -o $@ -c $<
%.so:
$(CXX) $(LDFLAGS) -fPIC -o $@ $^ -shared -Wl,-soname,$@ -luuid