Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Shayne Fletcher
Glasgow Haskell Compiler
Commits
4d5a0088
Commit
4d5a0088
authored
Sep 23, 2005
by
simonmar
Browse files
[project @ 2005-09-23 10:13:33 by simonmar]
in --make mode, don't re-link when the executable is up to date.
parent
5d5fb808
Changes
1
Hide whitespace changes
Inline
Side-by-side
ghc/compiler/main/DriverPipeline.hs
View file @
4d5a0088
...
...
@@ -307,11 +307,27 @@ link BatchCompile dflags batch_attempt_linking hpt
return
Succeeded
else
do
debugTraceMsg
dflags
1
"Linking ..."
let
getOfiles
(
LM
_
_
us
)
=
map
nameOfObject
(
filter
isObject
us
)
obj_files
=
concatMap
getOfiles
linkables
exe_file
=
exeFileName
dflags
-- if the modification time on the executable is later than the
-- modification times on all of the objects, then omit linking
-- (unless the -no-recomp flag was given).
e_exe_time
<-
IO
.
try
$
getModificationTime
exe_file
let
linking_needed
|
Left
_
<-
e_exe_time
=
True
|
Right
t
<-
e_exe_time
=
any
(
t
<
)
(
map
linkableTime
linkables
)
if
dopt
Opt_RecompChecking
dflags
&&
not
linking_needed
then
do
debugTraceMsg
dflags
1
(
exe_file
++
" is up to date, linking not required."
)
return
Succeeded
else
do
debugTraceMsg
dflags
1
"Linking ..."
-- Don't showPass in Batch mode; doLink will do that for us.
staticLink
dflags
obj_files
pkg_deps
...
...
@@ -1098,18 +1114,12 @@ getHCFilePackages filename =
staticLink
::
DynFlags
->
[
FilePath
]
->
[
PackageId
]
->
IO
()
staticLink
dflags
o_files
dep_packages
=
do
let
verb
=
getVerbFlag
dflags
output_fn
=
exeFileName
dflags
-- get the full list of packages to link with, by combining the
-- explicit packages with the auto packages and all of their
-- dependencies, and eliminating duplicates.
let
o_file
=
outputFile
dflags
#
if
defined
(
mingw32_HOST_OS
)
let
output_fn
=
case
o_file
of
{
Just
s
->
s
;
Nothing
->
"main.exe"
;
}
#
else
let
output_fn
=
case
o_file
of
{
Just
s
->
s
;
Nothing
->
"a.out"
;
}
#
endif
pkg_lib_paths
<-
getPackageLibraryPath
dflags
dep_packages
let
pkg_lib_path_opts
=
map
(
"-L"
++
)
pkg_lib_paths
...
...
@@ -1195,6 +1205,17 @@ staticLink dflags o_files dep_packages = do
if
success
then
return
()
else
throwDyn
(
InstallationError
(
"cannot move binary to PVM dir"
)))
exeFileName
::
DynFlags
->
FilePath
exeFileName
dflags
|
Just
s
<-
outputFile
dflags
=
s
|
otherwise
=
#
if
defined
(
mingw32_HOST_OS
)
"main.exe"
#
else
"a.out"
#
endif
-----------------------------------------------------------------------------
-- Making a DLL (only for Win32)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a 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