summaryrefslogtreecommitdiff
path: root/ext/fiddle
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-02-09 12:08:56 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-02-09 12:08:56 +0000
commit3c06d3a6bd2051fb2c321e04291951ae8df127bc (patch)
tree52bb3121bef8c689cf29bd89648610e2f0daed9f /ext/fiddle
parentf2e1c710fc3796b14bae35d8cd2b212f04c00c50 (diff)
fiddle: jobserver for libffi
* ext/fiddle/depend (libffi): use $(MAKE) explicitly for recursive make, so that jobserver works. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57583 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/fiddle')
-rw-r--r--ext/fiddle/depend19
-rw-r--r--ext/fiddle/extconf.rb7
2 files changed, 17 insertions, 9 deletions
diff --git a/ext/fiddle/depend b/ext/fiddle/depend
index 470e15e..7e00a6e 100644
--- a/ext/fiddle/depend
+++ b/ext/fiddle/depend
@@ -26,22 +26,29 @@ $(LIBFFI_DIR)/Makefile:
$(Q) $(CONFIGURE_LIBFFI)
build-libffi: $(LIBFFI_A)
-build-libffi $(LIBFFI_A):
- $(Q) $(SUBMAKE_LIBFFI)
+$(LIBFFI_A):
+ $(Q) $(SUBMAKE_PRE) $(MAKE) $(SUBMAKE_ARG)
+clean-none:
clean-libffi:
- $(Q) $(SUBMAKE_LIBFFI) clean
+libffi/clean: libffi/clean
+ $(Q) $(SUBMAKE_PRE) $(MAKE) $(SUBMAKE_ARG) clean
-distclean-libffi:
- $(Q) $(SUBMAKE_LIBFFI) distclean
+distclean-none:
+distclean-libffi: libffi/distclean
+libffi/distclean:
+ $(Q) $(SUBMAKE_PRE) $(MAKE) $(SUBMAKE_ARG) distclean
$(Q) $(RM) $(LIBFFI_DIR)/local.exp
$(Q) $(RUBY) -rfileutils -e "FileUtils.rmdir(Dir.glob(ARGV[0]+'/**/{,.*/}'), :parents=>true)" $(LIBFFI_DIR)
-realclean-libffi:
+realclean-none:
+realclean-libffi: libffi/realclean
+libffi/realclean:
$(Q) $(RMALL) $(LIBFFI_DIR)
.PHONY: clean-libffi distclean-libffi realclean-libffi
.PHONY: clean-none distclean-none realclean-none
+.PHONY: libffi/clean libffi/distclean libffi/realclean
clean: clean-$(LIBFFI_CLEAN)
distclean: distclean-$(LIBFFI_CLEAN)
diff --git a/ext/fiddle/extconf.rb b/ext/fiddle/extconf.rb
index 0359355..43d3053 100644
--- a/ext/fiddle/extconf.rb
+++ b/ext/fiddle/extconf.rb
@@ -149,9 +149,9 @@ create_makefile 'fiddle' do |conf|
if !libffi
next conf << "LIBFFI_CLEAN = none\n"
elsif $gnumake && !$nmake
- submake = "$(MAKE) -C $(LIBFFI_DIR)\n"
+ submake_arg = "-C $(@D)\n"
else
- submake = "cd $(LIBFFI_DIR) && \\\n\t\t" << "#{config_string("exec")} $(MAKE)".strip
+ submake_pre = "cd $(@D) && #{config_string("exec")}".strip
end
if $nmake
cmd = "$(RUBY) -C $(LIBFFI_DIR) #{libffi_config} --srcdir=$(LIBFFI_SRCDIR)"
@@ -170,7 +170,8 @@ create_makefile 'fiddle' do |conf|
LIBFFI_CFLAGS = #{libffi.cflags}
LIBFFI_LDFLAGS = #{libffi.ldflags}
FFI_H = $(LIBFFI_DIR)/include/ffi.h
- SUBMAKE_LIBFFI = #{submake}
+ SUBMAKE_PRE = #{submake_pre}
+ SUBMAKE_ARG = #{submake_arg}
LIBFFI_CLEAN = libffi
MK
end