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
6ce7cd3a
Commit
6ce7cd3a
authored
Jan 14, 2015
by
Andrey Mokhov
Browse files
Use multiple output rules for *.o and *.hi files.
parent
7ad0b09d
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/Package/Compile.hs
View file @
6ce7cd3a
...
...
@@ -11,16 +11,16 @@ import Development.Shake.Util
-ilibraries/deepseq/dist-install/build/autogen
-Ilibraries/deepseq/dist-install/build
-Ilibraries/deepseq/dist-install/build/autogen
-Ilibraries/deepseq/.
-Ilibraries/deepseq/.
-optP-include -optPlibraries/deepseq/dist-install/build/autogen/cabal_macros.h
-package-key array_3w0nMK0JfaFJPpLFn2yWAJ
-package-key base_469rOtLAqwTGFEOGWxSUiQ
-package-key ghcpr_FgrV6cgh2JHBlbcx1OSlwt
-Wall -XHaskell2010 -O2 -no-user-package-db -rtsopts
-Wall -XHaskell2010 -O2 -no-user-package-db -rtsopts
-odir libraries/deepseq/dist-install/build
-hidir libraries/deepseq/dist-install/build
-stubdir libraries/deepseq/dist-install/build
-split-objs
-split-objs
-c libraries/deepseq/./Control/DeepSeq.hs
-o libraries/deepseq/dist-install/build/Control/DeepSeq.o -}
...
...
@@ -29,13 +29,13 @@ suffixArgs way = arg ["-hisuf", hisuf way]
<>
arg
[
"-osuf"
,
osuf
way
]
<>
arg
[
"-hcsuf"
,
hcsuf
way
]
oRu
le
::
Package
->
TodoItem
->
Rules
()
oRu
le
(
Package
name
path
_
)
(
stage
,
dist
,
settings
)
=
buildPackageCompi
le
::
Package
->
TodoItem
->
Rules
()
buildPackageCompi
le
(
Package
name
path
_
)
(
stage
,
dist
,
settings
)
=
let
buildDir
=
toStandard
$
path
</>
dist
</>
"build"
pkgData
=
path
</>
dist
</>
"package-data.mk"
depFile
=
buildDir
</>
name
<.>
"m"
depFile
=
buildDir
</>
takeBaseName
name
<.>
"m"
in
(
buildDir
<//>
"*o"
)
%>
\
out
->
do
[
buildDir
<//>
"*o"
,
buildDir
<//>
"*hi"
]
&
%>
\
[
out
,
_
]
->
do
let
way
=
detectWay
$
tail
$
takeExtension
out
need
[
"shake/src/Package/Compile.hs"
]
need
[
depFile
]
...
...
@@ -48,24 +48,12 @@ oRule (Package name path _) (stage, dist, settings) =
<>
arg
SrcHcOpts
<>
packageArgs
stage
pkgData
<>
includeArgs
path
dist
<>
concatArgs
[
"-optP"
]
(
CppOpts
pkgData
)
-- TODO: use HC_OPTS from
pkgData
<>
concatArgs
[
"-optP"
]
(
CppOpts
pkgData
)
<>
arg
(
HsOpts
pkgData
)
-- TODO: now we have both -O and -O2
<>
arg
[
"-Wall"
,
"-XHaskell2010"
,
"-O2"
]
--
<> arg ["-O2"]
<>
productArgs
[
"-odir"
,
"-hidir"
,
"-stubdir"
]
buildDir
<>
when
(
splitObjects
stage
)
(
arg
"-split-objs"
)
<>
arg
(
"-c"
:
srcs
)
<>
arg
[
"-o"
,
toStandard
out
]
-- TODO: This rule looks hacky... combine it with the above?
hiRule
::
Package
->
TodoItem
->
Rules
()
hiRule
(
Package
name
path
_
)
(
stage
,
dist
,
settings
)
=
let
buildDir
=
path
</>
dist
</>
"build"
in
(
buildDir
<//>
"*hi"
)
%>
\
out
->
do
let
way
=
detectWay
$
tail
$
takeExtension
out
oFile
=
out
-<.>
osuf
way
need
[
oFile
]
buildPackageCompile
::
Package
->
TodoItem
->
Rules
()
buildPackageCompile
=
oRule
<>
hiRule
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