summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--compiler/GHC/Driver/MakeFile.hs10
-rw-r--r--docs/users_guide/separate_compilation.rst5
2 files changed, 8 insertions, 7 deletions
diff --git a/compiler/GHC/Driver/MakeFile.hs b/compiler/GHC/Driver/MakeFile.hs
index 5719b7dc04..382d8d6b43 100644
--- a/compiler/GHC/Driver/MakeFile.hs
+++ b/compiler/GHC/Driver/MakeFile.hs
@@ -73,15 +73,17 @@ doMkDependHS srcs = do
-- We therefore do the initial dependency generation with an empty
-- way and .o/.hi extensions, regardless of any flags that might
-- be specified.
- let dflags = dflags0
+ let dflags1 = dflags0
{ targetWays_ = Set.empty
, hiSuf_ = "hi"
, objectSuf_ = "o"
}
- GHC.setSessionDynFlags dflags
+ GHC.setSessionDynFlags dflags1
- when (null (depSuffixes dflags)) $ liftIO $
- throwGhcExceptionIO (ProgramError "You must specify at least one -dep-suffix")
+ -- If no suffix is provided, use the default -- the empty one
+ let dflags = if null (depSuffixes dflags1)
+ then dflags1 { depSuffixes = [""] }
+ else dflags1
tmpfs <- hsc_tmpfs <$> getSession
files <- liftIO $ beginMkDependHS logger tmpfs dflags
diff --git a/docs/users_guide/separate_compilation.rst b/docs/users_guide/separate_compilation.rst
index 2e4a0df1e2..64e6590942 100644
--- a/docs/users_guide/separate_compilation.rst
+++ b/docs/users_guide/separate_compilation.rst
@@ -1297,7 +1297,7 @@ following to your ``Makefile``:
.. code-block:: make
depend :
- ghc -dep-suffix '' -M $(HC_OPTS) $(SRCS)
+ ghc -M $(HC_OPTS) $(SRCS)
Now, before you start compiling, and any time you change the ``imports``
in your program, do ``make depend`` before you do ``make cool_pgm``. The command
@@ -1401,8 +1401,7 @@ generation are:
Multiple ``-dep-suffix`` flags are permitted. For example,
``-dep-suffix a_ -dep-suffix b_`` will make dependencies for ``.hs``
on ``.hi``, ``.a_hs`` on ``.a_hi``, and ``.b_hs`` on ``.b_hi``.
- Note that you must provide at least one suffix; if you do not want a suffix
- then pass ``-dep-suffix ''``.
+ If you do not use this flag then the empty suffix is used.
.. ghc-flag:: --exclude-module=⟨file⟩
:shortdesc: Regard ``⟨file⟩`` as "stable"; i.e., exclude it from having