aboutsummaryrefslogtreecommitdiff
path: root/bootstrap/src
diff options
context:
space:
mode:
Diffstat (limited to 'bootstrap/src')
-rw-r--r--bootstrap/src/Build.hs4
-rw-r--r--bootstrap/src/BuildModel.hs5
2 files changed, 9 insertions, 0 deletions
diff --git a/bootstrap/src/Build.hs b/bootstrap/src/Build.hs
index ce8ea1d..fc339e7 100644
--- a/bootstrap/src/Build.hs
+++ b/bootstrap/src/Build.hs
@@ -12,6 +12,7 @@ import BuildModel ( CompileTimeInfo(..)
, constructCompileTimeInfo
, getAllObjectFiles
, getAvailableModules
+ , getSourceFileName
, processRawSource
)
import Data.List ( intercalate
@@ -65,12 +66,15 @@ buildProgram programDirectory' libraryDirectories sourceExtensions buildDirector
let programDirectory = foldl1 (</>) (splitDirectories programDirectory')
let includeFlags = map ("-I" ++) libraryDirectories
sourceFiles <- getDirectoriesFiles [programDirectory] sourceExtensions
+ print sourceFiles
+ print (programDirectory </> programSource)
rawSources <- mapM sourceFileToRawSource sourceFiles
let sources' = map processRawSource rawSources
let isThisProgramOrNotProgram p@(Program{}) =
programSourceFileName p == programDirectory </> programSource
isThisProgramOrNotProgram _ = True
let sources = filter isThisProgramOrNotProgram sources'
+ print (map getSourceFileName sources)
let availableModules = getAvailableModules sources
let compileTimeInfo = map
(\s -> constructCompileTimeInfo s availableModules buildDirectory)
diff --git a/bootstrap/src/BuildModel.hs b/bootstrap/src/BuildModel.hs
index 6dc8ddf..d7b39dc 100644
--- a/bootstrap/src/BuildModel.hs
+++ b/bootstrap/src/BuildModel.hs
@@ -109,6 +109,11 @@ getAllObjectFiles buildDirectory sources = map getObjectFile sources
getObjectFile m@(Module{} ) = (moduleObjectFileName m) buildDirectory
getObjectFile s@(Submodule{}) = (submoduleObjectFileName s) buildDirectory
+getSourceFileName :: Source -> FilePath
+getSourceFileName p@(Program{}) = programSourceFileName p
+getSourceFileName m@(Module{}) = moduleSourceFileName m
+getSourceFileName s@(Submodule{}) = submoduleSourceFileName s
+
constructCompileTimeInfo :: Source -> [String] -> FilePath -> CompileTimeInfo
constructCompileTimeInfo p@(Program{}) availableModules buildDirectory =
CompileTimeInfo