ferret 0.3.2 → 0.9.0

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.
Files changed (141) hide show
  1. data/CHANGELOG +9 -0
  2. data/Rakefile +51 -25
  3. data/ext/analysis.c +553 -0
  4. data/ext/analysis.h +76 -0
  5. data/ext/array.c +83 -0
  6. data/ext/array.h +19 -0
  7. data/ext/bitvector.c +164 -0
  8. data/ext/bitvector.h +29 -0
  9. data/ext/compound_io.c +335 -0
  10. data/ext/document.c +336 -0
  11. data/ext/document.h +87 -0
  12. data/ext/ferret.c +88 -47
  13. data/ext/ferret.h +43 -109
  14. data/ext/field.c +395 -0
  15. data/ext/filter.c +103 -0
  16. data/ext/fs_store.c +352 -0
  17. data/ext/global.c +219 -0
  18. data/ext/global.h +73 -0
  19. data/ext/hash.c +446 -0
  20. data/ext/hash.h +80 -0
  21. data/ext/hashset.c +141 -0
  22. data/ext/hashset.h +37 -0
  23. data/ext/helper.c +11 -0
  24. data/ext/helper.h +5 -0
  25. data/ext/inc/lang.h +41 -0
  26. data/ext/ind.c +389 -0
  27. data/ext/index.h +884 -0
  28. data/ext/index_io.c +269 -415
  29. data/ext/index_rw.c +2543 -0
  30. data/ext/lang.c +31 -0
  31. data/ext/lang.h +41 -0
  32. data/ext/priorityqueue.c +228 -0
  33. data/ext/priorityqueue.h +44 -0
  34. data/ext/q_boolean.c +1331 -0
  35. data/ext/q_const_score.c +154 -0
  36. data/ext/q_fuzzy.c +287 -0
  37. data/ext/q_match_all.c +142 -0
  38. data/ext/q_multi_phrase.c +343 -0
  39. data/ext/q_parser.c +2180 -0
  40. data/ext/q_phrase.c +657 -0
  41. data/ext/q_prefix.c +75 -0
  42. data/ext/q_range.c +247 -0
  43. data/ext/q_span.c +1566 -0
  44. data/ext/q_term.c +308 -0
  45. data/ext/q_wildcard.c +146 -0
  46. data/ext/r_analysis.c +255 -0
  47. data/ext/r_doc.c +578 -0
  48. data/ext/r_index_io.c +996 -0
  49. data/ext/r_qparser.c +158 -0
  50. data/ext/r_search.c +2321 -0
  51. data/ext/r_store.c +263 -0
  52. data/ext/r_term.c +219 -0
  53. data/ext/ram_store.c +447 -0
  54. data/ext/search.c +524 -0
  55. data/ext/search.h +1065 -0
  56. data/ext/similarity.c +143 -39
  57. data/ext/sort.c +661 -0
  58. data/ext/store.c +35 -0
  59. data/ext/store.h +152 -0
  60. data/ext/term.c +704 -143
  61. data/ext/termdocs.c +599 -0
  62. data/ext/vector.c +594 -0
  63. data/lib/ferret.rb +9 -10
  64. data/lib/ferret/analysis/analyzers.rb +2 -2
  65. data/lib/ferret/analysis/standard_tokenizer.rb +1 -1
  66. data/lib/ferret/analysis/token.rb +14 -14
  67. data/lib/ferret/analysis/token_filters.rb +3 -3
  68. data/lib/ferret/document/field.rb +16 -17
  69. data/lib/ferret/index/document_writer.rb +4 -4
  70. data/lib/ferret/index/index.rb +39 -23
  71. data/lib/ferret/index/index_writer.rb +2 -2
  72. data/lib/ferret/index/multiple_term_doc_pos_enum.rb +1 -8
  73. data/lib/ferret/index/segment_term_vector.rb +4 -4
  74. data/lib/ferret/index/term.rb +5 -1
  75. data/lib/ferret/index/term_vector_offset_info.rb +6 -6
  76. data/lib/ferret/index/term_vectors_io.rb +5 -5
  77. data/lib/ferret/query_parser/query_parser.tab.rb +81 -77
  78. data/lib/ferret/search.rb +1 -1
  79. data/lib/ferret/search/boolean_query.rb +2 -1
  80. data/lib/ferret/search/field_sorted_hit_queue.rb +3 -3
  81. data/lib/ferret/search/fuzzy_query.rb +2 -1
  82. data/lib/ferret/search/index_searcher.rb +3 -0
  83. data/lib/ferret/search/{match_all_docs_query.rb → match_all_query.rb} +7 -7
  84. data/lib/ferret/search/multi_phrase_query.rb +6 -5
  85. data/lib/ferret/search/phrase_query.rb +3 -6
  86. data/lib/ferret/search/prefix_query.rb +4 -4
  87. data/lib/ferret/search/sort.rb +3 -1
  88. data/lib/ferret/search/sort_field.rb +9 -9
  89. data/lib/ferret/search/spans/near_spans_enum.rb +1 -1
  90. data/lib/ferret/search/spans/span_near_query.rb +1 -1
  91. data/lib/ferret/search/spans/span_weight.rb +1 -1
  92. data/lib/ferret/search/spans/spans_enum.rb +7 -7
  93. data/lib/ferret/store/fs_store.rb +10 -6
  94. data/lib/ferret/store/ram_store.rb +3 -3
  95. data/lib/rferret.rb +36 -0
  96. data/test/functional/thread_safety_index_test.rb +2 -2
  97. data/test/test_helper.rb +16 -2
  98. data/test/unit/analysis/c_token.rb +25 -0
  99. data/test/unit/analysis/tc_per_field_analyzer_wrapper.rb +1 -1
  100. data/test/unit/analysis/tc_standard_analyzer.rb +1 -1
  101. data/test/unit/document/{tc_document.rb → c_document.rb} +0 -0
  102. data/test/unit/document/c_field.rb +98 -0
  103. data/test/unit/document/tc_field.rb +0 -66
  104. data/test/unit/index/{tc_index.rb → c_index.rb} +62 -6
  105. data/test/unit/index/{tc_index_reader.rb → c_index_reader.rb} +51 -10
  106. data/test/unit/index/{tc_index_writer.rb → c_index_writer.rb} +0 -4
  107. data/test/unit/index/{tc_term.rb → c_term.rb} +1 -3
  108. data/test/unit/index/{tc_term_vector_offset_info.rb → c_term_voi.rb} +5 -5
  109. data/test/unit/index/tc_segment_term_vector.rb +2 -2
  110. data/test/unit/index/tc_term_vectors_io.rb +4 -4
  111. data/test/unit/query_parser/c_query_parser.rb +138 -0
  112. data/test/unit/search/{tc_filter.rb → c_filter.rb} +24 -24
  113. data/test/unit/search/{tc_fuzzy_query.rb → c_fuzzy_query.rb} +0 -0
  114. data/test/unit/search/{tc_index_searcher.rb → c_index_searcher.rb} +9 -26
  115. data/test/unit/search/{tc_search_and_sort.rb → c_search_and_sort.rb} +15 -15
  116. data/test/unit/search/{tc_sort.rb → c_sort.rb} +2 -1
  117. data/test/unit/search/c_sort_field.rb +27 -0
  118. data/test/unit/search/{tc_spans.rb → c_spans.rb} +0 -0
  119. data/test/unit/search/tc_sort_field.rb +7 -20
  120. data/test/unit/store/c_fs_store.rb +76 -0
  121. data/test/unit/store/c_ram_store.rb +35 -0
  122. data/test/unit/store/m_store.rb +34 -0
  123. data/test/unit/store/m_store_lock.rb +68 -0
  124. data/test/unit/store/tc_fs_store.rb +0 -53
  125. data/test/unit/store/tc_ram_store.rb +0 -20
  126. data/test/unit/store/tm_store.rb +0 -30
  127. data/test/unit/store/tm_store_lock.rb +0 -66
  128. metadata +84 -31
  129. data/ext/Makefile +0 -140
  130. data/ext/ferret_ext.so +0 -0
  131. data/ext/priority_queue.c +0 -232
  132. data/ext/ram_directory.c +0 -321
  133. data/ext/segment_merge_queue.c +0 -37
  134. data/ext/segment_term_enum.c +0 -326
  135. data/ext/string_helper.c +0 -42
  136. data/ext/tags +0 -344
  137. data/ext/term_buffer.c +0 -230
  138. data/ext/term_infos_reader.c +0 -54
  139. data/ext/terminfo.c +0 -160
  140. data/ext/token.c +0 -93
  141. data/ext/util.c +0 -12
