From a42d68ad4386a7a797eaaa35bdf501c0344f60e9 Mon Sep 17 00:00:00 2001 From: Brad Richardson Date: Tue, 20 Oct 2020 14:56:00 -0500 Subject: Add tests for submodule's compile time info --- bootstrap/src/BuildModel.hs | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'bootstrap/src/BuildModel.hs') 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 = -- cgit v1.2.3