summaryrefslogtreecommitdiff
path: root/rules/build-prog.mk
diff options
context:
space:
mode:
authorIan Lynagh <igloo@earth.li>2011-01-16 15:56:27 +0000
committerIan Lynagh <igloo@earth.li>2011-01-16 15:56:27 +0000
commit5bde27949bdda22c9d5dac254a3c783eb0f6839f (patch)
tree74165459347e6e9fd11335b26072eb39b196e876 /rules/build-prog.mk
parent2a1db1613dfa6b7cb982daa98987aee2c4eb12b1 (diff)
downloadhaskell-5bde27949bdda22c9d5dac254a3c783eb0f6839f.tar.gz
Handle dependencies of programs on libraries correctly
Diffstat (limited to 'rules/build-prog.mk')
-rw-r--r--rules/build-prog.mk8
1 files changed, 8 insertions, 0 deletions
diff --git a/rules/build-prog.mk b/rules/build-prog.mk
index e303a44f1c..99b24de5cd 100644
--- a/rules/build-prog.mk
+++ b/rules/build-prog.mk
@@ -192,6 +192,14 @@ ifeq "$$($1_$2_v_HS_OBJS)" ""
$1_$2_GHC_LD_OPTS = -no-auto-link-packages -no-hs-main
endif
+# The quadrupled $'s here are because the _v_LIB variables aren't
+# necessarily set when this part of the makefile is read
+ifeq "$3" "0"
+$1/$2/build/tmp/$$($1_$2_PROG) : $$(foreach dep,$$($1_$2_DEP_NAMES),$$$$(libraries/$$(dep)_dist-boot_v_LIB))
+else
+$1/$2/build/tmp/$$($1_$2_PROG) : $$(foreach dep,$$($1_$2_DEP_NAMES),$$$$(libraries/$$(dep)_dist-install_v_LIB))
+endif
+
ifeq "$$($1_$2_LINK_WITH_GCC)" "NO"
$1/$2/build/tmp/$$($1_$2_PROG) : $$($1_$2_v_HS_OBJS) $$($1_$2_v_C_OBJS) $$($1_$2_v_S_OBJS) $$($1_$2_OTHER_OBJS) | $$$$(dir $$$$@)/.
"$$($1_$2_HC)" -o $$@ $$($1_$2_v_ALL_HC_OPTS) $$(LD_OPTS) $$($1_$2_GHC_LD_OPTS) $$($1_$2_v_HS_OBJS) $$($1_$2_v_C_OBJS) $$($1_$2_v_S_OBJS) $$($1_$2_OTHER_OBJS) $$(addprefix -l,$$($1_$2_EXTRA_LIBRARIES))