@@ -59,57 +59,4 @@ class FSStoreTest < Test::Unit::TestCase
59
59
  "this directory should have been removed from the cache")
60
60
  end
61
61
 
62
- def test_fslock
63
- lock_name = "lfile"
64
- lock_file_path = make_lock_file_path(lock_name)
65
- assert(! File.exists?(lock_file_path), "There should be no lock file")
66
- lock = @dir.make_lock(lock_name)
67
- assert(! File.exists?(lock_file_path), "There should still be no lock file")
68
- assert(! lock.locked?, "lock shouldn't be locked yet")
69
-
70
- lock.obtain
71
-
72
- assert(lock.locked?, "lock should now be locked")
73
- assert(File.exists?(lock_file_path), "A lock file should have been created")
74
-
75
- assert(! @dir.exists?(lock_file_path),
76
- "The lock should be hidden by the FSDirectories directory scan")
77
-
78
- lock.release
79
-
80
- assert(! lock.locked?, "lock should be freed again")
81
- assert(! File.exists?(lock_file_path), "The lock file should have been deleted")
82
- end
83
-
84
- # def make_and_loose_lock
85
- # lock = @dir.make_lock("finalizer_lock")
86
- # lock.obtain
87
- # lock = nil
88
- # end
89
- #
90
- # def test_fslock_finalizer
91
- # lock_name = "finalizer_lock"
92
- # lock_file_path = make_lock_file_path(lock_name)
93
- # assert(! File.exists?(lock_file_path), "There should be no lock file")
94
- #
95
- # make_and_loose_lock
96
- #
97
- # #assert(File.exists?(lock_file_path), "There should now be a lock file")
98
- #
99
- # lock = @dir.make_lock(lock_name)
100
- # assert(lock.locked?, "lock should now be locked")
101
- #
102
- # GC.start
103
- #
104
- # assert(! lock.locked?, "lock should be freed again")
105
- # assert(! File.exists?(lock_file_path), "The lock file should have been deleted")
106
- # end
107
- #
108
- def make_lock_file_path(name)
109
- lock_file_path = File.join(@dpath, @dir.get_lock_prefix() + name)
110
- if File.exists?(lock_file_path) then
111
- File.delete(lock_file_path)
112
- end
113
- return lock_file_path
114
- end
115
62
  end
