From 0c4441c74a71b5923cd4c6ebe07cc03d45d09f3a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Thorsten=20Wi=C3=9Fmann?= <uni@thorsten-wissmann.de>
Date: Thu, 3 Oct 2013 23:13:06 +0200
Subject: [PATCH] Makefile: include .depend as a dependency

Use -include directive to tell Make that Make itself has to create the
.depend file. Therefore, add a .depend target in addition to the phony
depend target.
---
 Makefile | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/Makefile b/Makefile
index c7cadb6..451a944 100644
--- a/Makefile
+++ b/Makefile
@@ -17,7 +17,7 @@
 NATIVE := true
 
 # If defined, the dependencies will be updated automatically.
-CHECKDEP :=
+CHECKDEP := 1
 
 # If defined, it indicates the number of cores
 # that make should use (e.g. -j2 for two cores).
@@ -107,12 +107,11 @@ clean:
 
 
 .PHONY: depend
-depend:
-	$(OCAMLDEP) $(SOURCESMLI) $(SOURCESML) > .depend
+depend: .depend
 
 ifdef CHECKDEP
 .depend: $(SOURCESMLI) $(SOURCESML)
-	$(OCAMLDEP) $(SOURCESMLI) $(SOURCESML) > .depend
+	$(OCAMLDEP) $(SOURCESMLI) $(SOURCESML) > $@
 endif
 
-include .depend
+-include .depend
-- 
GitLab