From 5f16555d030ff120d5175477886473de40654659 Mon Sep 17 00:00:00 2001 From: Brad Richardson Date: Thu, 22 Oct 2020 13:42:10 -0500 Subject: Add some debugging code --- bootstrap/src/Build.hs | 4 ++++ bootstrap/src/BuildModel.hs | 5 +++++ 2 files changed, 9 insertions(+) (limited to 'bootstrap') 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 -- cgit v1.2.3