@@ -12,24 +12,4 @@ class RAMStoreTest < Test::Unit::TestCase
12
12
  def teardown
13
13
  @dir.close()
14
14
  end
15
-
16
- def test_ramlock
17
- name = "lfile"
18
- lfile = Ferret::Store::Directory::LOCK_PREFIX + name
19
- assert(! @dir.exists?(lfile),
20
- "There should be no lock file")
21
- lock = @dir.make_lock(name)
22
- assert(! @dir.exists?(lfile),
23
- "There should still be no lock file")
24
- assert(! @dir.exists?(lfile),
25
- "The lock should be hidden by the FSDirectories directory scan")
26
- assert(! lock.locked?, "lock shouldn't be locked yet")
27
- lock.obtain
28
- assert(lock.locked?, "lock should now be locked")
29
- assert(@dir.exists?(lfile), "A lock file should have been created")
30
- lock.release
31
- assert(! lock.locked?, "lock should be freed again")
32
- assert(! @dir.exists?(lfile),
33
- "The lock file should have been deleted")
34
- end
35
15
  end
@@ -2,36 +2,6 @@ module StoreTest
2
2
  # declare dir so inheritors can access it.
3
3
  @dir = nil
4
4
 
5
- # test the basic file manipulation methods;
6
- # - exists?
7
- # - touch
8
- # - delete
9
- # - file_count
10
- def test_basic_file_ops
11
- assert_equal(0, @dir.file_count(), "directory should be empty")
12
- assert(! @dir.exists?('filename'), "File should not exist")
13
- @dir.touch('tmpfile1')
14
- assert_equal(1, @dir.file_count(), "directory should have one file")
15
- @dir.touch('tmpfile2')
16
- assert_equal(2, @dir.file_count(), "directory should have two files")
17
- assert(@dir.exists?('tmpfile1'), "'tmpfile1' should exist")
18
- @dir.delete('tmpfile1')
19
- assert(! @dir.exists?('tmpfile1'), "'tmpfile1' should no longer exist")
20
- assert_equal(1, @dir.file_count(), "directory should have one file")
21
- end
22
-
23
- def test_rename
24
- @dir.touch("from")
25
- assert(@dir.exists?('from'), "File should exist")
26
- assert(! @dir.exists?('to'), "File should not exist")
27
- cnt_before = @dir.file_count()
28
- @dir.rename('from', 'to')
29
- cnt_after = @dir.file_count()
30
- assert_equal(cnt_before, cnt_after, "the number of files shouldn't have changed")
31
- assert(@dir.exists?('to'), "File should now exist")
32
- assert(! @dir.exists?('from'), "File should no longer exist")
33
- end
34
-
35
5
  def test_modified
