From c3abb521767553017dfa8052b1960434bc0e773f Mon Sep 17 00:00:00 2001 From: Jorj Bauer Date: Fri, 10 Jul 2020 10:27:10 -0400 Subject: [PATCH] better (simpler, more modern) dependency handling --- Makefile | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/Makefile b/Makefile index bf65608..4b80375 100755 --- a/Makefile +++ b/Makefile @@ -51,13 +51,10 @@ clean: rm -f *.o *~ */*.o */*~ testharness.basic testharness.verbose testharness.extended testharness apple/diskii-rom.h apple/applemmu-rom.h apple/parallel-rom.h aiie-sdl *.d */*.d # Automatic dependency handling --include $(OBJS:.o=.d) -%.o: %.cpp - g++ -c $(CXXFLAGS) $^ -o $*.o - g++ -MM $(CXXFLAGS) $^ > $*.d - @mv -f $*.d $*.d.tmp - @sed -e 's|.*:|$*.o:|' < $*.d.tmp > $*.d - @sed -e 's/.*://' -e 's/\\$$//' < $*.d.tmp | fmt -1 | \ - sed -e 's/^ *//' -e 's/$$/:/' >> $*.d - @rm -f $*.d.tmp +-include *.d +-include apple/*.d +-include nix/*.d +-include sdl/*.d +%.o: %.cpp + g++ $(CXXFLAGS) -MMD -MP -c $< -o $@