-# 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
+libffi/dist-install/build/ffitarget.h: $(libffi_STAMP_CONFIGURE) | $$(dir $$@)/.
+ "$(CP)" libffi/build/include/ffitarget.h $@
+
+$(libffi_STAMP_BUILD): $(libffi_STAMP_CONFIGURE) | libffi/dist-install/build/.
+ $(MAKE) -C libffi/build MAKEFLAGS=
+ cd libffi/build && ./libtool --mode=install cp libffi.la $(TOP)/libffi/dist-install/build
+
+ # We actually want both static and dllized libraries, because we build
+ # the runtime system both ways. libffi_convenience.a is the static version.