36
6
  # difficult to test this one but as file mtime is only stored to the nearest second.
37
7
  # we can assume this test will happen in less than a few seconds. (I hope)
@@ -1,68 +1,2 @@
1
1
  module StoreLockTest
2
- class Switch
3
- @@counter = 0
4
- def Switch.counter() return @@counter end
5
- def Switch.counter=(counter) @@counter = counter end
6
- end
7
-
8
- def test_locking()
9
- lock_time_out = 0.001 # we want this test to run quickly
10
- lock1 = @dir.make_lock("l.lck")
11
- lock2 = @dir.make_lock("l.lck")
12
-
13
- assert(!lock2.locked?)
14
- assert(lock1.obtain(lock_time_out))
15
- assert(lock2.locked?)
16
-
17
- assert(! obtain_lock_true_false(lock2))
18
-
19
- exception_thrown = false
20
- begin
21
- lock2.while_locked(lock_time_out) do
22
- assert(false, "lock should not have been obtained")
23
- end
24
- rescue
25
- exception_thrown = true
26
- ensure
27
- assert(exception_thrown)
28
- end
29
-
30
- lock1.release()
31
- assert(lock2.obtain(lock_time_out))
32
- lock2.release()
33
-
34
- t = Thread.new() do
35
- lock1.while_locked(lock_time_out) do
36
- Switch.counter = 1
37
- # make sure lock2 obtain test was run
38
- while Switch.counter < 2
39
- end
40
- Switch.counter = 3
41
- end
42
- end
43
- t.run()
44
-
45
- #make sure thread has started and lock been obtained
46
- while Switch.counter < 1
47
- end
48
-
49
- assert(! obtain_lock_true_false(lock2))
50
-
51
- Switch.counter = 2
52
- while Switch.counter < 3
53
- end
54
-
55
- assert(lock2.obtain(lock_time_out))
56
- lock2.release()
57
- end
58
-
59
- def obtain_lock_true_false(lock)
60
- lock_time_out = 0.001 # we want this test to run quickly
61
- begin
62
- lock.obtain(lock_time_out)
63
- return true
64
- rescue
65
- end
66
- return false
67
- end
68
2
  end
metadata CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.8.11
3
3
  specification_version: 1
4
4
  name: ferret
5
5
  version: !ruby/object:Gem::Version
6
- version: 0.3.2
7
- date: 2005-12-16 00:00:00 +09:00
6
+ version: 0.9.0
7
+ date: 2006-03-19 00:00:00 +09:00
8
8
  summary: Ruby indexing library.
9
9
  require_paths:
10
10
  - lib
@@ -35,27 +35,72 @@ files:
35
35
  - MIT-LICENSE
36
36
  - TODO
37
37
  - TUTORIAL
38
- - ext/Makefile
39
- - ext/index_io.c
40
- - ext/term_buffer.c
41
- - ext/ram_directory.c
42
- - ext/priority_queue.c
43
- - ext/string_helper.c
44
- - ext/segment_merge_queue.c
45
- - ext/extconf.rb
38
+ - CHANGELOG
46
39
  - ext/ferret.c
40
+ - ext/lang.c
41
+ - ext/r_analysis.c
42
+ - ext/r_doc.c
43
+ - ext/r_index_io.c
44
+ - ext/r_qparser.c
45
+ - ext/r_search.c
46
+ - ext/r_store.c
47
+ - ext/r_term.c
48
+ - ext/extconf.rb
49
+ - ext/inc
50
+ - ext/analysis.c
51
+ - ext/document.c
52
+ - ext/compound_io.c
53
+ - ext/index_rw.c
54
+ - ext/termdocs.c
55
+ - ext/vector.c
56
+ - ext/field.c
47
57
  - ext/term.c
