aboutsummaryrefslogtreecommitdiff
path: root/bootstrap/src/BuildModel.hs
diff options
context:
space:
mode:
authorBrad Richardson <everythingfunctional@protonmail.com>2020-10-20 14:56:00 -0500
committerBrad Richardson <everythingfunctional@protonmail.com>2020-10-20 14:56:00 -0500
commita42d68ad4386a7a797eaaa35bdf501c0344f60e9 (patch)
treed13b10a70e0450d12bd36b3dd1170f3768ae946e /bootstrap/src/BuildModel.hs
parent0799961cdd047005021549c32d8f8d7731f40d27 (diff)
downloadfpm-a42d68ad4386a7a797eaaa35bdf501c0344f60e9.tar.gz
fpm-a42d68ad4386a7a797eaaa35bdf501c0344f60e9.zip
Add tests for submodule's compile time info
Diffstat (limited to 'bootstrap/src/BuildModel.hs')
-rw-r--r--bootstrap/src/BuildModel.hs18
1 files changed, 17 insertions, 1 deletions
diff --git a/bootstrap/src/BuildModel.hs b/bootstrap/src/BuildModel.hs
index b8fc537..dfbab72 100644
--- a/bootstrap/src/BuildModel.hs
+++ b/bootstrap/src/BuildModel.hs
@@ -120,7 +120,23 @@ constructCompileTimeInfo m@(Module{}) availableModules buildDirectory =
(\mName -> buildDirectory </> mName <.> "mod")
(filter (`elem` availableModules) (moduleModulesUsed m))
}
-constructCompileTimeInfo _ otherSources buildDirectory = undefined
+constructCompileTimeInfo s@(Submodule{}) availableModules buildDirectory =
+ CompileTimeInfo
+ { compileTimeInfoSourceFileName = submoduleSourceFileName s
+ , compileTimeInfoObjectFileProduced = (submoduleObjectFileName s)
+ buildDirectory
+ , compileTimeInfoOtherFilesProduced = [ buildDirectory
+ </> submoduleParentName s
+ ++ "@"
+ ++ submoduleName s
+ <.> "smod"
+ ]
+ , compileTimeInfoDirectDependencies =
+ (buildDirectory </> submoduleParentName s <.> "smod")
+ : (map (\mName -> buildDirectory </> mName <.> "mod")
+ (filter (`elem` availableModules) (submoduleModulesUsed s))
+ )
+ }
pathSeparatorsToUnderscores :: FilePath -> FilePath
pathSeparatorsToUnderscores fileName =