Skip to content
Newer
Older
100644 259 lines (195 sloc) 6.28 KB
90c05c1 @drbrain Update INSTALL to latest information.
drbrain authored Oct 18, 2007
1 # NOTE! When updating this file, also update INSTALL, if necessary.
a8bdc6b @evanphx Cleanup / reorganize Rakefile
evanphx authored Jan 22, 2008
2 # NOTE! Please keep your tasks grouped together.
90c05c1 @drbrain Update INSTALL to latest information.
drbrain authored Oct 18, 2007
3
1088784 Silence a rake warning
Jacqui Maher and Wilson Bilkovich authored Jan 22, 2009
4 $trace ||= false
69a6063 Enable warnings for rake.
Tilman Sauerbeck authored Nov 29, 2007
5 $VERBOSE = true
bdcf9cb @rue DEV is gone. See `rake build:help`. vm:test always uses debug flags.
rue authored Oct 20, 2008
6 $verbose = Rake.application.options.trace || ARGV.delete("-v")
7
a352624 Start of new LLVM JIT
Evan Phoenix authored Apr 20, 2009
8 if !$verbose and respond_to?(:verbose)
9 verbose(false) if verbose() == :default
10 end
11
243a775 Reworked configuring tasks.
Brian Ford authored Nov 23, 2009
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
be4319e Don't hardcode extension suffixes to 'bundle'.
Tilman Sauerbeck authored Nov 14, 2007
18 $dlext = Config::CONFIG["DLEXT"]
eda2c1b @evanphx compiler is dead, long live compiler1!
evanphx authored Dec 12, 2007
19 $compiler = nil
0941eb2 @drbrain Add tasks to build .rba files
drbrain authored Nov 8, 2007
20
9ebee09 Add mspec and spec rakelib files from master.
Brian Ford authored Aug 20, 2008
21 RUBINIUS_BASE = File.expand_path(File.dirname(__FILE__))
22
d8e1291 @mernen Move "lib" inclusion to load path into Rakefile
mernen authored Oct 23, 2008
23 $: << "lib"
24
2e737d7 Removed rake spec commands. See rake spec for details.
Brian Ford authored Mar 24, 2009
25 task :default => %w[build vm:test] do
17da856 Use 'sh' rather than 'system' so that $? is propagated
Evan Phoenix authored Oct 30, 2009
26 sh "bin/mspec ci -B full --background"
2e737d7 Removed rake spec commands. See rake spec for details.
Brian Ford authored Mar 24, 2009
27 end
8dd2b6b @evanphx r43@vatu: evan | 2006-08-24 16:34:21 -0700
evanphx authored Aug 24, 2006
28
c5b5a97 @drbrain Move run_ruby, compile_ruby to main Rakefile and set RBX_RUNTIME
drbrain authored Aug 28, 2008
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
46b6e4d @drbrain Add precompile task
drbrain authored Oct 6, 2008
40 desc "Run the given ruby file with the vm"
c5b5a97 @drbrain Move run_ruby, compile_ruby to main Rakefile and set RBX_RUNTIME
drbrain authored Aug 28, 2008
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
8e08782 @drbrain run_ruby needs vm/vm
drbrain authored Aug 28, 2008
54 task :run_ruby => %w[kernel:build vm/vm] # HACK argument + dependency is broken
c5b5a97 @drbrain Move run_ruby, compile_ruby to main Rakefile and set RBX_RUNTIME
drbrain authored Aug 28, 2008
55
46b6e4d @drbrain Add precompile task
drbrain authored Oct 6, 2008
56 desc "Compile files with MRI because vm takes forever to do it"
57 task :precompile => %w[extensions] do
562a6b1 Expanded precompile dir list
Ryan Davis authored Oct 11, 2008
58 FileList['{mspec,kernel,lib,spec}/**/*.rb'].each do |rb|
46b6e4d @drbrain Add precompile task
drbrain authored Oct 6, 2008
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
bdcf9cb @rue DEV is gone. See `rake build:help`. vm:test always uses debug flags.
rue authored Oct 20, 2008
72 # See vm.rake for more information
73 desc "Build everything that needs to be built at default level."
56edbca Add rdoc, rake, and rake-compiler and preinstalled gems
Evan Phoenix authored Nov 24, 2009
74 task :build => ["build:normal", "gem_bootstrap"]
1ce3d9b Reduced Rakefile to a minimally working version
Ryan Davis authored Jul 17, 2008
75
90ffc92 @drbrain Rip out irrelevant parts of the Rakefile
drbrain authored Aug 14, 2008
76 desc "Recompile all ruby system files"
77 task :rebuild => %w[clean build]
1ce3d9b Reduced Rakefile to a minimally working version
Ryan Davis authored Jul 17, 2008
78
569fccd @drbrain Move vm/Rakefile to rakelib/vm.rake, integrate it into the base rake …
drbrain authored Jul 30, 2008
79 desc 'Remove rubinius build files'
af222ee @drbrain Restore generation of ruby_config and rubinius_config, add clean rules
drbrain authored Oct 2, 2008
80 task :clean => %w[
81 vm:clean
82 kernel:clean
83 clean:crap
9ed0630 Reworked compiling C extensions.
Brian Ford authored Nov 10, 2009
84 extensions:clean
af222ee @drbrain Restore generation of ruby_config and rubinius_config, add clean rules
drbrain authored Oct 2, 2008
85 ]
1ce3d9b Reduced Rakefile to a minimally working version
Ryan Davis authored Jul 17, 2008
86
569fccd @drbrain Move vm/Rakefile to rakelib/vm.rake, integrate it into the base rake …
drbrain authored Jul 30, 2008
87 desc 'Remove rubinius build files and external library build files'
af222ee @drbrain Restore generation of ruby_config and rubinius_config, add clean rules
drbrain authored Oct 2, 2008
88 task :distclean => %w[
89 clean
90 vm:distclean
91 ]
1ce3d9b Reduced Rakefile to a minimally working version
Ryan Davis authored Jul 17, 2008
92
56edbca Add rdoc, rake, and rake-compiler and preinstalled gems
Evan Phoenix authored Nov 25, 2009
93 desc 'Move the preinstalled gem setup into place'
94 task :gem_bootstrap do
95 unless File.directory?("gems/rubinius")
96 sh "mkdir gems"
3bb6ecd Keep command stubs for preinstall gems
Evan Phoenix authored Nov 24, 2009
97 sh "cp -r preinstalled-gems/* gems/"
56edbca Add rdoc, rake, and rake-compiler and preinstalled gems
Evan Phoenix authored Nov 25, 2009
98 end
99 end
100
0e1df2f Added rake install and rake uninstall tasks.
Brian Ford authored Nov 28, 2008
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
b428a87 Fixed rake install. Issues on your platform?--File a ticket.
Brian Ford authored Sep 28, 2009
109 sh "rake -q clean"
0e1df2f Added rake install and rake uninstall tasks.
Brian Ford authored Nov 28, 2008
110 end
111
112 desc "Install Rubinius"
b428a87 Fixed rake install. Issues on your platform?--File a ticket.
Brian Ford authored Sep 29, 2009
113 task :install => %w[
0e1df2f Added rake install and rake uninstall tasks.
Brian Ford authored Nov 28, 2008
114 clean
115 install:build
116 install:files
117 ] do
b428a87 Fixed rake install. Issues on your platform?--File a ticket.
Brian Ford authored Sep 29, 2009
118 sh "rake -q clean"
0e1df2f Added rake install and rake uninstall tasks.
Brian Ford authored Nov 28, 2008
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
cc4a888 Really fix (un)install tasks.
Brian Ford authored Nov 28, 2008
128 ENV['RBX_PREFIX'] = ENV['PREFIX'] || "/usr/local"
0e1df2f Added rake install and rake uninstall tasks.
Brian Ford authored Nov 28, 2008
129 ENV['RBX_RUNTIME'] = File.join(Dir.pwd, 'runtime')
b428a87 Fixed rake install. Issues on your platform?--File a ticket.
Brian Ford authored Sep 29, 2009
130 sh "rake -q build"
0e1df2f Added rake install and rake uninstall tasks.
Brian Ford authored Nov 28, 2008
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
b428a87 Fixed rake install. Issues on your platform?--File a ticket.
Brian Ford authored Sep 29, 2009
144 capi_header_files = Rake::FileList.new "vm/capi/*.h"
145 install_files capi_header_files, RBX_EXT_PATH
0e1df2f Added rake install and rake uninstall tasks.
Brian Ford authored Nov 28, 2008
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}',
05763b0 Fixed rake install.
Brian Ford authored Feb 10, 2009
154 'runtime/**/load_order.txt')
0e1df2f Added rake install and rake uninstall tasks.
Brian Ford authored Nov 28, 2008
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|
b428a87 Fixed rake install. Issues on your platform?--File a ticket.
Brian Ford authored Sep 29, 2009
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
0e1df2f Added rake install and rake uninstall tasks.
Brian Ford authored Nov 28, 2008
168 end
169
170 install 'vm/vm', install_bin, :mode => 0755, :verbose => true
171 end
172 end
173
5c51236 @seydar added task :compare to the Rakefile on cpp branch
seydar authored Oct 22, 2008
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
0e1df2f Added rake install and rake uninstall tasks.
Brian Ford authored Nov 28, 2008
182
5c51236 @seydar added task :compare to the Rakefile on cpp branch
seydar authored Oct 22, 2008
183 mri_compile file, file + 'c.mri'
184 rbx_compile file
0e1df2f Added rake install and rake uninstall tasks.
Brian Ford authored Nov 28, 2008
185
5c51236 @seydar added task :compare to the Rakefile on cpp branch
seydar authored Oct 22, 2008
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
0e1df2f Added rake install and rake uninstall tasks.
Brian Ford authored Nov 28, 2008
193
5c51236 @seydar added task :compare to the Rakefile on cpp branch
seydar authored Oct 22, 2008
194 end
195
569fccd @drbrain Move vm/Rakefile to rakelib/vm.rake, integrate it into the base rake …
drbrain authored Jul 30, 2008
196 namespace :clean do
197 desc "Cleans up editor files and other misc crap"
198 task :crap do
199 files = (Dir["*~"] + Dir["**/*~"]).uniq
1ce3d9b Reduced Rakefile to a minimally working version
Ryan Davis authored Jul 17, 2008
200
569fccd @drbrain Move vm/Rakefile to rakelib/vm.rake, integrate it into the base rake …
drbrain authored Jul 30, 2008
201 rm_f files, :verbose => $verbose unless files.empty?
202 end
203 end
2e737d7 Removed rake spec commands. See rake spec for details.
Brian Ford authored Mar 24, 2009
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).
ea5bf64 @mernen s/psuedo/pseudo/
mernen authored Jun 28, 2009
210 Use bin/mspec directly. MSpec provides 'pseudo-directories',
2e737d7 Removed rake spec commands. See rake spec for details.
Brian Ford authored Mar 24, 2009
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.