48
- - ext/ferret.h
49
- - ext/util.c
50
- - ext/token.c
51
- - ext/tags
58
+ - ext/q_parser.c
59
+ - ext/q_const_score.c
60
+ - ext/q_boolean.c
61
+ - ext/q_match_all.c
62
+ - ext/q_phrase.c
63
+ - ext/q_fuzzy.c
64
+ - ext/search.c
65
+ - ext/ind.c
52
66
  - ext/dummy.exe
53
- - ext/segment_term_enum.c
54
- - ext/terminfo.c
55
- - ext/ferret_ext.so
56
- - ext/term_infos_reader.c
67
+ - ext/q_multi_phrase.c
68
+ - ext/q_wildcard.c
69
+ - ext/q_range.c
70
+ - ext/q_prefix.c
71
+ - ext/q_span.c
72
+ - ext/filter.c
57
73
  - ext/similarity.c
74
+ - ext/sort.c
75
+ - ext/q_term.c
76
+ - ext/index_io.c
77
+ - ext/fs_store.c
78
+ - ext/ram_store.c
79
+ - ext/store.c
80
+ - ext/hashset.c
81
+ - ext/array.c
82
+ - ext/bitvector.c
83
+ - ext/helper.c
84
+ - ext/global.c
85
+ - ext/hash.c
86
+ - ext/priorityqueue.c
87
+ - ext/document.h
88
+ - ext/store.h
89
+ - ext/array.h
90
+ - ext/priorityqueue.h
91
+ - ext/hashset.h
92
+ - ext/helper.h
93
+ - ext/global.h
94
+ - ext/bitvector.h
95
+ - ext/analysis.h
96
+ - ext/hash.h
97
+ - ext/search.h
98
+ - ext/lang.h
99
+ - ext/ferret.h
100
+ - ext/index.h
101
+ - ext/inc/lang.h
58
102
  - lib/ferret.rb
103
+ - lib/rferret.rb
59
104
  - lib/ferret/analysis.rb
60
105
  - lib/ferret/document.rb
61
106
  - lib/ferret/index.rb
@@ -135,7 +180,6 @@ files:
135
180
  - lib/ferret/search/query_filter.rb
136
181
  - lib/ferret/search/wildcard_query.rb
137
182
  - lib/ferret/search/wildcard_term_enum.rb
138
- - lib/ferret/search/match_all_docs_query.rb
139
183
  - lib/ferret/search/phrase_query.rb
140
184
  - lib/ferret/search/exact_phrase_scorer.rb
141
185
  - lib/ferret/search/sloppy_phrase_scorer.rb
@@ -147,6 +191,7 @@ files:
147
191
  - lib/ferret/search/sort_comparator.rb
148
192
  - lib/ferret/search/range_filter.rb
149
193
  - lib/ferret/search/field_cache.rb
194
+ - lib/ferret/search/match_all_query.rb
150
195
  - lib/ferret/search/spans/near_spans_enum.rb
151
196
  - lib/ferret/search/spans/span_first_query.rb
152
197
  - lib/ferret/search/spans/spans_enum.rb
@@ -202,6 +247,7 @@ files:
202
247
  - test/unit/analysis/tc_analyzer.rb
203
248
  - test/unit/analysis/tc_standard_analyzer.rb
204
249
  - test/unit/analysis/tc_white_space_tokenizer.rb
250
+ - test/unit/analysis/c_token.rb
205
251
  - test/unit/index/tc_segment_term_docs.rb
206
252
  - test/unit/index/tc_term_infos_io.rb
207
253
  - test/unit/index/tc_fields_io.rb
@@ -209,32 +255,39 @@ files:
209
255
  - test/unit/index/tc_segment_infos.rb
210
256
  - test/unit/index/tc_segment_term_vector.rb
211
257
  - test/unit/index/tc_term_vectors_io.rb
212
- - test/unit/index/tc_index_writer.rb
213
- - test/unit/index/tc_term.rb
214
258
  - test/unit/index/th_doc.rb
215
259
  - test/unit/index/tc_compound_file_io.rb
216
- - test/unit/index/tc_term_vector_offset_info.rb
217
260
  - test/unit/index/tc_segment_term_enum.rb
218
261
  - test/unit/index/tc_field_infos.rb
219
262
  - test/unit/index/tc_term_info.rb
220
- - test/unit/index/tc_index.rb
221
- - test/unit/index/tc_index_reader.rb
263
+ - test/unit/index/c_index.rb
264
+ - test/unit/index/c_index_reader.rb
222
265
  - test/unit/index/tc_multiple_term_doc_pos_enum.rb
