Skip to content
This repository
Newer
Older
100644 259 lines (195 sloc) 6.433 kb
90c05c1f »
2007-10-18 Update INSTALL to latest information.
1 # NOTE! When updating this file, also update INSTALL, if necessary.
a8bdc6b7 »
2008-01-22 Cleanup / reorganize Rakefile
2 # NOTE! Please keep your tasks grouped together.
90c05c1f »
2007-10-18 Update INSTALL to latest information.
3
10887844 »
2009-01-22 Silence a rake warning
4 $trace ||= false
69a60630 »
2007-11-29 Enable warnings for rake.
5 $VERBOSE = true
bdcf9cb6 »
2008-10-20 DEV is gone. See `rake build:help`. vm:test always uses debug flags.
6 $verbose = Rake.application.options.trace || ARGV.delete("-v")
7
a3526242 »
2009-04-20 Start of new LLVM JIT
8 if !$verbose and respond_to?(:verbose)
9 verbose(false) if verbose() == :default
10 end
11
243a7751 »
2009-11-23 Reworked configuring tasks.
12 unless File.exists?(File.expand_path("../config.rb", __FILE__)) and
13 File.exists?(File.expand_path("../vm/gen/config.h", __FILE__))
14 STDERR.puts "Please run ./configure first"
15 exit 1
16 end
17
be4319ef »
2007-11-14 Don't hardcode extension suffixes to 'bundle'.
18 $dlext = Config::CONFIG["DLEXT"]
eda2c1b5 »
2007-12-12 compiler is dead, long live compiler1!
19 $compiler = nil
0941eb2a »
2007-11-08 Add tasks to build .rba files
20
9ebee090 »
2008-08-20 Add mspec and spec rakelib files from master.
21 RUBINIUS_BASE = File.expand_path(File.dirname(__FILE__))
22
d8e12917 »
2008-10-23 Move "lib" inclusion to load path into Rakefile
23 $: << "lib"
24
2e737d73 »
2009-03-24 Removed rake spec commands. See rake spec for details.
25 task :default => %w[build vm:test] do
17da856c »
2009-10-30 Use 'sh' rather than 'system' so that $? is propagated
26 sh "bin/mspec ci -B full --background"
2e737d73 »
2009-03-24 Removed rake spec commands. See rake spec for details.
27 end
8dd2b6b8 »
2006-08-24 r43@vatu: evan | 2006-08-24 16:34:21 -0700
28
c5b5a973 »
2008-08-28 Move run_ruby, compile_ruby to main Rakefile and set RBX_RUNTIME
29 desc "Compile the given ruby file into a .rbc file"
30 task :compile_ruby, :file do |task, args|
31 file = args[:file]
32 raise ArgumentError, 'compile_ruby requires a file name' if file.nil?
33
34 rbc = file + 'c'
35
36 compile_ruby file, rbc
37 end
38 task :compile_ruby => 'kernel:build' # HACK argument + dependency is broken
39
46b6e4d9 »
2008-10-06 Add precompile task
40 desc "Run the given ruby file with the vm"
c5b5a973 »
2008-08-28 Move run_ruby, compile_ruby to main Rakefile and set RBX_RUNTIME
41 task :run_ruby, :file do |task, args|
42 file = args[:file]
43 raise ArgumentError, 'compile_ruby requires a file name' if file.nil?
44
45 rbc = file + 'c'
46
47 compile_ruby file, rbc
48
49 ENV['PROBE'] = 'yes' if $verbose
50 ENV['RBX_RUNTIME'] = File.join File.dirname(__FILE__), 'runtime'
51
52 sh 'vm/vm', rbc
53 end
8e087821 »
2008-08-28 run_ruby needs vm/vm
54 task :run_ruby => %w[kernel:build vm/vm] # HACK argument + dependency is broken
c5b5a973 »
2008-08-28 Move run_ruby, compile_ruby to main Rakefile and set RBX_RUNTIME
55
46b6e4d9 »
2008-10-06 Add precompile task
56 desc "Compile files with MRI because vm takes forever to do it"
57 task :precompile => %w[extensions] do
562a6b1e »
2008-10-11 Expanded precompile dir list
58 FileList['{mspec,kernel,lib,spec}/**/*.rb'].each do |rb|
46b6e4d9 »
2008-10-06 Add precompile task
59 next unless File.file? rb
60
61 rbc = "#{rb}c"
62
63 if File.exist? rbc then
64 rbc_mtime = File.mtime rbc
65 next if rbc_mtime >= COMPILER_MTIME or rbc_mtime >= File.mtime(rb)
66 end
67
68 mri_compile rb, rbc
69 end
70 end
71
bdcf9cb6 »
2008-10-20 DEV is gone. See `rake build:help`. vm:test always uses debug flags.
72 # See vm.rake for more information
73 desc "Build everything that needs to be built at default level."
56edbcab »
2009-11-24 Add rdoc, rake, and rake-compiler and preinstalled gems
74 task :build => ["build:normal", "gem_bootstrap"]
1ce3d9b0 »
2008-07-17 Reduced Rakefile to a minimally working version
75
90ffc928 »
2008-08-14 Rip out irrelevant parts of the Rakefile
76 desc "Recompile all ruby system files"
77 task :rebuild => %w[clean build]
1ce3d9b0 »
2008-07-17 Reduced Rakefile to a minimally working version
78
569fccd2 »
2008-07-30 Move vm/Rakefile to rakelib/vm.rake, integrate it into the base rake …
79 desc 'Remove rubinius build files'
af222eec »
2008-10-02 Restore generation of ruby_config and rubinius_config, add clean rules
80 task :clean => %w[
81 vm:clean
82 kernel:clean
83 clean:crap
9ed0630d »
2009-11-10 Reworked compiling C extensions.
84 extensions:clean
af222eec »
2008-10-02 Restore generation of ruby_config and rubinius_config, add clean rules
85 ]
1ce3d9b0 »
2008-07-17 Reduced Rakefile to a minimally working version
86
569fccd2 »
2008-07-30 Move vm/Rakefile to rakelib/vm.rake, integrate it into the base rake …
87 desc 'Remove rubinius build files and external library build files'
af222eec »
2008-10-02 Restore generation of ruby_config and rubinius_config, add clean rules
88 task :distclean => %w[
89 clean
90 vm:distclean
91 ]
1ce3d9b0 »
2008-07-17 Reduced Rakefile to a minimally working version
92
56edbcab »
2009-11-24 Add rdoc, rake, and rake-compiler and preinstalled gems
93 desc 'Move the preinstalled gem setup into place'
94 task :gem_bootstrap do
95 unless File.directory?("gems/rubinius")
96 sh "mkdir gems"
3bb6ecdf »
2009-11-24 Keep command stubs for preinstall gems
97 sh "cp -r preinstalled-gems/* gems/"
56edbcab »
2009-11-24 Add rdoc, rake, and rake-compiler and preinstalled gems
98 end
99 end
100
0e1df2fe »
2008-11-28 Added rake install and rake uninstall tasks.
101 def install_bin
102 File.join RBX_BINPATH, 'rbx'
103 end
104
105 desc "Uninstall Rubinius"
106 task :uninstall do
107 rm_rf install_bin
108 rm_rf RBX_BASE_PATH
b428a870 »
2009-09-28 Fixed rake install. Issues on your platform?--File a ticket.
109 sh "rake -q clean"
0e1df2fe »
2008-11-28 Added rake install and rake uninstall tasks.
110 end
111
112 desc "Install Rubinius"
b428a870 »
2009-09-28 Fixed rake install. Issues on your platform?--File a ticket.
113 task :install => %w[
0e1df2fe »
2008-11-28 Added rake install and rake uninstall tasks.
114 clean
115 install:build
116 install:files
117 ] do
b428a870 »
2009-09-28 Fixed rake install. Issues on your platform?--File a ticket.
118 sh "rake -q clean"
0e1df2fe »
2008-11-28 Added rake install and rake uninstall tasks.
119 puts "Install complete."
120 puts "The install versions of files have been cleaned."
121 puts "Run 'rake build' to rebuild development versions."
122 end
123
124 namespace :install do
125 # Internal task, not documented with desc. Shells out
126 # to perform the build. See reason in doc/build_system.txt.
127 task :build do
cc4a888d »
2008-11-28 Really fix (un)install tasks.
128 ENV['RBX_PREFIX'] = ENV['PREFIX'] || "/usr/local"
0e1df2fe »
2008-11-28 Added rake install and rake uninstall tasks.
129 ENV['RBX_RUNTIME'] = File.join(Dir.pwd, 'runtime')
b428a870 »
2009-09-28 Fixed rake install. Issues on your platform?--File a ticket.
130 sh "rake -q build"
0e1df2fe »
2008-11-28 Added rake install and rake uninstall tasks.
131 end
132
133 # Internal task, not documented with desc. Performs the
134 # actual file installation enabling the :install task
135 # to clean up after itself.
136 task :files do
137 mkdir_p RBX_BASE_PATH, :verbose => true
138 mkdir_p RBX_RBA_PATH, :verbose => true
139 mkdir_p RBX_EXT_PATH, :verbose => true
140 mkdir_p RBX_BIN_PATH, :verbose => true
141 mkdir_p RBX_LIB_PATH, :verbose => true
142
143
b428a870 »
2009-09-28 Fixed rake install. Issues on your platform?--File a ticket.
144 capi_header_files = Rake::FileList.new "vm/capi/*.h"
145 install_files capi_header_files, RBX_EXT_PATH
0e1df2fe »
2008-11-28 Added rake install and rake uninstall tasks.
146
147 File.open File.join(RBX_EXT_PATH, "missing.h"), "w" do |f|
148 f.puts "// This file left empty"
149 end
150
151 core_files = Rake::FileList.new('runtime/index',
152 'runtime/platform.conf',
153 'runtime/**/*.rb{a,c}',
05763b0c »
2009-02-10 Fixed rake install.
154 'runtime/**/load_order.txt')
0e1df2fe »
2008-11-28 Added rake install and rake uninstall tasks.
155 install_files core_files, RBX_RBA_PATH
156
157 lib_files = Rake::FileList.new 'lib/**/*'
158 install_files lib_files, RBX_LIB_PATH
159
160 Rake::FileList.new("#{RBX_LIB_PATH}/**/*.rb").sort.each do |rb|
b428a870 »
2009-09-28 Fixed rake install. Issues on your platform?--File a ticket.
161 begin
162 compile_ruby rb, "#{rb}c"
163 rescue Object => e
164 puts "Error compiling #{rb}!"
165 puts e.backtrace
166 puts "Install continuing but please file a ticket"
167 end
0e1df2fe »
2008-11-28 Added rake install and rake uninstall tasks.
168 end
169
170 install 'vm/vm', install_bin, :mode => 0755, :verbose => true
171 end
172 end
173
5c512360 »
2008-10-22 added task :compare to the Rakefile on cpp branch
174 def rbx_compile(from)
175 sh "bin/rbx compile -f #{from}"
176 end
177
178 desc 'Compare an rbc file made by MRI with one made by rbx'
179 task :compare, :file do |task, args|
180 file = args[:file]
181 raise "Please supply something that exists" unless File.exist? file
0e1df2fe »
2008-11-28 Added rake install and rake uninstall tasks.
182
5c512360 »
2008-10-22 added task :compare to the Rakefile on cpp branch
183 mri_compile file, file + 'c.mri'
184 rbx_compile file
0e1df2fe »
2008-11-28 Added rake install and rake uninstall tasks.
185
5c512360 »
2008-10-22 added task :compare to the Rakefile on cpp branch
186 File.open(file + 'c.mri') do |mri|
187 File.open(file + 'c') do |rbx|
188 while m = mri.gets and r = rbx.gets
189 puts "Line of Failure: #{rbx.lineno}" and break unless m === r
190 end
191 end
192 end
0e1df2fe »
2008-11-28 Added rake install and rake uninstall tasks.
193
5c512360 »
2008-10-22 added task :compare to the Rakefile on cpp branch
194 end
195
569fccd2 »
2008-07-30 Move vm/Rakefile to rakelib/vm.rake, integrate it into the base rake …
196 namespace :clean do
197 desc "Cleans up editor files and other misc crap"
198 task :crap do
199 files = (Dir["*~"] + Dir["**/*~"]).uniq
1ce3d9b0 »
2008-07-17 Reduced Rakefile to a minimally working version
200
569fccd2 »
2008-07-30 Move vm/Rakefile to rakelib/vm.rake, integrate it into the base rake …
201 rm_f files, :verbose => $verbose unless files.empty?
202 end
203 end
2e737d73 »
2009-03-24 Removed rake spec commands. See rake spec for details.
204
205 desc "Documents why no spec tasks exist"
206 task :spec do
207 puts <<-EOM
208
209 The spec and spec:xxx commands are deprecated (and removed).
ea5bf64d »
2009-06-28 s/psuedo/pseudo/
210 Use bin/mspec directly. MSpec provides 'pseudo-directories',
2e737d73 »
2009-03-24 Removed rake spec commands. See rake spec for details.
211 which are labels that refer to sets of specs to run. Refer
212 to spec/default.mspec, spec/full.mspec and the MSpec docs
213 for full details.
214
215 The following are likely scenarios for running the specs.
216 Unless -t <target> is passed to mspec, bin/rbx is run.
217
218 Run the CI specs that are run with the default 'rake' command
219
220 bin/mspec ci
221
222 Run _all_ the CI spec:
223
224 bin/mspec ci -B full
225
226 Run all the frozen specs:
227
228 bin/mspec
229
230 Run all the frozen Array specs:
231
232 bin/mspec core/array
233 OR
234 bin/mspec spec/frozen/core/array
235
236 Run spec/frozen/core/array/append_spec.rb:
237
238 bin/mspec core/array/append
239 OR
240 bin/mspec spec/frozen/core/array/append_spec.rb
241
242 Run all the compiler specs:
243
244 bin/mspec :compiler
245
246 Run all the [language, core, library, capi] specs:
247
248 bin/mspec :language
249 bin/mspec :core
250 ...
251
252 Run all the spec/ruby specs using the MRI on your path
253 (assuming you have run 'rake rubyspec:update'):
254
255 bin/mspec -tr :ruby
256
257 EOM
258 end
Something went wrong with that request. Please try again.