Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 313 lines (243 sloc) 8.104 kB
90c05c1 @drbrain Update INSTALL to latest information.
drbrain authored
1 # NOTE! When updating this file, also update INSTALL, if necessary.
a8bdc6b @evanphx Cleanup / reorganize Rakefile
evanphx authored
2 # NOTE! Please keep your tasks grouped together.
90c05c1 @drbrain Update INSTALL to latest information.
drbrain authored
3
69a6063 Enable warnings for rake.
Tilman Sauerbeck authored
4 $VERBOSE = true
0941eb2 @drbrain Add tasks to build .rba files
drbrain authored
5 $verbose = Rake.application.options.trace
be4319e Don't hardcode extension suffixes to 'bundle'.
Tilman Sauerbeck authored
6 $dlext = Config::CONFIG["DLEXT"]
eda2c1b @evanphx compiler is dead, long live compiler1!
evanphx authored
7 $compiler = nil
0941eb2 @drbrain Add tasks to build .rba files
drbrain authored
8
da5f9e6 @brixen Added load-order dependency generation to rake build:(core|platform) …
brixen authored
9 require 'tsort'
a8bdc6b @evanphx Cleanup / reorganize Rakefile
evanphx authored
10 require 'rakelib/rubinius'
5974890 Added a FFI::Struct layout generator based on gcc's offsetof macro.
Tilman Sauerbeck authored
11 require 'rakelib/struct_generator'
37189b7 @retnuh Properly determine some of File::Constants from platform.conf
retnuh authored
12 require 'rakelib/const_generator'
da5f9e6 @brixen Added load-order dependency generation to rake build:(core|platform) …
brixen authored
13
93c6297 @drbrain Add install task, remove tasks task, make build task default, make ob…
drbrain authored
14 task :default => :build
8dd2b6b @evanphx r43@vatu: evan | 2006-08-24 16:34:21 -0700
evanphx authored
15
a8bdc6b @evanphx Cleanup / reorganize Rakefile
evanphx authored
16 # BUILD TASKS
17
18 desc "Build everything that needs to be built"
19 task :build => 'build:all'
20
21 task :stable_compiler do
22 if ENV['USE_CURRENT']
23 puts "Use current versions, not stable."
24 else
25 ENV['RBX_BOOTSTRAP'] = "runtime/stable/bootstrap.rba"
26 ENV['RBX_CORE'] = "runtime/stable/core.rba"
27 ENV['RBX_LOADER'] = "runtime/stable/loader.rbc"
28 ENV['RBX_PLATFORM'] = "runtime/stable/platform.rba"
29 end
30 end
31
32 rule ".rbc" => %w[.rb] do |t|
33 compile t.source, t.name
34 end
35
36 files = FileList['kernel/core/*.rb']
37
38 unless files.include?("kernel/core/dir.rb")
39 files.add("kernel/core/dir.rb")
40 end
41
42 Core = CodeGroup.new(files, 'runtime/core', 'core')
43
44 Bootstrap = CodeGroup.new 'kernel/bootstrap/*.rb', 'runtime/bootstrap',
45 'bootstrap'
46 PlatformFiles = CodeGroup.new 'kernel/platform/*.rb', 'runtime/platform', 'platform'
47
48 file 'runtime/loader.rbc' => 'kernel/loader.rb' do
49 compile 'kernel/loader.rb', 'runtime/loader.rbc'
50 end
51
52 file 'runtime/stable/loader.rbc' => 'runtime/loader.rbc' do
53 cp 'runtime/loader.rbc', 'runtime/stable', :verbose => $verbose
54 end
55
56 file 'runtime/stable/compiler.rba' => 'build:compiler' do
57 sh "cd lib; zip -r ../runtime/stable/compiler.rba compiler -x \\*.rb"
58 end
59
60 Rake::StructGeneratorTask.new do |t|
61 t.dest = "lib/etc.rb"
62 end
63
64 Rake::StructGeneratorTask.new do |t|
65 t.dest = 'lib/zlib.rb'
66 end
67
68 AllPreCompiled = Core.output + Bootstrap.output + PlatformFiles.output
69 AllPreCompiled << "runtime/loader.rbc"
70
970dca2 @wilson Rakefile cleanup. Removed some tasks, renamed others. rake -T for det…
wilson authored
71 namespace :build do
27d0364 @drbrain Build extensions with build:all
drbrain authored
72
0941eb2 @drbrain Add tasks to build .rba files
drbrain authored
73 task :all => %w[
74 build:shotgun
1c9328e @evanphx Fix the kernel to not contain any system info
evanphx authored
75 build:platform
0941eb2 @drbrain Add tasks to build .rba files
drbrain authored
76 build:rbc
85e9849 @evanphx Move compiler2 => compiler, and Compiler2 => Compiler
evanphx authored
77 compiler
7e925ea Implemented Etc.
Tilman Sauerbeck authored
78 lib/etc.rb
2ef13f9 @drbrain Generate lib/rbconfig.rb
drbrain authored
79 lib/rbconfig.rb
138d1ef @drbrain Move extension building into its own namespace.
drbrain authored
80 extensions
0941eb2 @drbrain Add tasks to build .rba files
drbrain authored
81 ]
27d0364 @drbrain Build extensions with build:all
drbrain authored
82
3c0b50e @agardiner Added doc:vm tasks to main Rakefile
agardiner authored
83 # This nobody rule lets use use all the shotgun files as
84 # prereqs. This rule is run for all those prereqs and just
4638b74 @evanphx Vast rework of the Rakefile and build process
evanphx authored
85 # (obviously) does nothing, but it makes rake happy.
27d0364 @drbrain Build extensions with build:all
drbrain authored
86 rule '^shotgun/.+'
87
0941eb2 @drbrain Add tasks to build .rba files
drbrain authored
88 c_source = FileList[
a092725 @drbrain Make LIBVER and VERSION match (now 0.8.x for everything).
drbrain authored
89 "shotgun/config.h",
1566cad @evanphx Fix grammar.y bug for heredocs
evanphx authored
90 "shotgun/lib/*.[chy]",
0941eb2 @drbrain Add tasks to build .rba files
drbrain authored
91 "shotgun/lib/*.rb",
92 "shotgun/lib/subtend/*.[chS]",
93 "shotgun/main.c",
e988e3a @zimbatm Fixed `rake rebuild`
zimbatm authored
94 ].exclude(/auto/, /instruction_names/, /node_types/, /grammar.c/)
27d0364 @drbrain Build extensions with build:all
drbrain authored
95
4638b74 @evanphx Vast rework of the Rakefile and build process
evanphx authored
96 file "shotgun/rubinius.bin" => c_source do
335f63e @drbrain Better runner of the correct make
drbrain authored
97 sh make('vm')
4638b74 @evanphx Vast rework of the Rakefile and build process
evanphx authored
98 end
27d0364 @drbrain Build extensions with build:all
drbrain authored
99
a092725 @drbrain Make LIBVER and VERSION match (now 0.8.x for everything).
drbrain authored
100 file 'shotgun/mkconfig.sh' => 'configure'
101 file 'shotgun/config.mk' => %w[shotgun/config.h shotgun/mkconfig.sh shotgun/vars.mk]
102 file 'shotgun/config.h' => %w[shotgun/mkconfig.sh shotgun/vars.mk] do
dc16b49 @wilson * Near-total rewrite of the Rakefile. Tasks that use rcompile are in …
wilson authored
103 sh "./configure"
104 raise 'Failed to configure Rubinius' unless $?.success?
3751f33 @evanphx * Reworked the Rakefile to build the compiler by detection, like boot…
evanphx authored
105 end
970dca2 @wilson Rakefile cleanup. Removed some tasks, renamed others. rake -T for det…
wilson authored
106
dc16b49 @wilson * Near-total rewrite of the Rakefile. Tasks that use rcompile are in …
wilson authored
107 desc "Compiles shotgun (the C-code VM)"
a092725 @drbrain Make LIBVER and VERSION match (now 0.8.x for everything).
drbrain authored
108 task :shotgun => %w[configure shotgun/rubinius.bin]
27d0364 @drbrain Build extensions with build:all
drbrain authored
109
eda2c1b @evanphx compiler is dead, long live compiler1!
evanphx authored
110 task :setup_rbc => :stable_compiler
93c6297 @drbrain Add install task, remove tasks task, make build task default, make ob…
drbrain authored
111
4638b74 @evanphx Vast rework of the Rakefile and build process
evanphx authored
112 task :rbc => ([:setup_rbc] + AllPreCompiled)
cc28068 Rearranged rake setup a lot, making browsing more intuitive (build se…
Ryan Davis authored
113
85e9849 @evanphx Move compiler2 => compiler, and Compiler2 => Compiler
evanphx authored
114 task :compiler => :stable_compiler do
115 compile_dir "lib/compiler"
3073442 @evanphx Dozens more c2 and spec fixes
evanphx authored
116 end
93c6297 @drbrain Add install task, remove tasks task, make build task default, make ob…
drbrain authored
117
138d1ef @drbrain Move extension building into its own namespace.
drbrain authored
118 desc "Rebuild runtime/stable/*. If you don't know why you're running this, don't."
119 task :stable => %w[
120 build:all
121 runtime/stable/bootstrap.rba
122 runtime/stable/core.rba
85e9849 @evanphx Move compiler2 => compiler, and Compiler2 => Compiler
evanphx authored
123 runtime/stable/compiler.rba
138d1ef @drbrain Move extension building into its own namespace.
drbrain authored
124 runtime/stable/loader.rbc
125 runtime/stable/platform.rba
9e60f59 @drbrain Hook up build:digest_md5 to build:extensions
drbrain authored
126 ]
27d0364 @drbrain Build extensions with build:all
drbrain authored
127
138d1ef @drbrain Move extension building into its own namespace.
drbrain authored
128 desc "Rebuild the .load_order.txt files"
129 task "load_order" do
130 # Note: Steps to rebuild load_order were defined above
27d0364 @drbrain Build extensions with build:all
drbrain authored
131 end
3c0b50e @agardiner Added doc:vm tasks to main Rakefile
agardiner authored
132
138d1ef @drbrain Move extension building into its own namespace.
drbrain authored
133 namespace :vm do
134 task "clean" do
135 sh "cd shotgun/lib; make clean"
136 end
137
138 task "dev" do
139 sh "cd shotgun/lib; make DEV=1"
140 end
141 end
1e485ba @drbrain Add all Socket constants from ruby 1.8
drbrain authored
142
1c9328e @evanphx Fix the kernel to not contain any system info
evanphx authored
143 task :platform => 'runtime/platform.conf'
144 end
138d1ef @drbrain Move extension building into its own namespace.
drbrain authored
145
cc28068 Rearranged rake setup a lot, making browsing more intuitive (build se…
Ryan Davis authored
146 # INSTALL TASKS
f81f44b @wilson Add Process constants to platform.conf generation
wilson authored
147
cc28068 Rearranged rake setup a lot, making browsing more intuitive (build se…
Ryan Davis authored
148 desc "Install rubinius as rbx"
149 task :install => :config_env do
150 sh "cd shotgun; #{make "install"}"
3224285 Get the values of SEEK_* via the ConstGenerator.
Tilman Sauerbeck authored
151
cc28068 Rearranged rake setup a lot, making browsing more intuitive (build se…
Ryan Davis authored
152 mkdir_p ENV['RBAPATH'], :verbose => true
153 mkdir_p ENV['CODEPATH'], :verbose => true
7684615 @evanphx A bunch of fixes found while working on Socket
evanphx authored
154
cc28068 Rearranged rake setup a lot, making browsing more intuitive (build se…
Ryan Davis authored
155 rba_files = Rake::FileList.new('runtime/platform.conf',
156 'runtime/**/*.rb{a,c}',
157 'runtime/**/.load_order.txt')
4a4f8c8 Move fcntl from an external library to a Ruby based one.
Caleb Tennis authored
158
cc28068 Rearranged rake setup a lot, making browsing more intuitive (build se…
Ryan Davis authored
159 install_files rba_files, ENV['RBAPATH']
f81f44b @wilson Add Process constants to platform.conf generation
wilson authored
160
cc28068 Rearranged rake setup a lot, making browsing more intuitive (build se…
Ryan Davis authored
161 lib_files = Rake::FileList.new 'lib/**/*'
b3a6461 @zimbatm kernel/core/signal is no more platform dependent
zimbatm authored
162
cc28068 Rearranged rake setup a lot, making browsing more intuitive (build se…
Ryan Davis authored
163 install_files lib_files, ENV['CODEPATH']
164
165 mkdir_p File.join(ENV['CODEPATH'], 'bin'), :verbose => true
166
167 Rake::FileList.new("#{ENV['CODEPATH']}/**/*.rb").sort.each do |rb_file|
168 sh File.join(ENV['BINPATH'], 'rbx'), 'compile', rb_file, :verbose => true
1c9328e @evanphx Fix the kernel to not contain any system info
evanphx authored
169 end
138d1ef @drbrain Move extension building into its own namespace.
drbrain authored
170 end
171
cc28068 Rearranged rake setup a lot, making browsing more intuitive (build se…
Ryan Davis authored
172 desc "Uninstall rubinius and libraries. Helps with build problems."
173 task :uninstall => :config_env do
174 rm Dir[File.join(ENV['BINPATH'], 'rbx*')]
175 rm_r Dir[File.join(ENV['LIBPATH'], '*rubinius*')]
176 end
177
178 task :config_env => 'shotgun/config.mk' do
179 File.foreach 'shotgun/config.mk' do |line|
180 next unless line =~ /(.*?)=(.*)/
181 ENV[$1] = $2
c32654c @drbrain Convert digest/md5 to an FFI extension
drbrain authored
182 end
cc28068 Rearranged rake setup a lot, making browsing more intuitive (build se…
Ryan Davis authored
183 end
c32654c @drbrain Convert digest/md5 to an FFI extension
drbrain authored
184
cc28068 Rearranged rake setup a lot, making browsing more intuitive (build se…
Ryan Davis authored
185 task :compiledir => :stable_compiler do
186 dir = ENV['DIR']
187 raise "Use DIR= to set which directory" if !dir or dir.empty?
188 compile_dir(dir)
189 end
612bc00 @drbrain Add Digest::RMD160
drbrain authored
190
cc28068 Rearranged rake setup a lot, making browsing more intuitive (build se…
Ryan Davis authored
191 # CLEAN TASKS
612bc00 @drbrain Add Digest::RMD160
drbrain authored
192
cc28068 Rearranged rake setup a lot, making browsing more intuitive (build se…
Ryan Davis authored
193 desc "Recompile all ruby system files"
194 task :rebuild => %w[clean build:all]
1553ac8 @drbrain Restore sha1 building task
drbrain authored
195
cc28068 Rearranged rake setup a lot, making browsing more intuitive (build se…
Ryan Davis authored
196 desc "Alias for clean:all"
197 task :clean => "clean:all"
1553ac8 @drbrain Restore sha1 building task
drbrain authored
198
cc28068 Rearranged rake setup a lot, making browsing more intuitive (build se…
Ryan Davis authored
199 desc "Alias for clean:distclean"
200 task :distclean => "clean:distclean"
1a510a7 @drbrain Implement Digest::SHA2. Includes SHA256, SHA384, SHA512.
drbrain authored
201
cc28068 Rearranged rake setup a lot, making browsing more intuitive (build se…
Ryan Davis authored
202 namespace :clean do
203 desc "Clean everything but third-party libs"
204 task :all => %w[clean:rbc clean:extensions clean:shotgun clean:generated clean:crap]
1a510a7 @drbrain Implement Digest::SHA2. Includes SHA256, SHA384, SHA512.
drbrain authored
205
cc28068 Rearranged rake setup a lot, making browsing more intuitive (build se…
Ryan Davis authored
206 desc "Clean everything including third-party libs"
207 task :distclean => %w[clean:all clean:external]
208
209 desc "Remove all compile system ruby files"
210 task :rbc do
211 files_to_delete = []
212 files_to_delete += Dir["*.rbc"] + Dir["**/*.rbc"]
213 files_to_delete += Dir["**/.load_order.txt"]
214 files_to_delete += ["runtime/platform.conf"]
215 files_to_delete -= ["runtime/stable/loader.rbc"] # never ever delete this
7010073 @evanphx Vastly simplify and fix constant lookup
evanphx authored
216
cc28068 Rearranged rake setup a lot, making browsing more intuitive (build se…
Ryan Davis authored
217 files_to_delete.each do |f|
218 rm_f f, :verbose => $verbose
219 end
7010073 @evanphx Vastly simplify and fix constant lookup
evanphx authored
220 end
cc28068 Rearranged rake setup a lot, making browsing more intuitive (build se…
Ryan Davis authored
221
222 desc "Cleans all compiled extension files (lib/ext)"
223 task :extensions do
224 Dir["lib/ext/**/*#{$dlext}"].each do |f|
225 rm_f f, :verbose => $verbose
226 end
205463d @kevinclark Add RSTRING function replacements
kevinclark authored
227 end
7010073 @evanphx Vastly simplify and fix constant lookup
evanphx authored
228
cc28068 Rearranged rake setup a lot, making browsing more intuitive (build se…
Ryan Davis authored
229 desc "Cleans up VM building site"
230 task :shotgun do
231 sh make('clean')
232 end
2b18de2 @drbrain Add primitive Zlib::GzipWriter
drbrain authored
233
cc28068 Rearranged rake setup a lot, making browsing more intuitive (build se…
Ryan Davis authored
234 desc "Cleans up generated files"
235 task :generated do
236 rm_f Dir["shotgun/lib/grammar.c"], :verbose => $verbose
2b18de2 @drbrain Add primitive Zlib::GzipWriter
drbrain authored
237 end
238
cc28068 Rearranged rake setup a lot, making browsing more intuitive (build se…
Ryan Davis authored
239 desc "Cleans up VM and external libs"
240 task :external do
241 sh "cd shotgun; #{make('distclean')}"
242 end
ca09114 @evanphx Add C readline extension, fix defined?()
evanphx authored
243
cc28068 Rearranged rake setup a lot, making browsing more intuitive (build se…
Ryan Davis authored
244 desc "Cleans up editor files and other misc crap"
245 task :crap do
246 rm_f Dir["*~"] + Dir["**/*~"], :verbose => $verbose
ca09114 @evanphx Add C readline extension, fix defined?()
evanphx authored
247 end
121d2bb @evanphx A little magic for a more bulletproof process. Run rake dev:setup aft…
evanphx authored
248 end
249
cc28068 Rearranged rake setup a lot, making browsing more intuitive (build se…
Ryan Davis authored
250 # SPEC TASKS
251 desc "Run all 'known good' specs (task alias for spec:ci)"
252 task :spec => 'spec:ci'
3c0b50e @agardiner Added doc:vm tasks to main Rakefile
agardiner authored
253
cc28068 Rearranged rake setup a lot, making browsing more intuitive (build se…
Ryan Davis authored
254 namespace :spec do
255 namespace :setup do
256 # Setup for 'Subtend' specs. No need to call this yourself.
257 task :subtend do
258 Dir["spec/subtend/**/Rakefile"].each do |rakefile|
259 sh "rake -f #{rakefile}"
260 end
3c0b50e @agardiner Added doc:vm tasks to main Rakefile
agardiner authored
261 end
262 end
263
cc28068 Rearranged rake setup a lot, making browsing more intuitive (build se…
Ryan Davis authored
264 desc "Run continuous integration examples"
265 task :ci do
266 target = ENV['SPEC_TARGET'] || 'rbx'
267 system %(shotgun/rubinius -e 'puts "rbx build: \#{Rubinius::BUILDREV}"') if target == 'rbx'
268 sh "bin/ci -t #{target}"
269 end
3c0b50e @agardiner Added doc:vm tasks to main Rakefile
agardiner authored
270
cc28068 Rearranged rake setup a lot, making browsing more intuitive (build se…
Ryan Davis authored
271 spec_targets = %w(compiler core language library parser rubinius)
272 # Build a spec:<task_name> for each group of Rubinius specs
273 spec_targets.each do |group|
274 desc "Run #{group} examples"
275 task group do
276 sh "bin/mspec spec/#{group}"
3c0b50e @agardiner Added doc:vm tasks to main Rakefile
agardiner authored
277 end
cc28068 Rearranged rake setup a lot, making browsing more intuitive (build se…
Ryan Davis authored
278 end
3c0b50e @agardiner Added doc:vm tasks to main Rakefile
agardiner authored
279
cc28068 Rearranged rake setup a lot, making browsing more intuitive (build se…
Ryan Davis authored
280 desc "Run subtend (Rubinius C API) examples"
281 task :subtend => "spec:setup:subtend" do
282 sh "bin/mspec spec/rubinius/subtend"
283 end
82207ba @wilson Remove trailing whitespace from Rakefile
wilson authored
284
cc28068 Rearranged rake setup a lot, making browsing more intuitive (build se…
Ryan Davis authored
285 # Specdiffs to make it easier to see what your changes have affected :)
286 desc 'Run specs and produce a diff against current base'
287 task :diff => 'diff:run'
85e9849 @evanphx Move compiler2 => compiler, and Compiler2 => Compiler
evanphx authored
288
cc28068 Rearranged rake setup a lot, making browsing more intuitive (build se…
Ryan Davis authored
289 namespace :diff do
290 desc 'Run specs and produce a diff against current base'
291 task :run do
292 system 'bin/mspec -f ci -o spec/reports/specdiff.txt spec'
293 system 'diff -u spec/reports/base.txt spec/reports/specdiff.txt'
294 system 'rm spec/reports/specdiff.txt'
3c0b50e @agardiner Added doc:vm tasks to main Rakefile
agardiner authored
295 end
82207ba @wilson Remove trailing whitespace from Rakefile
wilson authored
296
cc28068 Rearranged rake setup a lot, making browsing more intuitive (build se…
Ryan Davis authored
297 desc 'Replace the base spec file with a new one'
298 task :replace do
299 system 'bin/mspec -f ci -o spec/reports/base.txt spec'
3c0b50e @agardiner Added doc:vm tasks to main Rakefile
agardiner authored
300 end
301 end
cc28068 Rearranged rake setup a lot, making browsing more intuitive (build se…
Ryan Davis authored
302
303 task :r2r do
304 puts ARGV.inspect
305 end
3c0b50e @agardiner Added doc:vm tasks to main Rakefile
agardiner authored
306 end
307
cc28068 Rearranged rake setup a lot, making browsing more intuitive (build se…
Ryan Davis authored
308 # MISC TASKS
309
310 desc "Build task for CruiseControl"
311 task :ccrb => [:build, 'spec:ci']
312
Something went wrong with that request. Please try again.