diff options
author | Brad Richardson <everythingfunctional@protonmail.com> | 2020-10-20 16:48:19 -0500 |
---|---|---|
committer | Brad Richardson <everythingfunctional@protonmail.com> | 2020-10-20 16:48:19 -0500 |
commit | 1830d3e9bedb9da860de9682b43696fd6172f34f (patch) | |
tree | 4b5feb961ed5551965366e8baaea9563dc269c63 /bootstrap/src/BuildModel.hs | |
parent | a42d68ad4386a7a797eaaa35bdf501c0344f60e9 (diff) | |
download | fpm-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.hs | 13 |
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 |