266
+ - test/unit/index/c_index_writer.rb
267
+ - test/unit/index/c_term.rb
268
+ - test/unit/index/c_term_voi.rb
223
269
  - test/unit/store/tc_ram_store.rb
224
270
  - test/unit/store/tm_store_lock.rb
225
271
  - test/unit/store/tc_fs_store.rb
226
272
  - test/unit/store/tm_store.rb
227
- - test/unit/document/tc_document.rb
273
+ - test/unit/store/c_fs_store.rb
274
+ - test/unit/store/c_ram_store.rb
275
+ - test/unit/store/m_store_lock.rb
276
+ - test/unit/store/m_store.rb
277
+ - test/unit/document/c_field.rb
228
278
  - test/unit/document/tc_field.rb
279
+ - test/unit/document/c_document.rb
229
280
  - test/unit/query_parser/tc_query_parser.rb
230
- - test/unit/search/tc_sort.rb
281
+ - test/unit/query_parser/c_query_parser.rb
231
282
  - test/unit/search/tc_similarity.rb
232
- - test/unit/search/tc_index_searcher.rb
233
- - test/unit/search/tc_fuzzy_query.rb
234
- - test/unit/search/tc_search_and_sort.rb
235
283
  - test/unit/search/tc_sort_field.rb
236
- - test/unit/search/tc_filter.rb
237
- - test/unit/search/tc_spans.rb
284
+ - test/unit/search/c_filter.rb
285
+ - test/unit/search/c_fuzzy_query.rb
286
+ - test/unit/search/c_index_searcher.rb
287
+ - test/unit/search/c_search_and_sort.rb
288
+ - test/unit/search/c_sort_field.rb
289
+ - test/unit/search/c_sort.rb
290
+ - test/unit/search/c_spans.rb
238
291
  - test/longrunning/tc_numbertools.rb
239
292
  - test/longrunning/tm_store.rb
240
293
  - test/benchmark/tb_rw_vint.rb
