summaryrefslogtreecommitdiff
path: root/ext/fiddle
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-12-23 11:33:54 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-12-23 11:33:54 +0000
commit276065f8700b3351613aef3a67649c3b6d9e2aa0 (patch)
treee148aa5a0778de4255e2f945fe1dfcc015ba56b6 /ext/fiddle
parent802d4f9fb2a8a5f2be1eb6be13dc4f286ad221af (diff)
fiddle: clean-libffi
* ext/fiddle/depend (clean-libffi): clean libffi directory. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48929 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/fiddle')
-rw-r--r--ext/fiddle/depend17
-rw-r--r--ext/fiddle/extconf.rb6
2 files changed, 21 insertions, 2 deletions
diff --git a/ext/fiddle/depend b/ext/fiddle/depend
index 89623db708..6b59b31804 100644
--- a/ext/fiddle/depend
+++ b/ext/fiddle/depend
@@ -25,4 +25,21 @@ build-libffi: $(LIBFFI_A)
build-libffi $(LIBFFI_A):
$(Q) $(SUBMAKE_LIBFFI)
+clean-libffi:
+ $(Q) $(SUBMAKE_LIBFFI) clean
+
+distclean-libffi:
+ $(Q) $(SUBMAKE_LIBFFI) distclean
+ $(Q) $(RM) $(LIBFFI_DIR)/local.exp
+ $(Q) $(RUBY) -rfileutils -e 'FileUtils.rmdir(Dir.glob(ARGV[0]+"/**/"), :parents=>true)' $(LIBFFI_DIR)
+
+realclean-libffi:
+ $(Q) $(RMDIRS) $(LIBFFI_DIR)
+
+clean-none distclean-none realclean-none:
+
+clean: clean-$(LIBFFI_CLEAN)
+distclean: distclean-$(LIBFFI_CLEAN)
+realclean: realclean-$(LIBFFI_CLEAN)
+
configure: configure-libffi
diff --git a/ext/fiddle/extconf.rb b/ext/fiddle/extconf.rb
index 6da557bc79..f5c27cc934 100644
--- a/ext/fiddle/extconf.rb
+++ b/ext/fiddle/extconf.rb
@@ -127,8 +127,9 @@ if libffi
$LOCAL_LIBS.prepend("#{libffi.a} ").strip!
end
create_makefile 'fiddle' do |conf|
- next conf unless libffi
- if $mswin
+ if !libffi
+ next conf << "LIBFFI_CLEAN = none\n"
+ elsif $mswin
submake = "make -C $(LIBFFI_DIR)\n"
elsif $gnumake
submake = "$(MAKE) -C $(LIBFFI_DIR)\n"
@@ -148,6 +149,7 @@ create_makefile 'fiddle' do |conf|
LIBFFI_LDFLAGS = #{libffi.ldflags}
FFI_H = $(LIBFFI_DIR)/include/ffi.h
SUBMAKE_LIBFFI = #{submake}
+ LIBFFI_CLEAN = libffi
MK
end