From 627f8e06c306711df784e877b683e40c22bb7571 Mon Sep 17 00:00:00 2001 From: Katsuhiko Nishimra Date: Sat, 27 Oct 2012 13:48:08 +0900 Subject: Generate Makefile with extconf.rb --- .gitignore | 1 + ext/openbabel/Makefile | 8 -------- ext/openbabel/extconf.rb | 12 ++++++++++++ openbabel.gemspec | 2 +- 4 files changed, 14 insertions(+), 9 deletions(-) delete mode 100644 ext/openbabel/Makefile diff --git a/.gitignore b/.gitignore index 4040c6c..9eb254e 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ *.gem .bundle Gemfile.lock +Makefile pkg/* 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 diff --git a/openbabel.gemspec b/openbabel.gemspec index dc74fa2..3441b95 100644 --- a/openbabel.gemspec +++ b/openbabel.gemspec @@ -12,6 +12,6 @@ Gem::Specification.new do |s| s.summary = %q{OpenBabel!} s.test_files = ["test/test_openbabel.rb"] - s.files = ["Rakefile", "lib/openbabel.rb", "ext/openbabel/Makefile"] + s.files = ["Rakefile", "lib/openbabel.rb"] s.extensions = ['ext/openbabel/extconf.rb'] end -- cgit v1.2.3