Build: autogenerate dependency files (*.d)
authorDavin McCall <davmac@davmac.org>
Sat, 3 Jun 2017 08:43:05 +0000 (09:43 +0100)
committerDavin McCall <davmac@davmac.org>
Sat, 3 Jun 2017 08:43:05 +0000 (09:43 +0100)
src/Makefile

index a163de031b5635842de6c0a4cfe9030565af97bf..f067f31a8ccf5f0269f167ffd653e927d4d0e28e 100644 (file)
@@ -4,7 +4,7 @@ ifeq ($(BUILD_SHUTDOWN),yes)
   SHUTDOWN=shutdown
 endif
 
-objects = dinit.o load_service.o service.o control.o dinit-log.o dinitctl.o shutdown.o dinit-reboot.o
+objects = dinit.o load_service.o service.o control.o dinit-log.o dinitctl.o shutdown.o
 
 dinit_objects = dinit.o load_service.o service.o control.o dinit-log.o
 
@@ -19,9 +19,6 @@ dinitctl: dinitctl.o
 shutdown: shutdown.o
        $(CXX) -o shutdown shutdown.o
 
-dinit-reboot: dinit-reboot.o
-       $(CXX) -o dinit-reboot dinit-reboot.o   
-
 $(objects): %.o: %.cc service.h dinit-log.h control.h control-cmds.h cpbuffer.h
        $(CXX) $(CXXOPTS) -Idasynq -c $< -o $@
 
@@ -35,3 +32,8 @@ endif
 clean:
        rm -f *.o
        rm -f dinit dinitctl shutdown
+
+$(objects:.o=.d): %.d: %.cc
+       $(CXX) -Idasynq -MM -MG -MF $@ $<
+
+include $(objects:.o=.d)