From 4df1b2c8346ebf64d7b605f17d0d6ae667723647 Mon Sep 17 00:00:00 2001 From: Zygo Blaxell Date: Sun, 22 Jan 2023 21:28:28 -0500 Subject: [PATCH] lib: simplify dependency generation We don't need to run all the dependencies first, Make can do those in parallel. Signed-off-by: Zygo Blaxell --- lib/Makefile | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/lib/Makefile b/lib/Makefile index eb83a72..17f2041 100644 --- a/lib/Makefile +++ b/lib/Makefile @@ -32,22 +32,15 @@ BEES_LDFLAGS = $(LDFLAGS) configure.h: configure.h.in $(TEMPLATE_COMPILER) -.depends: - mkdir -p $@ - -.depends/%.dep: %.cc configure.h Makefile | .depends +%.dep: %.cc configure.h Makefile $(CXX) $(BEES_CXXFLAGS) -M -MF $@ -MT $(<:.cc=.o) $< -depends.mk: $(CRUCIBLE_OBJS:%.o=.depends/%.dep) - cat $^ > $@.new - mv -f $@.new $@ +include $(CRUCIBLE_OBJS:%.o=%.dep) .version.cc: configure.h Makefile ../makeflags $(CRUCIBLE_OBJS:.o=.cc) ../include/crucible/*.h echo "namespace crucible { const char *VERSION = \"$(TAG)\"; }" > $@.new if ! cmp "$@.new" "$@"; then mv -fv $@.new $@; fi -include depends.mk - %.o: %.cc ../makeflags $(CXX) $(BEES_CXXFLAGS) -o $@ -c $<