diff options
author | Duncan Coutts <duncan@well-typed.com> | 2009-04-30 13:56:37 +0000 |
---|---|---|
committer | Duncan Coutts <duncan@well-typed.com> | 2009-04-30 13:56:37 +0000 |
commit | b547f2e28b0f07b089aada1164c1dd834f894996 (patch) | |
tree | d06f61a1ec5270ccd8dd2c1eb121aaf7f65d8adb | |
parent | 31796c5c0312aa9a04f3519fa32b0f15b9a14541 (diff) | |
download | haskell-b547f2e28b0f07b089aada1164c1dd834f894996.tar.gz |
Fix parallel make for libffi.
I didn't realise make can invoke the same action multiple
times in parallel if the rule has multiple targets. So go
back to using a build stamp file.
-rw-r--r-- | libffi/ghc.mk | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/libffi/ghc.mk b/libffi/ghc.mk index 932e757546..ca6ee5e126 100644 --- a/libffi/ghc.mk +++ b/libffi/ghc.mk @@ -58,8 +58,10 @@ PLATFORM := $(shell echo $(HOSTPLATFORM) | sed 's/i[567]86/i486/g') ifeq "$(BuildSharedLibs)" "YES" libffi_STAMP_CONFIGURE = libffi/stamp.ffi.configure-shared +libffi_STAMP_BUILD = libffi/stamp.ffi.build-shared else libffi_STAMP_CONFIGURE = libffi/stamp.ffi.configure +libffi_STAMP_BUILD = libffi/stamp.ffi.build endif BINDIST_STAMPS = libffi/stamp.ffi.build libfii/stamp.ffi.configure @@ -139,20 +141,12 @@ $(libffi_STAMP_CONFIGURE): libffi/ffi.h: $(libffi_STAMP_CONFIGURE) $(CP) libffi/build/include/ffi.h $@ -# All the libs that libffi's own build will generate -libffi_ALL_LIBS = $(libffi_STATIC_LIB) -ifeq "$(BuildSharedLibs)" "YES" -libffi_ALL_LIBS += $(libffi_DYNAMIC_LIBS) -endif -ifeq "$(Windows)" "YES" -libffi_ALL_LIBS += libffi/libffi.dll.a $(libffi_HS_DYN_LIB).a -endif - -$(libffi_ALL_LIBS): $(libffi_STAMP_CONFIGURE) +$(libffi_STAMP_BUILD): $(libffi_STAMP_CONFIGURE) cd libffi && \ $(MAKE) -C build MAKEFLAGS=; \ (cd build; ./libtool --mode=install cp libffi.la $(TOP)/libffi) +$(libffi_STATIC_LIB): $(libffi_STAMP_BUILD) # Rename libffi.a to libHSffi.a libffi/libHSffi.a libffi/libHSffi_p.a: $(libffi_STATIC_LIB) $(CP) $(libffi_STATIC_LIB) libffi/libHSffi.a @@ -174,6 +168,7 @@ $(eval $(call all-target,libffi,libffi/HSffi.o)) ifeq "$(BuildSharedLibs)" "YES" ifeq "$(Windows)" "YES" +libffi/libffi.dll.a $(libffi_HS_DYN_LIB): $(libffi_STAMP_BUILD) # Windows libtool creates <soname>.dll, and as we already patched that # there is no need to copy from libffi.dll to libHSffi...dll. # However, the renaming is still required for the import library @@ -184,6 +179,7 @@ $(libffi_HS_DYN_LIB).a: libffi/libffi.dll.a $(eval $(call all-target,libffi,$(libffi_HS_DYN_LIB).a)) else +$(libffi_DYNAMIC_LIBS): $(libffi_STAMP_BUILD) # Rename libffi.so to libHSffi...so $(libffi_HS_DYN_LIB): $(libffi_DYNAMIC_LIBS) $(CP) $(word 1,$(libffi_DYNAMIC_LIBS)) $(libffi_HS_DYN_LIB) |