aboutsummaryrefslogtreecommitdiff
path: root/bootstrap/src/BuildModel.hs
diff options
context:
space:
mode:
authorBrad Richardson <everythingfunctional@protonmail.com>2020-10-20 16:48:19 -0500
committerBrad Richardson <everythingfunctional@protonmail.com>2020-10-20 16:48:19 -0500
commit1830d3e9bedb9da860de9682b43696fd6172f34f (patch)
tree4b5feb961ed5551965366e8baaea9563dc269c63 /bootstrap/src/BuildModel.hs
parenta42d68ad4386a7a797eaaa35bdf501c0344f60e9 (diff)
downloadfpm-1830d3e9bedb9da860de9682b43696fd6172f34f.tar.gz
fpm-1830d3e9bedb9da860de9682b43696fd6172f34f.zip
Utilize new model for build process
Diffstat (limited to 'bootstrap/src/BuildModel.hs')
-rw-r--r--bootstrap/src/BuildModel.hs13
1 files changed, 13 insertions, 0 deletions
diff --git a/bootstrap/src/BuildModel.hs b/bootstrap/src/BuildModel.hs
index dfbab72..8f4d813 100644
--- a/bootstrap/src/BuildModel.hs
+++ b/bootstrap/src/BuildModel.hs
@@ -96,6 +96,19 @@ processRawSource rawSource =
}
else undefined
+getAvailableModules :: [Source] -> [String]
+getAvailableModules = mapMaybe maybeModuleName
+ where
+ maybeModuleName m@(Module{}) = Just $ moduleName m
+ maybeModuleName _ = Nothing
+
+getAllObjectFiles :: FilePath -> [Source] -> [FilePath]
+getAllObjectFiles buildDirectory sources = map getObjectFile sources
+ where
+ getObjectFile p@(Program{} ) = (programObjectFileName p) buildDirectory
+ getObjectFile m@(Module{} ) = (moduleObjectFileName m) buildDirectory
+ getObjectFile s@(Submodule{}) = (submoduleObjectFileName s) buildDirectory
+
constructCompileTimeInfo :: Source -> [String] -> FilePath -> CompileTimeInfo
constructCompileTimeInfo p@(Program{}) availableModules buildDirectory =
CompileTimeInfo