aboutsummaryrefslogtreecommitdiff
path: root/bootstrap/src/Build.hs
diff options
context:
space:
mode:
authorBrad Richardson <everythingfunctional@protonmail.com>2020-12-14 08:26:49 -0600
committerGitHub <noreply@github.com>2020-12-14 08:26:49 -0600
commitc2e043baefcc57f51be9dd2c8766ee2f02697c90 (patch)
treed297fa474280794276237403e524fe163b5e5801 /bootstrap/src/Build.hs
parentdeffb94a07f9c46232fd098c34a4e7726b08204b (diff)
parent3ee23d827c3227200249791fa4cc73ce012f1a4f (diff)
downloadfpm-c2e043baefcc57f51be9dd2c8766ee2f02697c90.tar.gz
fpm-c2e043baefcc57f51be9dd2c8766ee2f02697c90.zip
Merge pull request #289 from everythingfunctional/bootstrap_compiler_support
Add support for same compilers as Fortran version to Haskell version
Diffstat (limited to 'bootstrap/src/Build.hs')
-rw-r--r--bootstrap/src/Build.hs8
1 files changed, 4 insertions, 4 deletions
diff --git a/bootstrap/src/Build.hs b/bootstrap/src/Build.hs
index 32d1979..724a1c6 100644
--- a/bootstrap/src/Build.hs
+++ b/bootstrap/src/Build.hs
@@ -75,7 +75,7 @@ buildProgram programDirectory' libraryDirectories sourceExtensions buildDirector
libraryModules <- findAvailableModules libraryDirectories
let programDirectory = foldl1 (</>) (splitDirectories programDirectory')
let buildDirectory = foldl1 (</>) (splitDirectories buildDirectory')
- let includeFlags = map (includeFlag ++) libraryDirectories
+ let includeFlags = (includeFlag ++ buildDirectory) : map (includeFlag ++) libraryDirectories
sourceFiles <- getDirectoriesFiles [programDirectory] sourceExtensions
rawSources <- mapM sourceFileToRawSource sourceFiles
let sources' = map processRawSource rawSources
@@ -108,7 +108,7 @@ buildProgram programDirectory' libraryDirectories sourceExtensions buildDirector
in fileMatcher &?> \(objectFile : _) -> do
need (sourceFile : directDependencies)
cmd compiler
- ["-c", moduleFlag ++ buildDirectory]
+ ["-c", moduleFlag, buildDirectory]
includeFlags
flags
["-o", objectFile, sourceFile]
@@ -130,7 +130,7 @@ buildLibrary
buildLibrary libraryDirectory sourceExtensions buildDirectory (CompilerSettings { compilerSettingsCompiler = compiler, compilerSettingsFlags = flags, compilerSettingsModuleFlag = moduleFlag, compilerSettingsIncludeFlag = includeFlag }) libraryName otherLibraryDirectories
= do
otherModules <- findAvailableModules otherLibraryDirectories
- let includeFlags = map (includeFlag ++) otherLibraryDirectories
+ let includeFlags = (includeFlag ++ buildDirectory) : map (includeFlag ++) otherLibraryDirectories
sourceFiles <- getDirectoriesFiles [libraryDirectory] sourceExtensions
rawSources <- mapM sourceFileToRawSource sourceFiles
let sources = map processRawSource rawSources
@@ -160,7 +160,7 @@ buildLibrary libraryDirectory sourceExtensions buildDirectory (CompilerSettings
in fileMatcher &?> \(objectFile : _) -> do
need (sourceFile : directDependencies)
cmd compiler
- ["-c", moduleFlag ++ buildDirectory]
+ ["-c", moduleFlag, buildDirectory]
includeFlags
flags
["-o", objectFile, sourceFile]