data/ext/Makefile DELETED
@@ -1,140 +0,0 @@
1
-
2
- SHELL = /bin/sh
3
-
4
- #### Start of system configuration section. ####
5
-
6
- srcdir = .
7
- topdir = /usr/lib/ruby/1.8/i486-linux
8
- hdrdir = $(topdir)
9
- VPATH = $(srcdir):$(topdir):$(hdrdir)
10
- prefix = $(DESTDIR)/usr
11
- exec_prefix = $(prefix)
12
- sitedir = $(DESTDIR)/usr/local/lib/site_ruby
13
- rubylibdir = $(libdir)/ruby/$(ruby_version)
14
- archdir = $(rubylibdir)/$(arch)
15
- sbindir = $(exec_prefix)/sbin
16
- datadir = $(prefix)/share
17
- includedir = $(prefix)/include
18
- infodir = $(prefix)/info
19
- sysconfdir = $(DESTDIR)/etc
20
- mandir = $(datadir)/man
21
- libdir = $(exec_prefix)/lib
22
- sharedstatedir = $(prefix)/com
23
- oldincludedir = $(DESTDIR)/usr/include
24
- sitearchdir = $(sitelibdir)/$(sitearch)
25
- bindir = $(exec_prefix)/bin
26
- localstatedir = $(DESTDIR)/var
27
- sitelibdir = $(sitedir)/$(ruby_version)
28
- libexecdir = $(exec_prefix)/libexec
29
-
30
- CC = gcc
31
- LIBRUBY = $(LIBRUBY_SO)
32
- LIBRUBY_A = lib$(RUBY_SO_NAME)-static.a
33
- LIBRUBYARG_SHARED = -l$(RUBY_SO_NAME)
34
- LIBRUBYARG_STATIC = -l$(RUBY_SO_NAME)-static
35
-
36
- CFLAGS = -fPIC -Wall -g -O2 -fPIC
37
- CPPFLAGS = -I. -I$(topdir) -I$(hdrdir) -I$(srcdir)
38
- CXXFLAGS = $(CFLAGS)
39
- DLDFLAGS =
40
- LDSHARED = $(CC) -shared
41
- AR = ar
42
- EXEEXT =
43
-
44
- RUBY_INSTALL_NAME = ruby1.8
45
- RUBY_SO_NAME = ruby1.8
46
- arch = i486-linux
47
- sitearch = i486-linux
48
- ruby_version = 1.8
49
- ruby = /usr/bin/ruby1.8
50
- RUBY = $(ruby)
51
- RM = rm -f
52
- MAKEDIRS = mkdir -p
53
- INSTALL = /usr/bin/install -c
54
- INSTALL_PROG = $(INSTALL) -m 0755
55
- INSTALL_DATA = $(INSTALL) -m 644
56
- COPY = cp
57
-
58
- #### End of system configuration section. ####
59
-
60
- preload =
61
-
62
- libpath = $(libdir)
63
- LIBPATH = -L"$(libdir)"
64
- DEFFILE =
65
-
66
- CLEANFILES =
67
- DISTCLEANFILES =
68
-
69
- extout =
70
- extout_prefix =
71
- target_prefix =
72
- LOCAL_LIBS =
73
- LIBS = $(LIBRUBYARG_SHARED) -lpthread -ldl -lcrypt -lm -lc
74
- SRCS = index_io.c term_buffer.c ram_directory.c priority_queue.c string_helper.c segment_merge_queue.c ferret.c term.c util.c token.c segment_term_enum.c terminfo.c term_infos_reader.c similarity.c
75
- OBJS = index_io.o term_buffer.o ram_directory.o priority_queue.o string_helper.o segment_merge_queue.o ferret.o term.o util.o token.o segment_term_enum.o terminfo.o term_infos_reader.o similarity.o
76
- TARGET = ferret_ext
77
- DLLIB = $(TARGET).so
78
- STATIC_LIB =
79
-
80
- RUBYCOMMONDIR = $(sitedir)$(target_prefix)
81
- RUBYLIBDIR = $(sitelibdir)$(target_prefix)
82
- RUBYARCHDIR = $(sitearchdir)$(target_prefix)
83
-
84
- TARGET_SO = $(DLLIB)
85
- CLEANLIBS = $(TARGET).so $(TARGET).il? $(TARGET).tds $(TARGET).map
86
- CLEANOBJS = *.o *.a *.s[ol] *.pdb *.exp *.bak
87
-
88
- all: $(DLLIB)
89
- static: $(STATIC_LIB)
90
-
91
- clean:
92
- @-$(RM) $(CLEANLIBS) $(CLEANOBJS) $(CLEANFILES)
93
-
94
- distclean: clean
95
- @-$(RM) Makefile extconf.h conftest.* mkmf.log
96
- @-$(RM) core ruby$(EXEEXT) *~ $(DISTCLEANFILES)
97
-
98
- realclean: distclean
99
- install: install-so install-rb
100
-
101
- install-so: $(RUBYARCHDIR)
102
- install-so: $(RUBYARCHDIR)/$(DLLIB)
103
- $(RUBYARCHDIR)/$(DLLIB): $(DLLIB)
104
- $(INSTALL_PROG) $(DLLIB) $(RUBYARCHDIR)
105
- install-rb: pre-install-rb install-rb-default
106
- install-rb-default: pre-install-rb-default
107
- pre-install-rb pre-install-rb-default: $(RUBYLIBDIR)
108
- $(RUBYARCHDIR):
109
- $(MAKEDIRS) $@
110
- $(RUBYLIBDIR):
111
- $(MAKEDIRS) $@
112
-
113
- site-install: site-install-so site-install-rb
114
- site-install-so: install-so
115
- site-install-rb: install-rb
116
-
117
- .SUFFIXES: .c .m .cc .cxx .cpp .C .o
118
-
119
- .cc.o:
120
- $(CXX) $(CXXFLAGS) $(CPPFLAGS) -c $<
121
-
122
- .cxx.o:
123
- $(CXX) $(CXXFLAGS) $(CPPFLAGS) -c $<
124
-
125
- .cpp.o:
126
- $(CXX) $(CXXFLAGS) $(CPPFLAGS) -c $<
127
-
128
- .C.o:
129
- $(CXX) $(CXXFLAGS) $(CPPFLAGS) -c $<
130
-
131
- .c.o:
132
- $(CC) $(CFLAGS) $(CPPFLAGS) -c $<
133
-
134
- $(DLLIB): $(OBJS)
135
- @-$(RM) $@
136
- $(LDSHARED) $(DLDFLAGS) $(LIBPATH) -o $@ $(OBJS) $(LOCAL_LIBS) $(LIBS)
137
-
138
-
139
-
140
- $(OBJS): ruby.h defines.h