Skip to content
Newer
Older
100644 462 lines (433 sloc) 15.8 KB
6d571b4 @alloy Moved guts of the code in Rakefile into seperate files in rakelib.
alloy authored
1 require File.expand_path('../builder', __FILE__)
b8cf6a6 @alloy Added available build options to the output of: $ rake -T
alloy authored
2 require 'rake'
3
4 # We monkey-patch the method that Rake uses to display the tasks so we can add
5 # the build options.
6 module Rake
7 class Application
8 def formatted_macruby_options
9 $builder_options.sort_by { |name, _| name }.map do |name, default|
10 default = default.join(',') if default.is_a?(Array)
ac477e5 @alloy Oops, a bit too much indentation.
alloy authored
11 " #{name.ljust(30)} \"#{default}\""
b8cf6a6 @alloy Added available build options to the output of: $ rake -T
alloy authored
12 end.join("\n")
13 end
14
15 alias_method :display_tasks_and_comments_without_macruby_options, :display_tasks_and_comments
16
17 def display_tasks_and_comments
18 display_tasks_and_comments_without_macruby_options
19 puts %{
20 To change any of the default build options, use the rake build task
21 of choice with any of these following option-value pairs:
22
27ca189 @alloy Removed all specfic specs that are to be run from the rake tasks and …
alloy authored
23 Usage: $ rake [task] [option=value, ...]
b8cf6a6 @alloy Added available build options to the output of: $ rake -T
alloy authored
24
25 #{'Option:'.ljust(30)} Default value:
26
27 #{formatted_macruby_options}
28
29 Example:
30
31 $ rake all archs="i386,ppc" framework_instdir="~/Library/Frameworks"
32
33 }
34 end
35 end
36 end
6d571b4 @alloy Moved guts of the code in Rakefile into seperate files in rakelib.
alloy authored
37
38 desc "Build known objects"
39 task :objects => [:config_h, :dtrace_h, :revision_h] do
40 sh "/usr/bin/ruby tool/compile_prelude.rb prelude.rb miniprelude.c.new"
41 if !File.exist?('miniprelude.c') or File.read('miniprelude.c') != File.read('miniprelude.c.new')
42 mv('miniprelude.c.new', 'miniprelude.c')
43 else
44 rm('miniprelude.c.new')
45 end
46 if !File.exist?('prelude.c')
47 touch('prelude.c') # create empty file nevertheless
48 end
49 if !File.exist?('parse.c') or File.mtime('parse.y') > File.mtime('parse.c')
50 sh("/usr/bin/bison -o y.tab.c parse.y")
51 sh("/usr/bin/sed -f ./tool/ytab.sed -e \"/^#/s!y\.tab\.c!parse.c!\" y.tab.c > parse.c.new")
52 if !File.exist?('parse.c') or File.read('parse.c.new') != File.read('parse.c')
53 mv('parse.c.new', 'parse.c')
54 rm_f('parse.o')
55 else
56 rm('parse.c.new')
57 end
58 end
59 if !File.exist?('lex.c') or File.read('lex.c') != File.read('lex.c.blt')
60 cp('lex.c.blt', 'lex.c')
61 end
62 if !File.exist?('node_name.inc') or File.mtime('include/ruby/node.h') > File.mtime('node_name.inc')
63 sh("/usr/bin/ruby -n tool/node_name.rb include/ruby/node.h > node_name.inc")
64 end
65 $builder.build
66 end
67
68 desc "Create miniruby"
69 task :miniruby => :objects do
70 $builder.link_executable('miniruby', OBJS - ['prelude'])
71 end
72
73 desc "Create config file"
74 task :rbconfig => :miniruby do
75 rbconfig = <<EOS
76 # This file was created when MacRuby was built. Any changes made to this file
77 # will be lost the next time MacRuby is built.
78
79 module RbConfig
80 RUBY_VERSION == "#{NEW_RUBY_VERSION}" or
81 raise "ruby lib version (#{NEW_RUBY_VERSION}) doesn't match executable version (\#{RUBY_VERSION})"
82
83 TOPDIR = File.dirname(__FILE__).chomp!("/lib/ruby/#{NEW_RUBY_VERSION}/#{NEW_RUBY_PLATFORM}")
84 DESTDIR = '' unless defined? DESTDIR
85 CONFIG = {}
86 CONFIG["DESTDIR"] = DESTDIR
87 CONFIG["INSTALL"] = '/usr/bin/install -c'
88 CONFIG["prefix"] = (TOPDIR || DESTDIR + "#{FRAMEWORK_USR}")
89 CONFIG["EXEEXT"] = ""
90 CONFIG["ruby_install_name"] = "#{RUBY_INSTALL_NAME}"
91 CONFIG["RUBY_INSTALL_NAME"] = "#{RUBY_INSTALL_NAME}"
92 CONFIG["RUBY_SO_NAME"] = "#{RUBY_SO_NAME}"
93 CONFIG["SHELL"] = "/bin/sh"
94 CONFIG["PATH_SEPARATOR"] = ":"
95 CONFIG["PACKAGE_NAME"] = ""
96 CONFIG["PACKAGE_TARNAME"] = ""
97 CONFIG["PACKAGE_VERSION"] = ""
98 CONFIG["PACKAGE_STRING"] = ""
99 CONFIG["PACKAGE_BUGREPORT"] = ""
100 CONFIG["exec_prefix"] = "$(prefix)"
101 CONFIG["bindir"] = "$(exec_prefix)/bin"
102 CONFIG["sbindir"] = "$(exec_prefix)/sbin"
103 CONFIG["libexecdir"] = "$(exec_prefix)/libexec"
104 CONFIG["datarootdir"] = "$(prefix)/share"
105 CONFIG["datadir"] = "$(datarootdir)"
106 CONFIG["sysconfdir"] = "$(prefix)/etc"
107 CONFIG["sharedstatedir"] = "$(prefix)/com"
108 CONFIG["localstatedir"] = "$(prefix)/var"
109 CONFIG["includedir"] = "$(prefix)/include"
110 CONFIG["oldincludedir"] = "/usr/include"
111 CONFIG["docdir"] = "$(datarootdir)/doc/$(PACKAGE)"
112 CONFIG["infodir"] = "$(datarootdir)/info"
113 CONFIG["htmldir"] = "$(docdir)"
114 CONFIG["dvidir"] = "$(docdir)"
115 CONFIG["pdfdir"] = "$(docdir)"
116 CONFIG["psdir"] = "$(docdir)"
117 CONFIG["libdir"] = "$(exec_prefix)/lib"
118 CONFIG["localedir"] = "$(datarootdir)/locale"
119 CONFIG["mandir"] = "$(datarootdir)/man"
120 CONFIG["DEFS"] = ""
121 CONFIG["ECHO_C"] = "\\\\\\\\c"
122 CONFIG["ECHO_N"] = ""
123 CONFIG["ECHO_T"] = ""
124 CONFIG["LIBS"] = ""
125 CONFIG["build_alias"] = ""
126 CONFIG["host_alias"] = ""
127 CONFIG["target_alias"] = ""
128 CONFIG["BASERUBY"] = "ruby"
129 CONFIG["MAJOR"], CONFIG["MINOR"], CONFIG["TEENY"] = [#{NEW_RUBY_VERSION.scan(/\d+/).map { |x| "\"" + x + "\"" }.join(', ')}]
130 CONFIG["build"] = "i686-apple-darwin9.0.0"
131 CONFIG["build_cpu"] = "i686"
132 CONFIG["build_vendor"] = "apple"
133 CONFIG["build_os"] = "darwin9.0.0"
134 CONFIG["host"] = "i686-apple-darwin9.0.0"
135 CONFIG["host_cpu"] = "i686"
136 CONFIG["host_vendor"] = "apple"
137 CONFIG["host_os"] = "darwin9.0.0"
138 CONFIG["target"] = "i686-apple-darwin9.0.0"
139 CONFIG["target_cpu"] = "i686"
140 CONFIG["target_vendor"] = "apple"
141 CONFIG["target_os"] = "darwin9.0"
0bc95cf fixed rbconfig.rb to use absolute paths + fixed TRY_LINK to use g++, …
Laurent Sansonetti authored
142 CONFIG["CC"] = "/usr/bin/gcc"
6d571b4 @alloy Moved guts of the code in Rakefile into seperate files in rakelib.
alloy authored
143 CONFIG["CFLAGS"] = "-fno-common -pipe $(cflags)"
144 CONFIG["LDFLAGS"] = ""
145 CONFIG["CPPFLAGS"] = "$(cppflags)"
146 CONFIG["OBJEXT"] = "o"
0bc95cf fixed rbconfig.rb to use absolute paths + fixed TRY_LINK to use g++, …
Laurent Sansonetti authored
147 CONFIG["CXX"] = "/usr/bin/g++"
6d571b4 @alloy Moved guts of the code in Rakefile into seperate files in rakelib.
alloy authored
148 CONFIG["CXXFLAGS"] = ""
0bc95cf fixed rbconfig.rb to use absolute paths + fixed TRY_LINK to use g++, …
Laurent Sansonetti authored
149 CONFIG["CPP"] = "/usr/bin/gcc -E"
6d571b4 @alloy Moved guts of the code in Rakefile into seperate files in rakelib.
alloy authored
150 CONFIG["GREP"] = "/usr/bin/grep"
151 CONFIG["EGREP"] = "/usr/bin/grep -E"
152 CONFIG["GNU_LD"] = "no"
153 CONFIG["CPPOUTFILE"] = "-o conftest.i"
154 CONFIG["OUTFLAG"] = "-o "
155 CONFIG["COUTFLAG"] = "-o "
156 CONFIG["RANLIB"] = "ranlib"
157 CONFIG["AR"] = "ar"
158 CONFIG["AS"] = "as"
159 CONFIG["ASFLAGS"] = ""
160 CONFIG["NM"] = ""
161 CONFIG["WINDRES"] = ""
162 CONFIG["DLLWRAP"] = ""
163 CONFIG["OBJDUMP"] = ""
164 CONFIG["LN_S"] = "ln -s"
165 CONFIG["SET_MAKE"] = ""
166 CONFIG["INSTALL_PROGRAM"] = "$(INSTALL)"
167 CONFIG["INSTALL_SCRIPT"] = "$(INSTALL)"
168 CONFIG["INSTALL_DATA"] = "$(INSTALL) -m 644"
169 CONFIG["RM"] = "rm -f"
170 CONFIG["CP"] = "cp"
171 CONFIG["MAKEDIRS"] = "mkdir -p"
172 CONFIG["ALLOCA"] = ""
173 CONFIG["DLDFLAGS"] = ""
174 CONFIG["ARCH_FLAG"] = "#{ARCHFLAGS}"
175 CONFIG["STATIC"] = ""
176 CONFIG["CCDLFLAGS"] = "-fno-common"
177 CONFIG["LDSHARED"] = "$(CC) -dynamic -bundle -undefined suppress -flat_namespace #{ARCHFLAGS}"
178 CONFIG["LDSHAREDXX"] = "$(CXX) -dynamic -bundle -undefined suppress -flat_namespace"
179 CONFIG["DLEXT"] = "bundle"
180 CONFIG["DLEXT2"] = ""
181 CONFIG["LIBEXT"] = "a"
182 CONFIG["LINK_SO"] = ""
183 CONFIG["LIBPATHFLAG"] = " -L%s"
184 CONFIG["RPATHFLAG"] = ""
185 CONFIG["LIBPATHENV"] = "DYLD_LIBRARY_PATH"
030c32b fixed rbconfig.rb to never mention libmacruby-static, reverted TRY_LINK
Laurent Sansonetti authored
186 CONFIG["TRY_LINK"] = ""
6d571b4 @alloy Moved guts of the code in Rakefile into seperate files in rakelib.
alloy authored
187 CONFIG["STRIP"] = "strip -A -n"
188 CONFIG["EXTSTATIC"] = ""
189 CONFIG["setup"] = "Setup"
190 CONFIG["PREP"] = "miniruby$(EXEEXT)"
191 CONFIG["EXTOUT"] = ".ext"
192 CONFIG["ARCHFILE"] = ""
193 CONFIG["RDOCTARGET"] = "install-doc"
194 CONFIG["cppflags"] = ""
195 CONFIG["cflags"] = "$(optflags) $(debugflags) $(warnflags)"
def059d building the ripper extension (but not installing it yet)
Laurent Sansonetti authored
196 CONFIG["optflags"] = "-O3"
6d571b4 @alloy Moved guts of the code in Rakefile into seperate files in rakelib.
alloy authored
197 CONFIG["debugflags"] = "-g"
198 CONFIG["warnflags"] = "-Wall -Wno-parentheses"
0bc95cf fixed rbconfig.rb to use absolute paths + fixed TRY_LINK to use g++, …
Laurent Sansonetti authored
199 CONFIG["LIBRUBY_LDSHARED"] = "/usr/bin/gcc -dynamiclib -undefined suppress -flat_namespace"
6d571b4 @alloy Moved guts of the code in Rakefile into seperate files in rakelib.
alloy authored
200 CONFIG["LIBRUBY_DLDFLAGS"] = "-install_name $(libdir)/lib$(RUBY_SO_NAME).dylib -current_version $(MAJOR).$(MINOR).$(TEENY) -compatibility_version $(MAJOR).$(MINOR)"
201 CONFIG["rubyw_install_name"] = ""
202 CONFIG["RUBYW_INSTALL_NAME"] = ""
203 CONFIG["LIBRUBY_A"] = "lib$(RUBY_SO_NAME)-static.a"
204 CONFIG["LIBRUBY_SO"] = "lib$(RUBY_SO_NAME).$(MAJOR).$(MINOR).$(TEENY).dylib"
205 CONFIG["LIBRUBY_ALIASES"] = "lib$(RUBY_SO_NAME).$(MAJOR).$(MINOR).dylib lib$(RUBY_SO_NAME).dylib"
206 CONFIG["LIBRUBY"] = "$(LIBRUBY_SO)"
207 CONFIG["LIBRUBYARG"] = "$(LIBRUBYARG_SHARED)"
030c32b fixed rbconfig.rb to never mention libmacruby-static, reverted TRY_LINK
Laurent Sansonetti authored
208 #CONFIG["LIBRUBYARG_STATIC"] = "-l$(RUBY_SO_NAME)-static #{LDFLAGS}"
209 CONFIG["LIBRUBYARG_SHARED"] = CONFIG["LIBRUBYARG_STATIC"] = "-l$(RUBY_SO_NAME)"
6d571b4 @alloy Moved guts of the code in Rakefile into seperate files in rakelib.
alloy authored
210 CONFIG["SOLIBS"] = ""
211 CONFIG["DLDLIBS"] = ""
212 CONFIG["ENABLE_SHARED"] = "yes"
213 CONFIG["ENABLE_STATIC"] = "#{ENABLE_STATIC_LIBRARY}"
214 CONFIG["MAINLIBS"] = ""
215 CONFIG["COMMON_LIBS"] = ""
216 CONFIG["COMMON_MACROS"] = ""
217 CONFIG["COMMON_HEADERS"] = ""
218 CONFIG["EXPORT_PREFIX"] = ""
219 CONFIG["THREAD_MODEL"] = "pthread"
220 CONFIG["MAKEFILES"] = "Makefile"
221 CONFIG["arch"] = "#{NEW_RUBY_PLATFORM}"
222 CONFIG["sitearch"] = "#{NEW_RUBY_PLATFORM}"
223 CONFIG["sitedir"] = "$(libdir)/ruby/site_ruby"
224 CONFIG["vendordir"] = "$(prefix)/lib/ruby/vendor_ruby"
225 CONFIG["configure_args"] = ""
226 CONFIG["rubyhdrdir"] = "$(includedir)/ruby-$(MAJOR).$(MINOR).$(TEENY)"
227 CONFIG["sitehdrdir"] = "$(rubyhdrdir)/site_ruby"
228 CONFIG["vendorhdrdir"] = "$(rubyhdrdir)/vendor_ruby"
229 CONFIG["NROFF"] = "/usr/bin/nroff"
230 CONFIG["MANTYPE"] = "doc"
231 CONFIG["ruby_version"] = "$(MAJOR).$(MINOR).$(TEENY)"
232 CONFIG["rubylibdir"] = "$(libdir)/ruby/$(ruby_version)"
233 CONFIG["archdir"] = "$(rubylibdir)/$(arch)"
234 CONFIG["sitelibdir"] = "$(sitedir)/$(ruby_version)"
235 CONFIG["sitearchdir"] = "$(sitelibdir)/$(sitearch)"
236 CONFIG["vendorlibdir"] = "$(vendordir)/$(ruby_version)"
237 CONFIG["vendorarchdir"] = "$(vendorlibdir)/$(sitearch)"
238 CONFIG["topdir"] = File.dirname(__FILE__)
239 MAKEFILE_CONFIG = {}
240 CONFIG.each{|k,v| MAKEFILE_CONFIG[k] = v.dup}
241 def RbConfig::expand(val, config = CONFIG)
242 val.gsub!(/\\$\\$|\\$\\(([^()]+)\\)|\\$\\{([^{}]+)\\}/) do
243 var = $&
244 if !(v = $1 || $2)
245 '$'
246 elsif key = config[v = v[/\\A[^:]+(?=(?::(.*?)=(.*))?\\z)/]]
247 pat, sub = $1, $2
248 config[v] = false
249 RbConfig::expand(key, config)
250 config[v] = key
251 key = key.gsub(/\#{Regexp.quote(pat)}(?=\\s|\\z)/n) {sub} if pat
252 key
253 else
254 var
255 end
256 end
257 val
258 end
259 CONFIG.each_value do |val|
260 RbConfig::expand(val)
261 end
262 end
263 Config = RbConfig # compatibility for ruby-1.8.4 and older.
264 CROSS_COMPILING = nil
265 RUBY_FRAMEWORK = true
266 RUBY_FRAMEWORK_VERSION = RbConfig::CONFIG['ruby_version']
267 EOS
268 if !File.exist?('rbconfig.rb') or File.read('rbconfig.rb') != rbconfig
269 File.open('rbconfig.rb', 'w') { |io| io.print rbconfig }
270 end
271 end
272
273 namespace :macruby do
274 desc "Build dynamic libraries for MacRuby"
275 task :dylib => [:rbconfig, :miniruby] do
8c5a2dd let's go further miniruby
Laurent Sansonetti authored
276 =begin
6d571b4 @alloy Moved guts of the code in Rakefile into seperate files in rakelib.
alloy authored
277 sh("./miniruby -I. -I./lib -rrbconfig tool/compile_prelude.rb prelude.rb gem_prelude.rb prelude.c.new")
278 if !File.exist?('prelude.c') or File.read('prelude.c') != File.read('prelude.c.new')
279 mv('prelude.c.new', 'prelude.c')
280 $builder.build(['prelude'])
281 else
282 rm('prelude.c.new')
283 end
8c5a2dd let's go further miniruby
Laurent Sansonetti authored
284 =end
285 cp('miniprelude.c', 'prelude.c')
6d571b4 @alloy Moved guts of the code in Rakefile into seperate files in rakelib.
alloy authored
286 dylib = "lib#{RUBY_SO_NAME}.#{NEW_RUBY_VERSION}.dylib"
287 $builder.link_dylib(dylib, $builder.objs - ['main', 'gc-stub', 'miniprelude'])
288 major, minor, teeny = NEW_RUBY_VERSION.scan(/\d+/)
289 ["lib#{RUBY_SO_NAME}.#{major}.#{minor}.dylib", "lib#{RUBY_SO_NAME}.dylib"].each do |dylib_alias|
290 if !File.exist?(dylib_alias) or File.readlink(dylib_alias) != dylib
291 rm_f(dylib_alias)
292 ln_s(dylib, dylib_alias)
293 end
294 end
295 end
296
297 desc "Build static libraries for MacRuby"
298 task :static => :dylib do
299 $builder.link_archive("lib#{RUBY_SO_NAME}-static.a", $builder.objs - ['main', 'gc-stub', 'miniprelude'])
300 end
301
302 desc "Build MacRuby"
303 task :build => :dylib do
304 $builder.link_executable(RUBY_INSTALL_NAME, ['main', 'gc-stub'], "-L. -l#{RUBY_SO_NAME} -lobjc")
305 end
306 end
307
308 DESTDIR = (ENV['DESTDIR'] or "")
309 EXTOUT = (ENV['EXTOUT'] or ".ext")
310 INSTALLED_LIST = '.installed.list'
311 SCRIPT_ARGS = "--make=\"/usr/bin/make\" --dest-dir=\"#{DESTDIR}\" --extout=\"#{EXTOUT}\" --mflags=\"\" --make-flags=\"\""
312 EXTMK_ARGS = "#{SCRIPT_ARGS} --extension --extstatic"
313 INSTRUBY_ARGS = "#{SCRIPT_ARGS} --data-mode=0644 --prog-mode=0755 --installed-list #{INSTALLED_LIST} --mantype=\"doc\" --sym-dest-dir=\"#{SYM_INSTDIR}\""
314
86042c6 adding preliminary support for sockets
Laurent Sansonetti authored
315 EXTENSIONS = ['ripper', 'digest', 'etc', 'readline', 'libyaml', 'fcntl', 'socket', 'zlib']
1f30d04 better code path to deal with extensions
Laurent Sansonetti authored
316 def perform_extensions_target(target)
317 EXTENSIONS.map { |x| File.join('ext', x) }.each do |ext_dir|
318 Dir.glob(File.join(ext_dir, '**/extconf.rb')) do |p|
319 dir = File.dirname(p)
320 Dir.chdir(dir) do
030c32b fixed rbconfig.rb to never mention libmacruby-static, reverted TRY_LINK
Laurent Sansonetti authored
321 $stderr.puts "cd #{dir}"
1f30d04 better code path to deal with extensions
Laurent Sansonetti authored
322 srcdir = File.join(*dir.split(File::SEPARATOR).map { |x| '..' })
63d8310 better fix
Laurent Sansonetti authored
323 next if target == :clean and !File.exist?('Makefile')
324 if !File.exist?('Makefile') or File.mtime('extconf.rb') > File.mtime('Makefile')
abe901c more extension build fixes
Laurent Sansonetti authored
325 sh "#{srcdir}/miniruby -I#{srcdir} -I#{srcdir}/lib -r rbconfig -e \"RbConfig::CONFIG['libdir'] = '#{srcdir}'; require './extconf.rb'\""
1f30d04 better code path to deal with extensions
Laurent Sansonetti authored
326 end
0cd758f adding a new optimized Array for default allocations plus various opt…
Laurent Sansonetti authored
327 line = "/usr/bin/make top_srcdir=#{srcdir} ruby=\"#{srcdir}/miniruby -I#{srcdir} -I#{srcdir}/lib\" extout=#{srcdir}/.ext hdrdir=#{srcdir}/include arch_hdrdir=#{srcdir}/include"
1f30d04 better code path to deal with extensions
Laurent Sansonetti authored
328 case target
329 when :all
330 line << " libdir=#{srcdir}"
331 else
0bc95cf fixed rbconfig.rb to use absolute paths + fixed TRY_LINK to use g++, …
Laurent Sansonetti authored
332 line << " #{target}"
1f30d04 better code path to deal with extensions
Laurent Sansonetti authored
333 end
334 sh line
0bc95cf fixed rbconfig.rb to use absolute paths + fixed TRY_LINK to use g++, …
Laurent Sansonetti authored
335 rm_f 'Makefile' if target == :clean
1f30d04 better code path to deal with extensions
Laurent Sansonetti authored
336 end
337 end
338 end
339 end
340
6d571b4 @alloy Moved guts of the code in Rakefile into seperate files in rakelib.
alloy authored
341 desc "Build extensions"
342 task :extensions => [:miniruby, "macruby:static"] do
8c5a2dd let's go further miniruby
Laurent Sansonetti authored
343 =begin
6d571b4 @alloy Moved guts of the code in Rakefile into seperate files in rakelib.
alloy authored
344 sh "./miniruby -I./lib -I.ext/common -I./- -r./ext/purelib.rb ext/extmk.rb #{EXTMK_ARGS}"
8c5a2dd let's go further miniruby
Laurent Sansonetti authored
345 =end
1f30d04 better code path to deal with extensions
Laurent Sansonetti authored
346 perform_extensions_target(:all)
6d571b4 @alloy Moved guts of the code in Rakefile into seperate files in rakelib.
alloy authored
347 end
348
28d81c6 added a bunch of stdlib files to the aot list
Laurent Sansonetti authored
349 AOT_STDLIB = [
350 'rbconfig.rb',
351 'lib/date.rb',
352 'lib/date/**/*.rb',
70e1800 added erb to the aot list
Laurent Sansonetti authored
353 'lib/erb.rb',
28d81c6 added a bunch of stdlib files to the aot list
Laurent Sansonetti authored
354 'lib/fileutils.rb',
355 'lib/irb.rb',
356 'lib/irb/**/*.rb',
4f163cb add all net/* libraries to the aot list
Laurent Sansonetti authored
357 'lib/net/**/*.rb',
28d81c6 added a bunch of stdlib files to the aot list
Laurent Sansonetti authored
358 'lib/optparse.rb',
359 #'lib/stringio.rb', #spec fails
53c50f1 now AOT compiling rubygems
Laurent Sansonetti authored
360 'lib/rubygems.rb',
361 'lib/rubygems/**/*.rb',
28d81c6 added a bunch of stdlib files to the aot list
Laurent Sansonetti authored
362 'lib/thread.rb',
363 'lib/time.rb',
364 'lib/timeout.rb',
764c005 forgot uri.rb
Laurent Sansonetti authored
365 'lib/uri.rb',
28d81c6 added a bunch of stdlib files to the aot list
Laurent Sansonetti authored
366 'lib/uri/**/*.rb',
367 'lib/yaml.rb',
368 'lib/yaml/rubytypes.rb',
369 ]
3ae269b move the AOT compilation of the stdlib into the main build task, intr…
Laurent Sansonetti authored
370 desc "AOT compile parts of the stdlib"
7937d64 fix build
Laurent Sansonetti authored
371 task :aot_compile_stdlib => [:miniruby, 'macruby:dylib'] do
3ae269b move the AOT compilation of the stdlib into the main build task, intr…
Laurent Sansonetti authored
372 AOT_STDLIB.each do |pat|
373 Dir.glob(pat).each do |path|
374 out = File.join(File.dirname(path), File.basename(path, '.rb') + '.rbo')
375 if !File.exist?(out) or File.mtime(path) > File.mtime(out) or File.mtime('./miniruby') > File.mtime(out)
376 sh "./miniruby -I. -I./lib bin/rubyc --internal -C \"#{path}\" -o \"#{out}\""
377 end
378 end
379 end
380 end
381
0bc95cf fixed rbconfig.rb to use absolute paths + fixed TRY_LINK to use g++, …
Laurent Sansonetti authored
382 desc "Same as extensions"
383 task :ext => 'extensions'
384
6d571b4 @alloy Moved guts of the code in Rakefile into seperate files in rakelib.
alloy authored
385 namespace :framework do
386 desc "Create the plist file for the framework"
387 task :info_plist do
388 plist = <<EOS
389 <?xml version="1.0" encoding="UTF-8"?>
390 <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
391 <plist version="1.0">
392 <dict>
393 <key>CFBundleDevelopmentRegion</key>
394 <string>English</string>
395 <key>CFBundleExecutable</key>
396 <string>Ruby</string>
397 <key>CFBundleName</key>
398 <string>Ruby</string>
399 <key>CFBundleGetInfoString</key>
400 <string>MacRuby Runtime and Library</string>
401 <key>CFBundleIconFile</key>
402 <string></string>
403 <key>CFBundleIdentifier</key>
404 <string>com.apple.macruby</string>
405 <key>CFBundleInfoDictionaryVersion</key>
406 <string>#{MACRUBY_VERSION}</string>
407 <key>CFBundlePackageType</key>
408 <string>FMWK</string>
409 <key>CFBundleShortVersionString</key>
410 <string>#{MACRUBY_VERSION}</string>
411 <key>CFBundleSignature</key>
412 <string>????</string>
413 <key>CFBundleVersion</key>
414 <string>MacRuby-#{MACRUBY_VERSION}</string>
415 <key>NSPrincipalClass</key>
416 <string></string>
417 </dict>
418 </plist>
419 EOS
420 File.open('framework/Info.plist', 'w') { |io| io.print plist }
421 end
422
108e7c1 added a framework:install_ext task that only installs extensions
Laurent Sansonetti authored
423 desc "Install the extensions"
424 task :install_ext do
1f30d04 better code path to deal with extensions
Laurent Sansonetti authored
425 perform_extensions_target(:install)
108e7c1 added a framework:install_ext task that only installs extensions
Laurent Sansonetti authored
426 end
427
428 desc "Install the framework"
429 task :install => [:info_plist, :install_ext] do
6d571b4 @alloy Moved guts of the code in Rakefile into seperate files in rakelib.
alloy authored
430 sh "./miniruby instruby.rb #{INSTRUBY_ARGS}"
431 end
432 end
433
434 namespace :clean do
435 desc "Clean local build files"
436 task :local do
437 $builder.clean
69528db fixed the clean task to remove binary build producfs too
Laurent Sansonetti authored
438 list = ['parse.c', 'lex.c', INSTALLED_LIST, 'Makefile', RUBY_INSTALL_NAME, 'miniruby']
439 list.concat(Dir['*.inc'])
440 list.concat(Dir['lib*.{dylib,a}'])
441 list.each { |x| rm_f(x) }
6d571b4 @alloy Moved guts of the code in Rakefile into seperate files in rakelib.
alloy authored
442 end
443
6b57493 added a task to delete the .rbo files
Laurent Sansonetti authored
444 desc "Clean .rbo build files"
445 task :rbo do
446 list = []
447 list.concat(Dir['*.rbo'])
448 list.concat(Dir['lib/**/*.rbo'])
449 list.each { |x| rm_f(x) }
450 end
451
6d571b4 @alloy Moved guts of the code in Rakefile into seperate files in rakelib.
alloy authored
452 desc "Clean extension build files"
453 task :ext do
8c5a2dd let's go further miniruby
Laurent Sansonetti authored
454 =begin
6d571b4 @alloy Moved guts of the code in Rakefile into seperate files in rakelib.
alloy authored
455 if File.exist?('./miniruby')
456 sh "./miniruby -I./lib -I.ext/common -I./- -r./ext/purelib.rb ext/extmk.rb #{EXTMK_ARGS} -- clean"
457 end
8c5a2dd let's go further miniruby
Laurent Sansonetti authored
458 =end
0bc95cf fixed rbconfig.rb to use absolute paths + fixed TRY_LINK to use g++, …
Laurent Sansonetti authored
459 perform_extensions_target(:clean)
6d571b4 @alloy Moved guts of the code in Rakefile into seperate files in rakelib.
alloy authored
460 end
b0f57d9 blocked the rake all/install tasks for now
Laurent Sansonetti authored
461 end
Something went wrong with that request. Please try again.