]> git.hungrycats.org Git - bees/commitdiff
lib: simplify dependency generation
authorZygo Blaxell <bees@furryterror.org>
Mon, 23 Jan 2023 02:28:28 +0000 (21:28 -0500)
committerZygo Blaxell <bees@furryterror.org>
Sat, 28 Jan 2023 03:16:02 +0000 (22:16 -0500)
We don't need to run all the dependencies first, Make can do those in parallel.

Signed-off-by: Zygo Blaxell <bees@furryterror.org>
lib/Makefile

index eb83a72647d61b40f818543eb5029d67e49c17b9..17f2041c1110e38ebedab2a541e00e02d6f32acf 100644 (file)
@@ -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 $<