summary refs log tree commit diff stats
path: root/compiler/main.nim
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/main.nim')
-rw-r--r--compiler/main.nim8
1 files changed, 8 insertions, 0 deletions
diff --git a/compiler/main.nim b/compiler/main.nim
index f13375948..e6563f281 100644
--- a/compiler/main.nim
+++ b/compiler/main.nim
@@ -31,11 +31,19 @@ proc semanticPasses =
   registerPass verbosePass
   registerPass semPass
 
+proc writeDepsFile(g: ModuleGraph; project: string) =
+  let f = open(changeFileExt(project, "deps"), fmWrite)
+  for m in g.modules:
+    if m != nil:
+      f.writeLine(toFullPath(m.position.int32))
+  f.close()
+
 proc commandGenDepend(graph: ModuleGraph; cache: IdentCache) =
   semanticPasses()
   registerPass(gendependPass)
   #registerPass(cleanupPass)
   compileProject(graph, cache)
+  writeDepsFile(graph, gProjectFull)
   generateDot(gProjectFull)
   execExternalProgram("dot -Tpng -o" & changeFileExt(gProjectFull, "png") &
       ' ' & changeFileExt(gProjectFull, "dot"))