[commit: ghc] master: Add a dependency of program modules on GHC.TopHandler (40e43fa)

Ian Lynagh igloo at earth.li
Tue Feb 5 19:48:10 CET 2013


Repository : ssh://darcs.haskell.org//srv/darcs/ghc

On branch  : master

http://hackage.haskell.org/trac/ghc/changeset/40e43fa2ae8cac652a4e8aba1313535a80448cb9

>---------------------------------------------------------------

commit 40e43fa2ae8cac652a4e8aba1313535a80448cb9
Author: Ian Lynagh <ian at well-typed.com>
Date:   Tue Feb 5 17:38:43 2013 +0000

    Add a dependency of program modules on GHC.TopHandler
    
    If you were unlucky, the build could fail, e.g.:
    
    utils\mkUserGuidePart\Main.hs:1:1:
        Failed to load interface for `GHC.TopHandler'
        There are files missing in the `base' package,
        try running 'ghc-pkg check'.
        Use -v to see a list of the files searched for.
    utils/mkUserGuidePart/ghc.mk:18: recipe for target `utils/mkUserGuidePart/dist/build/Main.o' failed

>---------------------------------------------------------------

 ghc.mk                                  |    1 +
 ghc/Makefile => rules/add-dependency.mk |    9 ++++-----
 rules/build-prog.mk                     |    8 ++++++++
 3 files changed, 13 insertions(+), 5 deletions(-)

diff --git a/ghc.mk b/ghc.mk
index 8957e60..8bd7859 100644
--- a/ghc.mk
+++ b/ghc.mk
@@ -155,6 +155,7 @@ endif
 include rules/prof.mk
 include rules/trace.mk
 include rules/library-path.mk
+include rules/add-dependency.mk
 include rules/make-command.mk
 include rules/pretty_commands.mk
 
diff --git a/ghc/Makefile b/rules/add-dependency.mk
similarity index 84%
copy from ghc/Makefile
copy to rules/add-dependency.mk
index 62207dc..d1d8562 100644
--- a/ghc/Makefile
+++ b/rules/add-dependency.mk
@@ -1,6 +1,6 @@
 # -----------------------------------------------------------------------------
 #
-# (c) 2009 The University of Glasgow
+# (c) 2010 The University of Glasgow
 #
 # This file is part of the GHC build system.
 #
@@ -10,7 +10,6 @@
 #
 # -----------------------------------------------------------------------------
 
-dir = ghc
-
-include ../mk/compiler-ghc.mk
-
+define add-dependency
+$1: $2
+endef
diff --git a/rules/build-prog.mk b/rules/build-prog.mk
index 4111e17..0419c3b 100644
--- a/rules/build-prog.mk
+++ b/rules/build-prog.mk
@@ -246,4 +246,12 @@ endif
 
 $(call dependencies,$1,$2,$3)
 
+# The Main module of a program implicitly depends on GHC.TopHandler
+# so we need to add a dependency for that. As we don't know which
+# module contains Main, we just make all modules in the program
+# depend on it.
+ifneq "$3" "0"
+$$(foreach o,$$($1_$2_$$($1_$2_PROGRAM_WAY)_HS_OBJS),$$(eval $$(call add-dependency,$$o,libraries/base/dist-install/build/GHC/TopHandler.$$($$($1_$2_PROGRAM_WAY)_osuf))))
+endif
+
 endef





More information about the ghc-commits mailing list