diff options
author | Duncan Coutts <duncan@well-typed.com> | 2009-04-30 12:37:53 +0000 |
---|---|---|
committer | Duncan Coutts <duncan@well-typed.com> | 2009-04-30 12:37:53 +0000 |
commit | 31796c5c0312aa9a04f3519fa32b0f15b9a14541 (patch) | |
tree | ab8b2344be7f616827f8b00d6c776508639a9d98 | |
parent | 89d9257e7690fc51088858bf6f7e3fb6e8946ecc (diff) | |
download | haskell-31796c5c0312aa9a04f3519fa32b0f15b9a14541.tar.gz |
Fix linking shared libs with parallel make
Unlike with static libs, when linking shared libs the dependencies
have to already exist. Add a dependency $1_$2_$3_LIBS : $1_$2_$3_DEPS_LIBS
-rw-r--r-- | rules/build-package-way.mk | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/rules/build-package-way.mk b/rules/build-package-way.mk index 41496db915..06e432a7c5 100644 --- a/rules/build-package-way.mk +++ b/rules/build-package-way.mk @@ -20,7 +20,14 @@ $$(foreach dir,$$($1_$2_HS_SRC_DIRS),\ $(call hs-objs,$1,$2,$3) +# The .a/.so library file, indexed by two different sets of vars: +# the first is indexed by the dir, distdir and way +# the second is indexed by the package id, distdir and way $1_$2_$3_LIB = $1/$2/build/libHS$$($1_PACKAGE)-$$($1_$2_VERSION)$$($3_libsuf) +$$($1_PACKAGE)-$($1_$2_VERSION)_$2_$3_LIB = $$($1_$2_$3_LIB) + +# All the .a/.so library file dependencies for this library +$1_$2_$3_DEPS_LIBS=$$(foreach dep,$$($1_$2_DEPS),$$($$(dep)_$2_$3_LIB)) $1_$2_$3_MKSTUBOBJS = find $1/$2/build -name "*_stub.$$($3_osuf)" -print # HACK ^^^ we tried to use $(wildcard), but apparently it fails due to @@ -28,7 +35,7 @@ $1_$2_$3_MKSTUBOBJS = find $1/$2/build -name "*_stub.$$($3_osuf)" -print ifeq "$3" "dyn" # Link a dynamic library -$$($1_$2_$3_LIB) : $$($1_$2_$3_HS_OBJS) $$($1_$2_dyn_C_OBJS) $$($1_$2_dyn_S_OBJS) $$(ALL_RTS_LIBS) +$$($1_$2_$3_LIB) : $$($1_$2_$3_HS_OBJS) $$($1_$2_dyn_C_OBJS) $$($1_$2_dyn_S_OBJS) $$(ALL_RTS_LIBS) $$($1_$2_$3_DEPS_LIBS) $$(RM) $$@ $$($1_$2_HC) $$($1_$2_dyn_C_OBJS) $$($1_$2_dyn_S_OBJS) $$($1_$2_$3_HS_OBJS) \ `$$($1_$2_$3_MKSTUBOBJS)` \ |