include rules/all-target.mk
include rules/clean-target.mk
+# Helper macro
+include rules/mkdep.mk
+
# -----------------------------------------------------------------------------
# The inplace tree
-shared -dynamic -dynload deploy \
-no-auto-link-packages $$(addprefix -package,$$($1_$2_DEPS)) \
-o $$@
+
+# This is a kludge. The .dyn_hi files currently depend on the .dyn_hi
+# files of modules that they import. But they actually want the .hi
+# files of modules from another package.This we make the .dyn_hi files
+# depend on the .hi files so we are sure that they exist and are
+# up-to-date.
+$$(foreach m,$$(addprefix $1/$2/build/,$$($1_$2_SLASH_MODS)),\
+$$(eval $$(call mkdep,$$m.$$($3_hisuf),$$m.hi)) \
+)
+
else
# Build the ordinary .a library
ifeq "$$($1_$2_SplitObjs)" "YES"
--- /dev/null
+# -----------------------------------------------------------------------------
+#
+# (c) 2009 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 mkdep # args: $1 = target, $2 = deps
+$1 : $2
+endef