Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Glasgow Haskell Compiler
GHC
Commits
7d42fdac
Commit
7d42fdac
authored
Jan 18, 2015
by
Andrey Mokhov
Browse files
Clean up rules related to dependency lists.
parent
d6744a70
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/Package/Compile.hs
View file @
7d42fdac
...
...
@@ -48,7 +48,7 @@ buildRule pkg @ (Package name path _) todo @ (stage, dist, _) =
let
oPattern
=
"*."
++
osuf
way
let
hiPattern
=
"*."
++
hisuf
way
[
buildDir
<//>
oPattern
,
buildDir
<//>
hiPattern
]
|%>
\
out
->
do
need
[
argListPath
argListDir
pkg
stage
,
hDepFile
,
cDepFile
]
need
[
argListPath
argListDir
pkg
stage
]
let
obj
=
toStandard
$
out
-<.>
osuf
way
vanillaObj
=
toStandard
$
out
-<.>
"o"
-- TODO: keep only vanilla dependencies in hDepFile
...
...
src/Package/Dependencies.hs
View file @
7d42fdac
...
...
@@ -16,7 +16,7 @@ ghcArgs (Package name path _) (stage, dist, settings) =
,
includeGhcArgs
path
dist
,
concatArgs
[
"-optP"
]
$
CppArgs
pathDist
,
productArgs
[
"-odir"
,
"-stubdir"
,
"-hidir"
]
buildDir
,
args
[
"-dep-makefile"
,
depFile
<.>
"new"
]
,
args
[
"-dep-makefile"
,
depFile
]
,
productArgs
"-dep-suffix"
$
map
wayPrefix
<$>
ways
settings
,
args
$
HsArgs
pathDist
,
args
$
pkgHsSources
path
dist
]
...
...
@@ -60,19 +60,17 @@ buildRule :: Package -> TodoItem -> Rules ()
buildRule
pkg
@
(
Package
name
path
_
)
todo
@
(
stage
,
dist
,
settings
)
=
do
let
pathDist
=
path
</>
dist
buildDir
=
pathDist
</>
"build"
hDepFile
=
buildDir
</>
"haskell.deps"
cDepFile
=
buildDir
</>
"c.deps"
hDepFile
%>
\
out
->
do
(
buildDir
</>
"haskell.deps"
)
%>
\
out
->
do
need
[
argListPath
argListDir
pkg
stage
]
terseRun
(
Ghc
stage
)
$
ghcArgs
pkg
todo
-- Avoid rebuilding dependecies of out if it hasn't changed:
-- Note: cannot use copyFileChanged as it depends on the source file
deps
<-
liftIO
$
readFile
$
out
<.>
"new"
writeFileChanged
out
deps
liftIO
$
removeFiles
"."
[
out
<.>
"new"
]
--
deps <- liftIO $ readFile $ out <.> "new"
--
writeFileChanged out deps
--
liftIO $ removeFiles "." [out <.> "new"]
cDepFile
%>
\
out
->
do
(
buildDir
</>
"c.deps"
)
%>
\
out
->
do
need
[
argListPath
argListDir
pkg
stage
]
srcs
<-
args
$
CSrcs
pathDist
deps
<-
fmap
concat
$
forM
srcs
$
\
src
->
do
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment