Commit 40e43fa2 authored by ian@well-typed.com's avatar ian@well-typed.com Committed by Ian Lynagh

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
parent 6a46b462
......@@ -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
......
# -----------------------------------------------------------------------------
#
# (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
......@@ -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
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment