Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 183 lines (138 sloc) 4.816 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
af5cae6 @brixen Refuse to configure, build if RUBYLIB is set.
brixen authored
4 if ENV["RUBYLIB"]
5 STDERR.puts "ERROR: Please unset RUBYLIB to build Rubinius"
6 exit 1
7 end
8
1088784 Silence a rake warning
Jacqui Maher and Wilson Bilkovich authored
9 $trace ||= false
69a6063 Enable warnings for rake.
Tilman Sauerbeck authored
10 $VERBOSE = true
bdcf9cb @rue DEV is gone. See `rake build:help`. vm:test always uses debug flags.
rue authored
11 $verbose = Rake.application.options.trace || ARGV.delete("-v")
12
a352624 Start of new LLVM JIT
Evan Phoenix authored
13 if !$verbose and respond_to?(:verbose)
14 verbose(false) if verbose() == :default
15 end
16
9465976 @brixen Generalize building with MRI 1.8/1.9 or rbx.
brixen authored
17 $:.unshift File.expand_path("../", __FILE__)
18
a632b48 @brixen Added new rake install tasks.
brixen authored
19 config_rb = File.expand_path "../config.rb", __FILE__
20 config_h = File.expand_path "../vm/gen/config.h", __FILE__
21
22 unless File.exists?(config_rb) and File.exists?(config_h)
243a775 @brixen Reworked configuring tasks.
brixen authored
23 STDERR.puts "Please run ./configure first"
24 exit 1
25 end
26
a632b48 @brixen Added new rake install tasks.
brixen authored
27 require config_rb
28 BUILD_CONFIG = Rubinius::BUILD_CONFIG
0941eb2 @drbrain Add tasks to build .rba files
drbrain authored
29
371feef @brixen Better install UX and README instructions. Closes #511.
brixen authored
30 unless BUILD_CONFIG[:config_version] == 20
e846db9 @brixen Ensure Rakefile checks configure version before anything. Closes #385.
brixen authored
31 STDERR.puts "Your configuration is outdated, please run ./configure first"
9465976 @brixen Generalize building with MRI 1.8/1.9 or rbx.
brixen authored
32 exit 1
33 end
34
e846db9 @brixen Ensure Rakefile checks configure version before anything. Closes #385.
brixen authored
35 # Yes, this is duplicated from the configure script for now.
36 unless BUILD_CONFIG[:which_ruby] == :ruby or BUILD_CONFIG[:which_ruby] == :rbx
37 STDERR.puts "Sorry, building Rubinius requires MRI or Rubinius"
84e1594 @brixen Added config version to enable detecting stale configuration.
brixen authored
38 exit 1
39 end
40
a5aff42 @dbussink Verify that the ruby to build with is the one it was configured with
dbussink authored
41 bin = RbConfig::CONFIG["RUBY_INSTALL_NAME"] || RbConfig::CONFIG["ruby_install_name"]
42 bin << (RbConfig::CONFIG['EXEEXT'] || RbConfig::CONFIG['exeext'] || '')
43 build_ruby = File.join(RbConfig::CONFIG['bindir'], bin)
44
45 unless BUILD_CONFIG[:build_ruby] == build_ruby
46 STDERR.puts "Sorry, but you need to build with the same Ruby version it was configured with"
47 STDERR.puts "Please run ./configure again"
48 exit 1
49 end
50
6b363a8 @brixen Propagate --cc configure setting to CC, CXX env vars. Closes #520.
brixen authored
51 # Set the build compiler to the configured compiler unless
52 # the compiler is set via CC environment variable.
53 ENV['CC'] = BUILD_CONFIG[:compiler] unless ENV['CC']
54 ENV['CXX'] = BUILD_CONFIG[:compiler] unless ENV['CXX']
55
bd6aef7 @dbussink Use RbConfig instead of Config
dbussink authored
56 $dlext = RbConfig::CONFIG["DLEXT"]
9ebee09 @brixen Add mspec and spec rakelib files from master.
brixen authored
57
2e737d7 @brixen Removed rake spec commands. See rake spec for details.
brixen authored
58 task :default => %w[build vm:test] do
0c1fb8e @brixen Make specs run from rake regardless of install config.
brixen authored
59 unless File.directory? BUILD_CONFIG[:runtime]
60 # Setting these enables the specs to run when rbx has been configured
61 # to be installed, but rake install has not been run yet.
62 ENV["RBX_RUNTIME"] = File.expand_path "../runtime", __FILE__
63 ENV["RBX_LIB"] = File.expand_path "../lib", __FILE__
64 ENV["CFLAGS"] = "-Ivm/capi"
65 end
66
3015b80 Add and use --agent to mspec
Evan Phoenix authored
67 sh "bin/mspec ci --background --agent"
2e737d7 @brixen Removed rake spec commands. See rake spec for details.
brixen authored
68 end
8dd2b6b @evanphx r43@vatu: evan | 2006-08-24 16:34:21 -0700
evanphx authored
69
bdcf9cb @rue DEV is gone. See `rake build:help`. vm:test always uses debug flags.
rue authored
70 # See vm.rake for more information
71 desc "Build everything that needs to be built at default level."
56edbca Add rdoc, rake, and rake-compiler and preinstalled gems
Evan Phoenix authored
72 task :build => ["build:normal", "gem_bootstrap"]
1ce3d9b Reduced Rakefile to a minimally working version
Ryan Davis authored
73
90ffc92 @drbrain Rip out irrelevant parts of the Rakefile
drbrain authored
74 desc "Recompile all ruby system files"
75 task :rebuild => %w[clean build]
1ce3d9b Reduced Rakefile to a minimally working version
Ryan Davis authored
76
a8390a9 Add ci rake task
Evan Phoenix authored
77 desc "Use to run Rubinius in CI"
78 task :ci do
79 unless system("rake -q")
80 puts "<< ERROR IN CI, CLEANING AND RERUNNING >>"
81 system "rake -q clean"
82 system "find . -name *.rbc -delete"
83 sh "rake -q"
84 end
85 end
86
569fccd @drbrain Move vm/Rakefile to rakelib/vm.rake, integrate it into the base rake …
drbrain authored
87 desc 'Remove rubinius build files'
af222ee @drbrain Restore generation of ruby_config and rubinius_config, add clean rules
drbrain authored
88 task :clean => %w[
89 vm:clean
90 kernel:clean
91 clean:crap
9ed0630 @brixen Reworked compiling C extensions.
brixen authored
92 extensions:clean
af222ee @drbrain Restore generation of ruby_config and rubinius_config, add clean rules
drbrain authored
93 ]
1ce3d9b Reduced Rakefile to a minimally working version
Ryan Davis authored
94
569fccd @drbrain Move vm/Rakefile to rakelib/vm.rake, integrate it into the base rake …
drbrain authored
95 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
96 task :distclean => %w[
97 clean
98 vm:distclean
99 ]
1ce3d9b Reduced Rakefile to a minimally working version
Ryan Davis authored
100
569fccd @drbrain Move vm/Rakefile to rakelib/vm.rake, integrate it into the base rake …
drbrain authored
101 namespace :clean do
102 desc "Cleans up editor files and other misc crap"
103 task :crap do
104 files = (Dir["*~"] + Dir["**/*~"]).uniq
1ce3d9b Reduced Rakefile to a minimally working version
Ryan Davis authored
105
569fccd @drbrain Move vm/Rakefile to rakelib/vm.rake, integrate it into the base rake …
drbrain authored
106 rm_f files, :verbose => $verbose unless files.empty?
107 end
108 end
2e737d7 @brixen Removed rake spec commands. See rake spec for details.
brixen authored
109
a632b48 @brixen Added new rake install tasks.
brixen authored
110 desc 'Move the preinstalled gem setup into place'
111 task :gem_bootstrap do
112 unless File.directory?("gems/rubinius")
264af55 Fix preinstalled gems directory layout (version proof)
Evan Phoenix authored
113 sh "mkdir -p gems/rubinius"
114 sh "cp -r preinstalled-gems/bin gems/bin"
115 sh "cp -r preinstalled-gems/data gems/rubinius/preinstalled"
a632b48 @brixen Added new rake install tasks.
brixen authored
116 end
117 end
118
df791c5 @brixen Enable running docs site with bootstrap Ruby using 'rake docs'.
brixen authored
119 desc "Run the Rubinius documentation website"
120 task :docs do
121 require 'kernel/delta/options'
122 require 'rbconfig'
123 require 'webrick'
124 require 'lib/rubinius/documentation'
125
126 Rubinius::Documentation.main
127 end
128
2e737d7 @brixen Removed rake spec commands. See rake spec for details.
brixen authored
129 desc "Documents why no spec tasks exist"
130 task :spec do
131 puts <<-EOM
132
133 The spec and spec:xxx commands are deprecated (and removed).
ea5bf64 @mernen s/psuedo/pseudo/
mernen authored
134 Use bin/mspec directly. MSpec provides 'pseudo-directories',
2e737d7 @brixen Removed rake spec commands. See rake spec for details.
brixen authored
135 which are labels that refer to sets of specs to run. Refer
9239452 @brixen Updated rake spec doc.
brixen authored
136 to spec/default.mspec and the MSpec docs for full details.
2e737d7 @brixen Removed rake spec commands. See rake spec for details.
brixen authored
137
138 The following are likely scenarios for running the specs.
139 Unless -t <target> is passed to mspec, bin/rbx is run.
140
141 Run the CI specs that are run with the default 'rake' command
142
143 bin/mspec ci
144
9239452 @brixen Updated rake spec doc.
brixen authored
145 Run all the RubySpec specs but not Rubinius-specific ones:
2e737d7 @brixen Removed rake spec commands. See rake spec for details.
brixen authored
146
147 bin/mspec
148
9239452 @brixen Updated rake spec doc.
brixen authored
149 Run all the RubySpec Array specs:
2e737d7 @brixen Removed rake spec commands. See rake spec for details.
brixen authored
150
151 bin/mspec core/array
152 OR
9239452 @brixen Updated rake spec doc.
brixen authored
153 bin/mspec spec/ruby/core/array
2e737d7 @brixen Removed rake spec commands. See rake spec for details.
brixen authored
154
9239452 @brixen Updated rake spec doc.
brixen authored
155 Run spec/ruby/core/array/append_spec.rb:
2e737d7 @brixen Removed rake spec commands. See rake spec for details.
brixen authored
156
157 bin/mspec core/array/append
158 OR
9239452 @brixen Updated rake spec doc.
brixen authored
159 bin/mspec spec/ruby/core/array/append_spec.rb
2e737d7 @brixen Removed rake spec commands. See rake spec for details.
brixen authored
160
161 Run all the compiler specs:
162
163 bin/mspec :compiler
164
165 Run all the [language, core, library, capi] specs:
166
167 bin/mspec :language
168 bin/mspec :core
169 ...
170
9239452 @brixen Updated rake spec doc.
brixen authored
171 Run all the spec/ruby specs using the 'ruby' executable on your path
2e737d7 @brixen Removed rake spec commands. See rake spec for details.
brixen authored
172
173 bin/mspec -tr :ruby
174
175 EOM
176 end
580e56e @rue Add task :todos to do a simple grep for todo marks in kernel/.
rue authored
177
178 desc "Print list of items marked to-do in kernel/ (@todo|TODO)"
179 task :todos do
180 sh "grep", "-Rn", "@todo", "kernel"
181 sh "grep", "-Rn", "TODO", "kernel"
182 end
Something went wrong with that request. Please try again.