diff options
author | Ian Lynagh <ian@well-typed.com> | 2013-02-05 17:38:43 +0000 |
---|---|---|
committer | Ian Lynagh <igloo@earth.li> | 2013-02-05 18:05:11 +0000 |
commit | 40e43fa2ae8cac652a4e8aba1313535a80448cb9 (patch) | |
tree | 5256dd0dca1f86a2edbc2a6cd1f9cde934250a9a | |
parent | 6a46b4627d4f3f81d65bf6b5b5c0bcf86607c463 (diff) | |
download | haskell-40e43fa2ae8cac652a4e8aba1313535a80448cb9.tar.gz |
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
-rw-r--r-- | ghc.mk | 1 | ||||
-rw-r--r-- | rules/add-dependency.mk | 15 | ||||
-rw-r--r-- | rules/build-prog.mk | 8 |
3 files changed, 24 insertions, 0 deletions
@@ -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/rules/add-dependency.mk b/rules/add-dependency.mk new file mode 100644 index 0000000000..d1d8562e78 --- /dev/null +++ b/rules/add-dependency.mk @@ -0,0 +1,15 @@ +# ----------------------------------------------------------------------------- +# +# (c) 2010 The University of Glasgow +# +# This file is part of the GHC build system. +# +# To understand how the build system works and how to modify it, see +# http://hackage.haskell.org/trac/ghc/wiki/Building/Architecture +# http://hackage.haskell.org/trac/ghc/wiki/Building/Modifying +# +# ----------------------------------------------------------------------------- + +define add-dependency +$1: $2 +endef diff --git a/rules/build-prog.mk b/rules/build-prog.mk index 4111e172b9..0419c3b4ab 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 |