summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorKatsuhiko Nishimra <ktns.87@gmail.com>2012-10-27 13:48:08 +0900
committerKatsuhiko Nishimra <ktns.87@gmail.com>2012-10-27 13:58:02 +0900
commit627f8e06c306711df784e877b683e40c22bb7571 (patch)
treedbb14737019af6fb03ef95f3508e3949a9017e96 /ext
parent64c57957264dc096d0e1f6f6219ba93ea4cd2a0e (diff)
Generate Makefile with extconf.rb
Diffstat (limited to 'ext')
-rw-r--r--ext/openbabel/Makefile8
-rw-r--r--ext/openbabel/extconf.rb12
2 files changed, 12 insertions, 8 deletions
diff --git a/ext/openbabel/Makefile b/ext/openbabel/Makefile
deleted file mode 100644
index 581ad59..0000000
--- a/ext/openbabel/Makefile
+++ /dev/null
@@ -1,8 +0,0 @@
-.PHONY: openbabel.so
-openbabel.so:
- chmod 755 openbabel.so
-
-.PHONY: install
-install:
- mkdir -p ../../lib/openbabel
- mv openbabel.so ../../lib/openbabel
diff --git a/ext/openbabel/extconf.rb b/ext/openbabel/extconf.rb
index d6db793..e0dfbae 100644
--- a/ext/openbabel/extconf.rb
+++ b/ext/openbabel/extconf.rb
@@ -38,6 +38,18 @@ begin
puts `make`
end
FileUtils.cp(ob_bindings_dir+"/openbabel.#{RbConfig::CONFIG["DLEXT"]}", "./")
+ File.open('Makefile', 'w') do |makefile|
+ makefile.write <<"EOF"
+.PHONY: openbabel.#{RbConfig::CONFIG["DLEXT"]}
+openbabel.#{RbConfig::CONFIG["DLEXT"]}:
+ chmod 755 openbabel.#{RbConfig::CONFIG["DLEXT"]}
+
+.PHONY: install
+install:
+ mkdir -p ../../lib/openbabel
+ mv openbabel.#{RbConfig::CONFIG["DLEXT"]} ../../lib/openbabel
+EOF
+ end
ensure
FileUtils.remove_entry_secure main_dir
end