statistics3 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 13c888080da65999ee8896d8b77e4e37a06bbe50
4
+ data.tar.gz: 9ada072125884704f2b54a77ef1c3f496c6ae1dc
5
+ SHA512:
6
+ metadata.gz: 6b640d392af51bbfcf9f2ef35cb10491f42728e6e0a86c074730e72986508e69ab0ca27a5c7d1b0060d439090ee86012d51dbee1720f6f39b2aca169f643636d
7
+ data.tar.gz: a8621ad27a09b1e0ebee27c186fd4286410d615a5d9a42c67b3f234d06d1943a3beb257c92b96aa7c848dc9ffc2bba59505f5b86f26d931e47f983eba6b980f3
data/.document ADDED
@@ -0,0 +1,5 @@
1
+ lib/**/*.rb
2
+ bin/*
3
+ -
4
+ features/**/*.feature
5
+ LICENSE.txt
data/.rspec ADDED
@@ -0,0 +1,2 @@
1
+ --color
2
+ --require spec_helper
data/.ruby-version ADDED
@@ -0,0 +1 @@
1
+ 2.3.1
data/.semver ADDED
@@ -0,0 +1,5 @@
1
+ ---
2
+ :major: 0
3
+ :minor: 0
4
+ :patch: 1
5
+ :special: ''
data/.travis.yml ADDED
@@ -0,0 +1,9 @@
1
+ language: ruby
2
+ rvm:
3
+ - 2.0.0
4
+ - 2.2.0
5
+ - 2.2.1
6
+ - 2.3.0
7
+ - 2.3.1
8
+ notifications:
9
+ irc: "irc.freenode.org#elastic-backup-2s3"
data/Gemfile ADDED
@@ -0,0 +1,22 @@
1
+ source "https://rubygems.org"
2
+
3
+ gem "semver", "~> 1"
4
+ gem "awesome_print", "~> 1"
5
+ gem "colorize", "~> 0"
6
+ gem "psych", "~> 2"
7
+
8
+ group :development do
9
+ gem "rspec", "~> 3.5.0"
10
+ gem "test-unit"
11
+ gem "yard", "~> 0.7"
12
+ gem "rdoc", "~> 3.12"
13
+ gem "bundler", "~> 1.0"
14
+ gem "juwelier", "~> 2.1.0"
15
+ gem "simplecov", ">= 0"
16
+ gem 'pry', '~> 0'
17
+ gem 'pry-byebug', '~> 3'
18
+ gem 'pry-doc', '~> 0'
19
+ gem 'pry-remote', '~> 0'
20
+ gem 'pry-rescue', '~> 1'
21
+ gem 'pry-stack_explorer', '~> 0'
22
+ end
data/Gemfile.lock ADDED
@@ -0,0 +1,127 @@
1
+ GEM
2
+ remote: https://rubygems.org/
3
+ specs:
4
+ addressable (2.4.0)
5
+ awesome_print (1.7.0)
6
+ binding_of_caller (0.7.2)
7
+ debug_inspector (>= 0.0.1)
8
+ builder (3.2.2)
9
+ byebug (9.0.6)
10
+ coderay (1.1.1)
11
+ colorize (0.8.1)
12
+ debug_inspector (0.0.2)
13
+ descendants_tracker (0.0.4)
14
+ thread_safe (~> 0.3, >= 0.3.1)
15
+ diff-lcs (1.2.5)
16
+ docile (1.1.5)
17
+ faraday (0.9.2)
18
+ multipart-post (>= 1.2, < 3)
19
+ git (1.3.0)
20
+ github_api (0.14.5)
21
+ addressable (~> 2.4.0)
22
+ descendants_tracker (~> 0.0.4)
23
+ faraday (~> 0.8, < 0.10)
24
+ hashie (>= 3.4)
25
+ oauth2 (~> 1.0)
26
+ hashie (3.4.6)
27
+ highline (1.7.8)
28
+ interception (0.5)
29
+ json (1.8.3)
30
+ juwelier (2.1.3)
31
+ builder
32
+ bundler (>= 1.13)
33
+ git (>= 1.2.5)
34
+ github_api
35
+ highline (>= 1.6.15)
36
+ nokogiri (>= 1.5.10)
37
+ rake
38
+ rdoc
39
+ semver
40
+ jwt (1.5.6)
41
+ method_source (0.8.2)
42
+ mini_portile2 (2.1.0)
43
+ multi_json (1.12.1)
44
+ multi_xml (0.6.0)
45
+ multipart-post (2.0.0)
46
+ nokogiri (1.6.8.1)
47
+ mini_portile2 (~> 2.1.0)
48
+ oauth2 (1.2.0)
49
+ faraday (>= 0.8, < 0.10)
50
+ jwt (~> 1.0)
51
+ multi_json (~> 1.3)
52
+ multi_xml (~> 0.5)
53
+ rack (>= 1.2, < 3)
54
+ power_assert (0.4.1)
55
+ pry (0.10.4)
56
+ coderay (~> 1.1.0)
57
+ method_source (~> 0.8.1)
58
+ slop (~> 3.4)
59
+ pry-byebug (3.4.2)
60
+ byebug (~> 9.0)
61
+ pry (~> 0.10)
62
+ pry-doc (0.9.0)
63
+ pry (~> 0.9)
64
+ yard (~> 0.8)
65
+ pry-remote (0.1.8)
66
+ pry (~> 0.9)
67
+ slop (~> 3.0)
68
+ pry-rescue (1.4.4)
69
+ interception (>= 0.5)
70
+ pry
71
+ pry-stack_explorer (0.4.9.2)
72
+ binding_of_caller (>= 0.7)
73
+ pry (>= 0.9.11)
74
+ psych (2.2.1)
75
+ rack (2.0.1)
76
+ rake (12.0.0)
77
+ rdoc (3.12.2)
78
+ json (~> 1.4)
79
+ rspec (3.5.0)
80
+ rspec-core (~> 3.5.0)
81
+ rspec-expectations (~> 3.5.0)
82
+ rspec-mocks (~> 3.5.0)
83
+ rspec-core (3.5.4)
84
+ rspec-support (~> 3.5.0)
85
+ rspec-expectations (3.5.0)
86
+ diff-lcs (>= 1.2.0, < 2.0)
87
+ rspec-support (~> 3.5.0)
88
+ rspec-mocks (3.5.0)
89
+ diff-lcs (>= 1.2.0, < 2.0)
90
+ rspec-support (~> 3.5.0)
91
+ rspec-support (3.5.0)
92
+ semver (1.0.1)
93
+ simplecov (0.12.0)
94
+ docile (~> 1.1.0)
95
+ json (>= 1.8, < 3)
96
+ simplecov-html (~> 0.10.0)
97
+ simplecov-html (0.10.0)
98
+ slop (3.6.0)
99
+ test-unit (3.2.3)
100
+ power_assert
101
+ thread_safe (0.3.5)
102
+ yard (0.9.5)
103
+
104
+ PLATFORMS
105
+ ruby
106
+
107
+ DEPENDENCIES
108
+ awesome_print (~> 1)
109
+ bundler (~> 1.0)
110
+ colorize (~> 0)
111
+ juwelier (~> 2.1.0)
112
+ pry (~> 0)
113
+ pry-byebug (~> 3)
114
+ pry-doc (~> 0)
115
+ pry-remote (~> 0)
116
+ pry-rescue (~> 1)
117
+ pry-stack_explorer (~> 0)
118
+ psych (~> 2)
119
+ rdoc (~> 3.12)
120
+ rspec (~> 3.5.0)
121
+ semver (~> 1)
122
+ simplecov
123
+ test-unit
124
+ yard (~> 0.7)
125
+
126
+ BUNDLED WITH
127
+ 1.13.6
data/History.rdoc ADDED
@@ -0,0 +1,12 @@
1
+ = 0.53(2008.07.14)
2
+
3
+ * fix pt for p < 0.5.
4
+
5
+ = 0.52(2008.02.24)
6
+
7
+ * fix p_nor for z < 0.0.
8
+
9
+ = 0.51(2007.06.17)
10
+ * fix p_nor.
11
+ * simplify chi2 n = 1 or 2.
12
+
data/LICENSE.txt ADDED
@@ -0,0 +1,20 @@
1
+ Copyright (c) 2016 Fred Mitchell
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.org ADDED
@@ -0,0 +1,38 @@
1
+ * Statistics3 -- Statistical Distributions for Ruby
2
+ I forked Shin-ichiro's statistics2 (sinara@blade.nagaokaut.ac.jp), work, because
3
+ it is in serious need of modernization for the latest Ruby, and I am
4
+ currently depending on this library for my RubyNEAT work.
5
+
6
+ For more information (although these links may be out-of-date):
7
+ . http://www.matsusaka-u.ac.jp/~okumura/algo/
8
+ . http://www5.airnet.ne.jp/tomy/cpro/sslib11.htm
9
+
10
+ ** REQUIREMENTS
11
+ Ruby 2.2.2 or higher
12
+
13
+ ** Installation
14
+ #+begin_src bash
15
+ gem install statistics3
16
+ #+end-src
17
+
18
+ ** Documentation
19
+ Note that I've just modernized this fork, and will attempt
20
+ to add more documentation as time permits.
21
+
22
+ ** Usage
23
+ *** Example:
24
+ #+begin_src ruby
25
+ require "statistics3"
26
+ puts Statistics3.normaldist(0.27) #=> 0.60641987319804
27
+ #+end_src
28
+
29
+ ** If you don't want to use the C extension:
30
+ #+begin_src ruby
31
+ require "statistics3/no_ext"
32
+ puts Statistics3.normaldist(0.27) #=> 0.606419873198039 (delta of 9.99200722162641e-16)
33
+ #+end_src
34
+
35
+ ** LICENSE:
36
+ MIT
37
+
38
+
data/Rakefile ADDED
@@ -0,0 +1,73 @@
1
+
2
+ require 'rubygems'
3
+ require 'bundler'
4
+ require 'semver'
5
+
6
+ def s_version
7
+ SemVer.find.format "%M.%m.%p%s"
8
+ end
9
+
10
+ begin
11
+ Bundler.setup(:default, :development)
12
+ rescue Bundler::BundlerError => e
13
+ $stderr.puts e.message
14
+ $stderr.puts "Run `bundle install` to install missing gems"
15
+ exit e.status_code
16
+ end
17
+ require 'rake'
18
+
19
+ require 'juwelier'
20
+
21
+ desc 'build the C extension'
22
+ task :extension do
23
+ Dir.chdir File.expand_path('../ext', __FILE__) do
24
+ system "ruby extconf.rb"
25
+ system "make"
26
+ end
27
+ end
28
+
29
+ Juwelier::Tasks.new do |gem|
30
+ # gem is a Gem::Specification... see http://guides.rubygems.org/specification-reference/ for more options
31
+ gem.name = "statistics3"
32
+ gem.homepage = "http://github.com/flajann2/statistics3"
33
+ gem.license = "MIT"
34
+ gem.version = s_version
35
+ gem.summary = %Q{Statistics3 library}
36
+ gem.description = %Q{
37
+ Statistics3 is a module that provides normal,
38
+ Chi-square, t- and F- probability distributions
39
+ for Ruby. It is a fork/continuation of Shin-ichiro Hara's original code.
40
+ It provides a native, compiled extension and a pure Ruby implementation.
41
+ }
42
+
43
+ gem.email = "fred.mitchell@gmx.de"
44
+ gem.authors = ["Fred Mitchell"]
45
+ gem.required_ruby_version = '>= 2.2.2'
46
+
47
+ # dependencies defined in Gemfile
48
+ end
49
+ Juwelier::RubygemsDotOrgTasks.new
50
+
51
+ require 'rspec/core'
52
+ require 'rspec/core/rake_task'
53
+ RSpec::Core::RakeTask.new(:spec) do |spec|
54
+ spec.pattern = FileList['spec/**/*_spec.rb']
55
+ end
56
+
57
+ desc "Code coverage detail"
58
+ task :simplecov do
59
+ ENV['COVERAGE'] = "true"
60
+ Rake::Task['spec'].execute
61
+ end
62
+
63
+ desc 'run basic tests'
64
+ task :test => :extension do
65
+ Dir.chdir File.expand_path('..', __FILE__) do
66
+ system "ruby -w -I lib -I ext -r test/unit -e 'Test::Unit::AutoRunner.run' test"
67
+ end
68
+ end
69
+
70
+ task :default => :test
71
+
72
+ require 'yard'
73
+ YARD::Rake::YardocTask.new
@@ -0,0 +1,18 @@
1
+ #!/usr/bin/env ruby
2
+ cmd = "ruby #{File.expand_path(File.join(File.dirname(__FILE__), '/../test/sample_tbl.rb'))}"
3
+ param_tbl = {
4
+ "norm" => "tbl-normal.tbl",
5
+ "chi2" => "tbl-chi2.tbl",
6
+ "t" => "tbl-t.tbl",
7
+ "f 0.05" => "tbl-F50.tbl",
8
+ "f 0.025" => "tbl-F25.tbl",
9
+ "f 0.01" => "tbl-F10.tbl"
10
+ }
11
+
12
+ printf 'Generating tables'
13
+ param_tbl.each do |pa, tbl|
14
+ printf '.'
15
+ STDOUT.flush()
16
+ `#{cmd} #{pa} > #{File.expand_path(File.join(File.dirname(__FILE__), tbl))}`
17
+ end
18
+ puts "finished."
data/examples/show.rb ADDED
@@ -0,0 +1,12 @@
1
+ #!/usr/bin/env ruby
2
+ $:.unshift File.join(File.dirname(__FILE__), '..', 'lib')
3
+ require "statistics3"
4
+ if $0 == __FILE__
5
+ if ARGV.empty?
6
+ puts "Example:"
7
+ puts " #$0 normaldist 0.01"
8
+ puts " #$0 pf_x 2 3 0.01"
9
+ exit
10
+ end
11
+ p Statistics3.send(ARGV[0], *ARGV[1..-1].map{|x| eval(x)})
12
+ end
data/ext/Makefile ADDED
@@ -0,0 +1,260 @@
1
+
2
+ SHELL = /bin/sh
3
+
4
+ # V=0 quiet, V=1 verbose. other values don't work.
5
+ V = 0
6
+ Q1 = $(V:1=)
7
+ Q = $(Q1:0=@)
8
+ ECHO1 = $(V:1=@:)
9
+ ECHO = $(ECHO1:0=@echo)
10
+ NULLCMD = :
11
+
12
+ #### Start of system configuration section. ####
13
+
14
+ srcdir = .
15
+ topdir = /home/alveric/.rbenv/versions/2.3.1/include/ruby-2.3.0
16
+ hdrdir = $(topdir)
17
+ arch_hdrdir = /home/alveric/.rbenv/versions/2.3.1/include/ruby-2.3.0/x86_64-linux
18
+ PATH_SEPARATOR = :
19
+ VPATH = $(srcdir):$(arch_hdrdir)/ruby:$(hdrdir)/ruby
20
+ prefix = $(DESTDIR)/home/alveric/.rbenv/versions/2.3.1
21
+ rubysitearchprefix = $(rubylibprefix)/$(sitearch)
22
+ rubyarchprefix = $(rubylibprefix)/$(arch)
23
+ rubylibprefix = $(libdir)/$(RUBY_BASE_NAME)
24
+ exec_prefix = $(prefix)
25
+ vendorarchhdrdir = $(vendorhdrdir)/$(sitearch)
26
+ sitearchhdrdir = $(sitehdrdir)/$(sitearch)
27
+ rubyarchhdrdir = $(rubyhdrdir)/$(arch)
28
+ vendorhdrdir = $(rubyhdrdir)/vendor_ruby
29
+ sitehdrdir = $(rubyhdrdir)/site_ruby
30
+ rubyhdrdir = $(includedir)/$(RUBY_VERSION_NAME)
31
+ vendorarchdir = $(vendorlibdir)/$(sitearch)
32
+ vendorlibdir = $(vendordir)/$(ruby_version)
33
+ vendordir = $(rubylibprefix)/vendor_ruby
34
+ sitearchdir = $(sitelibdir)/$(sitearch)
35
+ sitelibdir = $(sitedir)/$(ruby_version)
36
+ sitedir = $(rubylibprefix)/site_ruby
37
+ rubyarchdir = $(rubylibdir)/$(arch)
38
+ rubylibdir = $(rubylibprefix)/$(ruby_version)
39
+ sitearchincludedir = $(includedir)/$(sitearch)
40
+ archincludedir = $(includedir)/$(arch)
41
+ sitearchlibdir = $(libdir)/$(sitearch)
42
+ archlibdir = $(libdir)/$(arch)
43
+ ridir = $(datarootdir)/$(RI_BASE_NAME)
44
+ mandir = $(datarootdir)/man
45
+ localedir = $(datarootdir)/locale
46
+ libdir = $(exec_prefix)/lib
47
+ psdir = $(docdir)
48
+ pdfdir = $(docdir)
49
+ dvidir = $(docdir)
50
+ htmldir = $(docdir)
51
+ infodir = $(datarootdir)/info
52
+ docdir = $(datarootdir)/doc/$(PACKAGE)
53
+ oldincludedir = $(DESTDIR)/usr/include
54
+ includedir = $(prefix)/include
55
+ localstatedir = $(prefix)/var
56
+ sharedstatedir = $(prefix)/com
57
+ sysconfdir = $(prefix)/etc
58
+ datadir = $(datarootdir)
59
+ datarootdir = $(prefix)/share
60
+ libexecdir = $(exec_prefix)/libexec
61
+ sbindir = $(exec_prefix)/sbin
62
+ bindir = $(exec_prefix)/bin
63
+ archdir = $(rubyarchdir)
64
+
65
+
66
+ CC = gcc
67
+ CXX = g++
68
+ LIBRUBY = $(LIBRUBY_SO)
69
+ LIBRUBY_A = lib$(RUBY_SO_NAME)-static.a
70
+ LIBRUBYARG_SHARED = -Wl,-R$(libdir) -L$(libdir) -l$(RUBY_SO_NAME)
71
+ LIBRUBYARG_STATIC = -Wl,-R$(libdir) -L$(libdir) -l$(RUBY_SO_NAME)-static
72
+ empty =
73
+ OUTFLAG = -o $(empty)
74
+ COUTFLAG = -o $(empty)
75
+
76
+ RUBY_EXTCONF_H =
77
+ cflags = $(optflags) $(debugflags) $(warnflags)
78
+ cxxflags = $(optflags) $(debugflags) $(warnflags)
79
+ optflags = -O3 -fno-fast-math
80
+ debugflags = -ggdb3
81
+ warnflags = -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wunused-variable -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wimplicit-function-declaration -Wdeprecated-declarations -Wno-packed-bitfield-compat
82
+ CCDLFLAGS = -fPIC
83
+ CFLAGS = $(CCDLFLAGS) $(cflags) -fPIC $(ARCH_FLAG)
84
+ INCFLAGS = -I. -I$(arch_hdrdir) -I$(hdrdir)/ruby/backward -I$(hdrdir) -I$(srcdir)
85
+ DEFS =
86
+ CPPFLAGS = -I/home/alveric/.rbenv/versions/2.3.1/include $(DEFS) $(cppflags)
87
+ CXXFLAGS = $(CCDLFLAGS) $(cxxflags) $(ARCH_FLAG)
88
+ ldflags = -L. -L/home/alveric/.rbenv/versions/2.3.1/lib -fstack-protector -rdynamic -Wl,-export-dynamic
89
+ dldflags =
90
+ ARCH_FLAG =
91
+ DLDFLAGS = $(ldflags) $(dldflags) $(ARCH_FLAG)
92
+ LDSHARED = $(CC) -shared
93
+ LDSHAREDXX = $(CXX) -shared
94
+ AR = ar
95
+ EXEEXT =
96
+
97
+ RUBY_INSTALL_NAME = $(RUBY_BASE_NAME)
98
+ RUBY_SO_NAME = ruby
99
+ RUBYW_INSTALL_NAME =
100
+ RUBY_VERSION_NAME = $(RUBY_BASE_NAME)-$(ruby_version)
101
+ RUBYW_BASE_NAME = rubyw
102
+ RUBY_BASE_NAME = ruby
103
+
104
+ arch = x86_64-linux
105
+ sitearch = $(arch)
106
+ ruby_version = 2.3.0
107
+ ruby = $(bindir)/$(RUBY_BASE_NAME)
108
+ RUBY = $(ruby)
109
+ ruby_headers = $(hdrdir)/ruby.h $(hdrdir)/ruby/ruby.h $(hdrdir)/ruby/defines.h $(hdrdir)/ruby/missing.h $(hdrdir)/ruby/intern.h $(hdrdir)/ruby/st.h $(hdrdir)/ruby/subst.h $(arch_hdrdir)/ruby/config.h
110
+
111
+ RM = rm -f
112
+ RM_RF = $(RUBY) -run -e rm -- -rf
113
+ RMDIRS = rmdir --ignore-fail-on-non-empty -p
114
+ MAKEDIRS = /bin/mkdir -p
115
+ INSTALL = /usr/bin/install -c
116
+ INSTALL_PROG = $(INSTALL) -m 0755
117
+ INSTALL_DATA = $(INSTALL) -m 644
118
+ COPY = cp
119
+ TOUCH = exit >
120
+
121
+ #### End of system configuration section. ####
122
+
123
+ preload =
124
+
125
+ libpath = . $(libdir)
126
+ LIBPATH = -L. -L$(libdir) -Wl,-R$(libdir)
127
+ DEFFILE =
128
+
129
+ CLEANFILES = mkmf.log
130
+ DISTCLEANFILES =
131
+ DISTCLEANDIRS =
132
+
133
+ extout =
134
+ extout_prefix =
135
+ target_prefix =
136
+ LOCAL_LIBS =
137
+ LIBS = $(LIBRUBYARG_SHARED) -lpthread -ldl -lcrypt -lm -lc
138
+ ORIG_SRCS = _statistics3.c
139
+ SRCS = $(ORIG_SRCS)
140
+ OBJS = _statistics3.o
141
+ HDRS =
142
+ TARGET = _statistics3
143
+ TARGET_NAME = _statistics3
144
+ TARGET_ENTRY = Init_$(TARGET_NAME)
145
+ DLLIB = $(TARGET).so
146
+ EXTSTATIC =
147
+ STATIC_LIB =
148
+
149
+ TIMESTAMP_DIR = .
150
+ BINDIR = $(bindir)
151
+ RUBYCOMMONDIR = $(sitedir)$(target_prefix)
152
+ RUBYLIBDIR = $(sitelibdir)$(target_prefix)
153
+ RUBYARCHDIR = $(sitearchdir)$(target_prefix)
154
+ HDRDIR = $(rubyhdrdir)/ruby$(target_prefix)
155
+ ARCHHDRDIR = $(rubyhdrdir)/$(arch)/ruby$(target_prefix)
156
+
157
+ TARGET_SO = $(DLLIB)
158
+ CLEANLIBS = $(TARGET).so
159
+ CLEANOBJS = *.o *.bak
160
+
161
+ all: $(DLLIB)
162
+ static: $(STATIC_LIB) install-rb
163
+ .PHONY: all install static install-so install-rb
164
+ .PHONY: clean clean-so clean-static clean-rb
165
+
166
+ clean-static::
167
+ clean-rb-default::
168
+ clean-rb::
169
+ clean-so::
170
+ clean: clean-so clean-static clean-rb-default clean-rb
171
+ -$(Q)$(RM) $(CLEANLIBS) $(CLEANOBJS) $(CLEANFILES) .*.time
172
+
173
+ distclean-rb-default::
174
+ distclean-rb::
175
+ distclean-so::
176
+ distclean-static::
177
+ distclean: clean distclean-so distclean-static distclean-rb-default distclean-rb
178
+ -$(Q)$(RM) Makefile $(RUBY_EXTCONF_H) conftest.* mkmf.log
179
+ -$(Q)$(RM) core ruby$(EXEEXT) *~ $(DISTCLEANFILES)
180
+ -$(Q)$(RMDIRS) $(DISTCLEANDIRS) 2> /dev/null || true
181
+
182
+ realclean: distclean
183
+ install: install-so install-rb
184
+
185
+ install-so: $(DLLIB) $(TIMESTAMP_DIR)/.RUBYARCHDIR.time
186
+ $(INSTALL_PROG) $(DLLIB) $(RUBYARCHDIR)
187
+ clean-static::
188
+ -$(Q)$(RM) $(STATIC_LIB)
189
+ install-rb: pre-install-rb install-rb-default
190
+ install-rb-default: pre-install-rb-default
191
+ pre-install-rb: Makefile
192
+ pre-install-rb-default: Makefile
193
+ pre-install-rb-default:
194
+ @$(NULLCMD)
195
+ $(TIMESTAMP_DIR)/.RUBYARCHDIR.time:
196
+ $(Q) $(MAKEDIRS) $(@D) $(RUBYARCHDIR)
197
+ $(Q) $(TOUCH) $@
198
+
199
+ site-install: site-install-so site-install-rb
200
+ site-install-so: install-so
201
+ site-install-rb: install-rb
202
+
203
+ .SUFFIXES: .c .m .cc .mm .cxx .cpp .o .S
204
+
205
+ .cc.o:
206
+ $(ECHO) compiling $(<)
207
+ $(Q) $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -c $<
208
+
209
+ .cc.S:
210
+ $(ECHO) translating $(<)
211
+ $(Q) $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -S $<
212
+
213
+ .mm.o:
214
+ $(ECHO) compiling $(<)
215
+ $(Q) $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -c $<
216
+
217
+ .mm.S:
218
+ $(ECHO) translating $(<)
219
+ $(Q) $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -S $<
220
+
221
+ .cxx.o:
222
+ $(ECHO) compiling $(<)
223
+ $(Q) $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -c $<
224
+
225
+ .cxx.S:
226
+ $(ECHO) translating $(<)
227
+ $(Q) $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -S $<
228
+
229
+ .cpp.o:
230
+ $(ECHO) compiling $(<)
231
+ $(Q) $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -c $<
232
+
233
+ .cpp.S:
234
+ $(ECHO) translating $(<)
235
+ $(Q) $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -S $<
236
+
237
+ .c.o:
238
+ $(ECHO) compiling $(<)
239
+ $(Q) $(CC) $(INCFLAGS) $(CPPFLAGS) $(CFLAGS) $(COUTFLAG)$@ -c $<
240
+
241
+ .c.S:
242
+ $(ECHO) translating $(<)
243
+ $(Q) $(CC) $(INCFLAGS) $(CPPFLAGS) $(CFLAGS) $(COUTFLAG)$@ -S $<
244
+
245
+ .m.o:
246
+ $(ECHO) compiling $(<)
247
+ $(Q) $(CC) $(INCFLAGS) $(CPPFLAGS) $(CFLAGS) $(COUTFLAG)$@ -c $<
248
+
249
+ .m.S:
250
+ $(ECHO) translating $(<)
251
+ $(Q) $(CC) $(INCFLAGS) $(CPPFLAGS) $(CFLAGS) $(COUTFLAG)$@ -S $<
252
+
253
+ $(DLLIB): $(OBJS) Makefile
254
+ $(ECHO) linking shared-object $(DLLIB)
255
+ -$(Q)$(RM) $(@)
256
+ $(Q) $(LDSHARED) -o $@ $(OBJS) $(LIBPATH) $(DLDFLAGS) $(LOCAL_LIBS) $(LIBS)
257
+
258
+
259
+
260
+ $(OBJS): $(HDRS) $(ruby_headers)