Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 375 lines (304 sloc) 11.122 kb
c04cc29c » drbrain
2008-08-01 Move rubypp stuff into its own task to reduce duplication.
1 require 'tmpdir'
2
569fccd2 » drbrain
2008-07-30 Move vm/Rakefile to rakelib/vm.rake, integrate it into the base rake …
3 task :vm => 'vm/vm'
4
5 ############################################################
6 # Files, Flags, & Constants
7
dbe82292 » Evan Phoenix
2008-08-11 Fix stack GC invariant
8 if ENV['LLVM_DEBUG']
9 LLVM_STYLE = "Debug"
10 else
11 LLVM_STYLE = "Release"
12 end
310a461d » Evan Phoenix
2008-08-07 Cleanup stack usage and fix interpreter
13
569fccd2 » drbrain
2008-07-30 Move vm/Rakefile to rakelib/vm.rake, integrate it into the base rake …
14 ENV.delete 'CDPATH' # confuses llvm_config
310a461d » Evan Phoenix
2008-08-07 Cleanup stack usage and fix interpreter
15 LLVM_CONFIG = "vm/external_libs/llvm/#{LLVM_STYLE}/bin/llvm-config"
569fccd2 » drbrain
2008-07-30 Move vm/Rakefile to rakelib/vm.rake, integrate it into the base rake …
16 tests = FileList["vm/test/test_*.hpp"]
ecc013df » drbrain
2008-08-06 Ensure that test_instructions.hpp is included in runner.cpp generation.
17
18 # vm/test/test_instructions.hpp may not have been generated yet
19 tests << 'vm/test/test_instructions.hpp'
20 tests.uniq!
21
ec70491b » Ryan Davis
2008-07-31 Fixed rakefile for vm/builtin move
22 srcs = FileList["vm/*.{cpp,c}"] + FileList["vm/builtin/*.{cpp,c}"]
23 hdrs = FileList["vm/*.{hpp,h}"] + FileList["vm/builtin/*.{hpp,h}"]
569fccd2 » drbrain
2008-07-30 Move vm/Rakefile to rakelib/vm.rake, integrate it into the base rake …
24 objs = srcs.map { |f| f.sub(/c(pp)?$/, 'o') }
25 dep_file = "vm/.depends.mf"
26 vm_objs = %w[ vm/drivers/cli.o ]
27 vm_srcs = %w[ vm/drivers/cli.cpp ]
28 EX_INC = %w[ libtommath onig libffi/include
29 libltdl libev llvm/include
30 ].map { |f| "vm/external_libs/#{f}" }
9901699d » drbrain
2008-07-31 Fix vm:clean, simplify vm/instructions.{o,bc}
31
569fccd2 » drbrain
2008-07-30 Move vm/Rakefile to rakelib/vm.rake, integrate it into the base rake …
32 INSN_GEN = %w[ vm/gen/iseq_instruction_names.cpp
33 vm/gen/iseq_instruction_names.hpp
72ad3d41 » drbrain
2008-07-31 Hook up more dependencies in vm.rake, especially for generated files.
34 vm/gen/iseq_instruction_size.gen
569fccd2 » drbrain
2008-07-30 Move vm/Rakefile to rakelib/vm.rake, integrate it into the base rake …
35 vm/test/test_instructions.hpp ]
ecc013df » drbrain
2008-08-06 Ensure that test_instructions.hpp is included in runner.cpp generation.
36 TYPE_GEN = %w[ vm/gen/includes.hpp
37 vm/gen/simple_field.rb
569fccd2 » drbrain
2008-07-30 Move vm/Rakefile to rakelib/vm.rake, integrate it into the base rake …
38 vm/gen/typechecks.gen.cpp
39 vm/gen/primitives_declare.hpp
40 vm/gen/primitives_glue.gen.cpp ]
41
dce6244c » brixen
2008-08-19 Exposed CompactLookupTable to Ruby.
42 # Files are in order based on dependencies. For example,
43 # CompactLookupTable inherits from Tuple, so the header
44 # for compactlookuptable.hpp has to come after tuple.hpp
ecc013df » drbrain
2008-08-06 Ensure that test_instructions.hpp is included in runner.cpp generation.
45 field_extract_headers = %w[
46 vm/builtin/object.hpp
b8812226 » Evan Phoenix
2008-08-12 Steamroller session getting the kernel running.
47 vm/builtin/integer.hpp
cce8a021 » drbrain
2008-08-21 Add access_variable to list of things with primitives to extract
48 vm/builtin/executable.hpp
49 vm/builtin/access_variable.hpp
690b7624 » drbrain
2008-08-22 Implement array_aset and array_aref primitives
50 vm/builtin/fixnum.hpp
ecc013df » drbrain
2008-08-06 Ensure that test_instructions.hpp is included in runner.cpp generation.
51 vm/builtin/array.hpp
52 vm/builtin/bignum.hpp
53 vm/builtin/block_environment.hpp
54 vm/builtin/bytearray.hpp
77fae252 » Evan Phoenix
2008-08-28 Wire up IO#open, IO#close, and IO#gets
55 vm/builtin/io.hpp
ecc013df » drbrain
2008-08-06 Ensure that test_instructions.hpp is included in runner.cpp generation.
56 vm/builtin/channel.hpp
221f2f13 » brixen
2008-08-21 Change instructions gen to not use a temp file (pair Ryan).
57 vm/builtin/module.hpp
ecc013df » drbrain
2008-08-06 Ensure that test_instructions.hpp is included in runner.cpp generation.
58 vm/builtin/class.hpp
59 vm/builtin/compiledmethod.hpp
60 vm/builtin/contexts.hpp
61 vm/builtin/dir.hpp
62 vm/builtin/exception.hpp
63 vm/builtin/float.hpp
64 vm/builtin/immediates.hpp
65 vm/builtin/iseq.hpp
66 vm/builtin/list.hpp
67 vm/builtin/lookuptable.hpp
68 vm/builtin/memorypointer.hpp
69 vm/builtin/methodtable.hpp
70 vm/builtin/nativefunction.hpp
71 vm/builtin/regexp.hpp
72 vm/builtin/selector.hpp
73 vm/builtin/sendsite.hpp
74 vm/builtin/staticscope.hpp
75 vm/builtin/string.hpp
76 vm/builtin/symbol.hpp
77 vm/builtin/task.hpp
78 vm/builtin/thread.hpp
79 vm/builtin/tuple.hpp
dce6244c » brixen
2008-08-19 Exposed CompactLookupTable to Ruby.
80 vm/builtin/compactlookuptable.hpp
44d61f8c » brixen
2008-08-21 Added Time C++ class and primitives.
81 vm/builtin/time.hpp
ecc013df » drbrain
2008-08-06 Ensure that test_instructions.hpp is included in runner.cpp generation.
82 ]
83
d19313c4 » Evan Phoenix
2008-08-01 Compile the kernel, and load it in
84 BC = "vm/instructions.bc"
310a461d » Evan Phoenix
2008-08-07 Cleanup stack usage and fix interpreter
85 LLVM_A = "vm/external_libs/llvm/#{LLVM_STYLE}/lib/libLLVMSystem.a"
569fccd2 » drbrain
2008-07-30 Move vm/Rakefile to rakelib/vm.rake, integrate it into the base rake …
86 EXTERNALS = %W[ #{LLVM_A}
87 vm/external_libs/libtommath/libtommath.a
88 vm/external_libs/onig/.libs/libonig.a
89 vm/external_libs/libffi/.libs/libffi.a
90 vm/external_libs/libltdl/.libs/libltdl.a
91 vm/external_libs/libev/.libs/libev.a ]
92 OPTIONS = {
310a461d » Evan Phoenix
2008-08-07 Cleanup stack usage and fix interpreter
93 LLVM_A => "--enable-targets=host-only"
569fccd2 » drbrain
2008-07-30 Move vm/Rakefile to rakelib/vm.rake, integrate it into the base rake …
94 }
95
310a461d » Evan Phoenix
2008-08-07 Cleanup stack usage and fix interpreter
96 if LLVM_STYLE == "Release"
97 OPTIONS[LLVM_A] << " --enable-optimized"
98 end
99
569fccd2 » drbrain
2008-07-30 Move vm/Rakefile to rakelib/vm.rake, integrate it into the base rake …
100 INCLUDES = (EX_INC + %w[vm/test/cxxtest vm .]).map { |f| "-I#{f}" }
310a461d » Evan Phoenix
2008-08-07 Cleanup stack usage and fix interpreter
101 FLAGS = %w(-Wall -Werror -ggdb -gdwarf-2)
d19313c4 » Evan Phoenix
2008-08-01 Compile the kernel, and load it in
102 CC = ENV['CC'] || "gcc"
103
569fccd2 » drbrain
2008-07-30 Move vm/Rakefile to rakelib/vm.rake, integrate it into the base rake …
104
105 FLAGS << "-O2" if ENV['FAST']
106
31978505 » Evan Phoenix
2008-07-30 Fix using strlcpy and strlcat, respect CC
107 def compile(obj, src)
569fccd2 » drbrain
2008-07-30 Move vm/Rakefile to rakelib/vm.rake, integrate it into the base rake …
108 unless defined? $llvm_c then
109 $llvm_c = `#{LLVM_CONFIG} --cflags`.split(/\s+/)
110 $llvm_c.delete_if { |e| e.index("-O") == 0 }
111 end
112
113 flags = (INCLUDES + FLAGS + $llvm_c).join(' ')
114
7a3a84c9 » wilson
2008-08-18 Produce 'terse' build output by default. Use --trace to override.
115 if $verbose
116 sh "#{CC} #{flags} -c -o #{obj} #{src} 2>&1"
117 else
d19313c4 » Evan Phoenix
2008-08-01 Compile the kernel, and load it in
118 puts "CC #{src}"
119 sh "#{CC} #{flags} -c -o #{obj} #{src} 2>&1", :verbose => false
120 end
569fccd2 » drbrain
2008-07-30 Move vm/Rakefile to rakelib/vm.rake, integrate it into the base rake …
121 end
122
7ed276a1 » drbrain
2008-08-29 Use ld instead of link to avoid overwriting FileUtils
123 def ld t
d19313c4 » Evan Phoenix
2008-08-01 Compile the kernel, and load it in
124 $link_opts ||= `#{LLVM_CONFIG} --ldflags`.split(/\s+/).join(' ')
125
126 ld = ENV['LD'] || 'g++'
127 o = t.prerequisites.find_all { |f| f =~ /o$/ }.join(' ')
128 l = ex_libs.join(' ')
129
7a3a84c9 » wilson
2008-08-18 Produce 'terse' build output by default. Use --trace to override.
130 if $verbose
131 sh "#{ld} #{$link_opts} -o #{t.name} #{o} #{l}"
132 else
d19313c4 » Evan Phoenix
2008-08-01 Compile the kernel, and load it in
133 puts "LD #{t.name}"
134 sh "#{ld} #{$link_opts} -o #{t.name} #{o} #{l}", :verbose => false
135 end
136 end
137
933877da » Evan Phoenix
2008-08-11 Fix instructions.o dep, add newline
138 def rubypp_task(target, prerequisite, *extra)
d749a1d2 » wilson
2008-08-22 Move the Ruby preprocessor under vm/codegen directory
139 file target => [prerequisite, 'vm/codegen/rubypp.rb'] + extra do
221f2f13 » brixen
2008-08-21 Change instructions gen to not use a temp file (pair Ryan).
140 path = File.join("vm/gen", File.basename(prerequisite))
d749a1d2 » wilson
2008-08-22 Move the Ruby preprocessor under vm/codegen directory
141 ruby 'vm/codegen/rubypp.rb', prerequisite, path
221f2f13 » brixen
2008-08-21 Change instructions gen to not use a temp file (pair Ryan).
142 yield path
c04cc29c » drbrain
2008-08-01 Move rubypp stuff into its own task to reduce duplication.
143 end
144 end
d19313c4 » Evan Phoenix
2008-08-01 Compile the kernel, and load it in
145
569fccd2 » drbrain
2008-07-30 Move vm/Rakefile to rakelib/vm.rake, integrate it into the base rake …
146 ############################################################
147 # Other Tasks
148
149 rule '.o' do |t|
150 obj = t.name
151 src = t.prerequisites.find { |f| f =~ /#{File.basename obj, '.o'}\.c(pp)?$/}
152
153 compile obj, src
154 end
155
156 def files targets, dependencies = nil, &block
157 targets.each do |target|
158 if dependencies then
159 file target => dependencies, &block
160 else
161 file target, &block
162 end
163 end
164 end
165
166 directory "vm/gen"
167 file "vm/type_info.o" => "vm/gen/typechecks.gen.cpp"
168 file "vm/primitives.hpp" => "vm/gen/primitives_declare.hpp"
ec70491b » Ryan Davis
2008-07-31 Fixed rakefile for vm/builtin move
169 files Dir["vm/builtin/*.hpp"], INSN_GEN
569fccd2 » drbrain
2008-07-30 Move vm/Rakefile to rakelib/vm.rake, integrate it into the base rake …
170 files vm_objs, vm_srcs
171
172 objs.zip(srcs).each do |obj, src|
173 file obj => src
174 end
175
c04cc29c » drbrain
2008-08-01 Move rubypp stuff into its own task to reduce duplication.
176 objs += ["vm/instructions.o"] # NOTE: BC isn't added due to llvm-g++ requirement
569fccd2 » drbrain
2008-07-30 Move vm/Rakefile to rakelib/vm.rake, integrate it into the base rake …
177
178 files EXTERNALS do |t|
179 path = File.join(*split_all(t.name)[0..2])
180 configure_path = File.join(path, 'configure')
181
182 if File.exist? configure_path then
183 sh "cd #{path}; ./configure #{OPTIONS[t.name]} && make"
184 else
185 sh "cd #{path}; make"
186 end
187 end
188
8503a1cf » wilson
2008-08-22 Move field_extract.rb under codegen directory
189 file 'vm/primitives.o' => 'vm/codegen/field_extract.rb'
2f18bbde » brixen
2008-08-27 Move iseq.rb and breakpoint.rb to kernel/delta.
190 file 'vm/codegen/instructions_gen.rb' => 'kernel/delta/iseq.rb'
719f0a0b » Ryan Davis
2008-08-22 Fixed dependency bug
191 file 'vm/instructions.rb' => 'vm/gen'
2982c2cd » wilson
2008-08-22 Move instructions_gen.rb under codegen directory
192 file 'vm/instructions.rb' => 'vm/codegen/instructions_gen.rb'
193 file 'vm/test/test_instructions.hpp' => 'vm/codegen/instructions_gen.rb'
8503a1cf » wilson
2008-08-22 Move field_extract.rb under codegen directory
194 file 'vm/codegen/field_extract.rb' => 'vm/gen'
719f0a0b » Ryan Davis
2008-08-22 Fixed dependency bug
195
196 files INSN_GEN, %w[vm/instructions.rb] do |t|
569fccd2 » drbrain
2008-07-30 Move vm/Rakefile to rakelib/vm.rake, integrate it into the base rake …
197 ruby 'vm/instructions.rb', :verbose => $verbose
198 end
199
8503a1cf » wilson
2008-08-22 Move field_extract.rb under codegen directory
200 files TYPE_GEN, field_extract_headers + %w[vm/codegen/field_extract.rb] do
f29d1d43 » Evan Phoenix
2008-08-09 Fix field_extract and some prims, remove Task->ip.
201 puts "GEN field_extract"
ecc013df » drbrain
2008-08-06 Ensure that test_instructions.hpp is included in runner.cpp generation.
202 field_extract field_extract_headers
569fccd2 » drbrain
2008-07-30 Move vm/Rakefile to rakelib/vm.rake, integrate it into the base rake …
203 end
204
205 file 'vm/vm' => EXTERNALS + objs + vm_objs do |t|
7ed276a1 » drbrain
2008-08-29 Use ld instead of link to avoid overwriting FileUtils
206 ld t
569fccd2 » drbrain
2008-07-30 Move vm/Rakefile to rakelib/vm.rake, integrate it into the base rake …
207 end
208
209 file 'vm/gen/primitives_glue.gen.cpp' => hdrs
210
8684bc6e » drbrain
2008-08-01 tests depend on objs
211 file 'vm/test/runner.cpp' => tests + objs do
cafd187f » Evan Phoenix
2008-08-24 Implemented object_send primitive
212 tests = tests.sort
213 puts "GEN vm/test/runner.cpp" unless $verbose
214 tests << { :verbose => $verbose }
569fccd2 » drbrain
2008-07-30 Move vm/Rakefile to rakelib/vm.rake, integrate it into the base rake …
215 sh("vm/test/cxxtest/cxxtestgen.pl", "--error-printer", "--have-eh",
216 "--abort-on-fail", "-o", "vm/test/runner.cpp", *tests)
217 end
218
219 file 'vm/test/runner.o' => 'vm/test/runner.cpp' # no rule .o => .cpp
220
221 file 'vm/test/runner' => EXTERNALS + objs + %w[vm/test/runner.o] do |t|
7ed276a1 » drbrain
2008-08-29 Use ld instead of link to avoid overwriting FileUtils
222 ld t
569fccd2 » drbrain
2008-07-30 Move vm/Rakefile to rakelib/vm.rake, integrate it into the base rake …
223 end
224
310a461d » Evan Phoenix
2008-08-07 Cleanup stack usage and fix interpreter
225 # A simple JIT tester driver
226
227 file 'vm/drivers/compile.o' => 'vm/drivers/compile.cpp'
228
229 file 'vm/compile' => EXTERNALS + objs + %w[vm/drivers/compile.o] do |t|
7ed276a1 » drbrain
2008-08-29 Use ld instead of link to avoid overwriting FileUtils
230 ld t
310a461d » Evan Phoenix
2008-08-07 Cleanup stack usage and fix interpreter
231 end
232
933877da » Evan Phoenix
2008-08-11 Fix instructions.o dep, add newline
233 rubypp_task 'vm/instructions.o', 'vm/llvm/instructions.cpp', *hdrs do |path|
d19313c4 » Evan Phoenix
2008-08-01 Compile the kernel, and load it in
234 compile 'vm/instructions.o', path
569fccd2 » drbrain
2008-07-30 Move vm/Rakefile to rakelib/vm.rake, integrate it into the base rake …
235 end
236
933877da » Evan Phoenix
2008-08-11 Fix instructions.o dep, add newline
237 rubypp_task 'vm/instructions.bc', 'vm/llvm/instructions.cpp', *hdrs do |path|
d19313c4 » Evan Phoenix
2008-08-01 Compile the kernel, and load it in
238 sh "llvm-g++ -emit-llvm -Ivm -Ivm/external_libs/libffi/include -c -o vm/instructions.bc #{path}"
569fccd2 » drbrain
2008-07-30 Move vm/Rakefile to rakelib/vm.rake, integrate it into the base rake …
239 end
240
ec70491b » Ryan Davis
2008-07-31 Fixed rakefile for vm/builtin move
241 namespace :vm do
a64c449f » drbrain
2008-08-18 Add filter argument for vm:test to set test suite
242 desc 'Run all VM tests. Uses its argument as a filter of tests to run.'
243 task :test, :filter do |task, args|
244 ENV['SUITE'] = args[:filter] if args[:filter]
bebd2d16 » Evan Phoenix
2008-08-07 Add coverage task back in as vm:coverage
245 ENV['VERBOSE'] = '1' if $verbose
ec70491b » Ryan Davis
2008-07-31 Fixed rakefile for vm/builtin move
246 sh 'vm/test/runner', :verbose => $verbose
247 end
a64c449f » drbrain
2008-08-18 Add filter argument for vm:test to set test suite
248 task :test => 'vm/test/runner'
ec70491b » Ryan Davis
2008-07-31 Fixed rakefile for vm/builtin move
249
bebd2d16 » Evan Phoenix
2008-08-07 Add coverage task back in as vm:coverage
250 task :coverage do
251 Dir.mkdir "vm/test/coverage" unless File.directory? "vm/test/coverage"
252 unless defined? $llvm_c then
253 $llvm_c = `#{LLVM_CONFIG} --cflags`.split(/\s+/)
254 $llvm_c.delete_if { |e| e.index("-O") == 0 }
255 end
256
257 $link_opts ||= `#{LLVM_CONFIG} --ldflags`.split(/\s+/).join(' ')
258
259 flags = (INCLUDES + FLAGS + $llvm_c).join(' ')
260
261 puts "CC/LD vm/test/coverage/runner"
262 begin
221f2f13 » brixen
2008-08-21 Change instructions gen to not use a temp file (pair Ryan).
263 path = "vm/gen/instructions.cpp"
d749a1d2 » wilson
2008-08-22 Move the Ruby preprocessor under vm/codegen directory
264 ruby 'vm/codegen/rubypp.rb', "vm/llvm/instructions.cpp", path
221f2f13 » brixen
2008-08-21 Change instructions gen to not use a temp file (pair Ryan).
265 sh "g++ -fprofile-arcs -ftest-coverage #{flags} -o vm/test/coverage/runner vm/test/runner.cpp vm/*.cpp vm/builtin/*.cpp vm/*.c #{path} #{$link_opts} #{(ex_libs + EXTERNALS).join(' ')}"
266
267 puts "RUN vm/test/coverage/runner"
268 sh "vm/test/coverage/runner"
269 if $verbose
270 sh "vm/test/lcov/bin/lcov --directory . --capture --output-file vm/test/coverage/app.info"
271 else
272 sh "vm/test/lcov/bin/lcov --directory . --capture --output-file vm/test/coverage/app.info > /dev/null 2>&1"
273 end
274
275 puts "GEN vm/test/coverage/index.html"
276 if $verbose
277 sh "cd vm/test/coverage; ../lcov/bin/genhtml app.info"
278 else
279 sh "cd vm/test/coverage; ../lcov/bin/genhtml app.info > /dev/null 2>&1"
bebd2d16 » Evan Phoenix
2008-08-07 Add coverage task back in as vm:coverage
280 end
281 ensure
282 sh "rm -f *.gcno *.gcda"
283 end
284 end
285
221f2f13 » brixen
2008-08-21 Change instructions gen to not use a temp file (pair Ryan).
286 # TODO: for ryan: fix up dependencies between rubypp and the source files now that they're persistent
287 # TODO: for ryan: dependencies on vm/test/test_instructions.hpp causes rebuild of vm/*.cpp files. lame
bebd2d16 » Evan Phoenix
2008-08-07 Add coverage task back in as vm:coverage
288
ec70491b » Ryan Davis
2008-07-31 Fixed rakefile for vm/builtin move
289 desc "Clean up vm build files"
290 task :clean do
291 files = [
d19313c4 » Evan Phoenix
2008-08-01 Compile the kernel, and load it in
292 objs, dep_file, TYPE_GEN, INSN_GEN,
9901699d » drbrain
2008-07-31 Fix vm:clean, simplify vm/instructions.{o,bc}
293 'vm/gen',
72ad3d41 » drbrain
2008-07-31 Hook up more dependencies in vm.rake, especially for generated files.
294 'vm/test/runner',
295 'vm/test/runner.cpp',
296 'vm/test/test_instructions.cpp',
ec70491b » Ryan Davis
2008-07-31 Fixed rakefile for vm/builtin move
297 'vm/vm'
9901699d » drbrain
2008-07-31 Fix vm:clean, simplify vm/instructions.{o,bc}
298 ].flatten
ec70491b » Ryan Davis
2008-07-31 Fixed rakefile for vm/builtin move
299
300 files.each do |filename|
9901699d » drbrain
2008-07-31 Fix vm:clean, simplify vm/instructions.{o,bc}
301 rm_rf filename, :verbose => $verbose
ec70491b » Ryan Davis
2008-07-31 Fixed rakefile for vm/builtin move
302 end
303 end
304
305 desc "Clean up, including all external libs"
306 task :distclean => :clean do
307 EXTERNALS.each do |lib|
308 path = File.join(*lib.split(File::SEPARATOR)[0..2])
309 system "cd #{path}; make clean"
310 end
311 end
312
313 desc "Show which primitives are missing"
314 task :missing_primitives do
41bc510e » brixen
2008-08-24 Get list of primitives directly from kernel/**/*.rb files.
315 kernel_files = FileList['kernel/**/*.rb'].join " "
316 kernel_primitives = `grep 'Ruby.primitive' #{kernel_files} | awk '{ print $3 }'`
317 kernel_primitives = kernel_primitives.gsub(':', '').split("\n").sort.uniq
ec70491b » Ryan Davis
2008-07-31 Fixed rakefile for vm/builtin move
318
41bc510e » brixen
2008-08-24 Get list of primitives directly from kernel/**/*.rb files.
319 cpp_primitives = `grep 'Ruby.primitive' vm/builtin/*.hpp | awk '{ print $4 }'`
ec70491b » Ryan Davis
2008-07-31 Fixed rakefile for vm/builtin move
320 cpp_primitives = cpp_primitives.gsub(':', '').split("\n").sort.uniq
321
41bc510e » brixen
2008-08-24 Get list of primitives directly from kernel/**/*.rb files.
322 missing = kernel_primitives - cpp_primitives
ec70491b » Ryan Davis
2008-07-31 Fixed rakefile for vm/builtin move
323
324 puts missing.join("\n")
325 end
326 end
327
569fccd2 » drbrain
2008-07-30 Move vm/Rakefile to rakelib/vm.rake, integrate it into the base rake …
328 ############################################################$
329 # Importers & Methods:
330
331 require 'rake/loaders/makefile'
332
d19313c4 » Evan Phoenix
2008-08-01 Compile the kernel, and load it in
333 generated = (TYPE_GEN + INSN_GEN).select { |f| f =~ /pp$/ }
72ad3d41 » drbrain
2008-07-31 Hook up more dependencies in vm.rake, especially for generated files.
334
335 file dep_file => srcs + hdrs + vm_srcs + generated do |t|
336 includes = INCLUDES.join ' '
337
338 flags = FLAGS.join ' '
569fccd2 » drbrain
2008-07-30 Move vm/Rakefile to rakelib/vm.rake, integrate it into the base rake …
339 flags << " -D__STDC_LIMIT_MACROS"
340
72ad3d41 » drbrain
2008-07-31 Hook up more dependencies in vm.rake, especially for generated files.
341 cmd = "makedepend -f- #{includes} -- #{flags} -- #{t.prerequisites}"
9901699d » drbrain
2008-07-31 Fix vm:clean, simplify vm/instructions.{o,bc}
342 cmd << ' 2>/dev/null' unless $verbose
1ff280a6 » Ryan Davis
2008-08-01 Added top 10 node coloring, include filtering, and minimum edge filte…
343 warn "makedepend ..."
72ad3d41 » drbrain
2008-07-31 Hook up more dependencies in vm.rake, especially for generated files.
344
345 dep = `#{cmd}`
569fccd2 » drbrain
2008-07-30 Move vm/Rakefile to rakelib/vm.rake, integrate it into the base rake …
346 dep.gsub!(%r% /usr/include\S+%, '') # speeds up rake a lot
347 dep.gsub!(%r%^\S+:[^ ]%, '')
348
349 File.open t.name, 'w' do |f|
350 f.puts dep
351 end
352 end
353
354 import dep_file
355
356 def ex_libs # needs to be method to delay running of llvm_config
357 unless defined? $ex_libs then
358 $ex_libs = EXTERNALS + [ "-ldl" ]
04f1ce93 » brixen
2008-08-25 A couple linux compile fixups from Mitchell Riley.
359 $ex_libs << "-lrt -lcrypt" if RUBY_PLATFORM =~ /linux/
569fccd2 » drbrain
2008-07-30 Move vm/Rakefile to rakelib/vm.rake, integrate it into the base rake …
360
361 llvm_libfiles = `#{LLVM_CONFIG} --libfiles all`.split(/\s+/)
362 llvm_libfiles = llvm_libfiles.select { |f| File.file? f }
363
364 pwd = File.join Dir.pwd, '' # add /
365 llvm_libfiles = llvm_libfiles.map { |f| f.sub pwd, '' }
366 $ex_libs += llvm_libfiles
367 end
368 $ex_libs
369 end
370
ecc013df » drbrain
2008-08-06 Ensure that test_instructions.hpp is included in runner.cpp generation.
371 def field_extract(headers)
372 headers += [{ :verbose => $verbose}]
72ad3d41 » drbrain
2008-07-31 Hook up more dependencies in vm.rake, especially for generated files.
373
8503a1cf » wilson
2008-08-22 Move field_extract.rb under codegen directory
374 ruby('vm/codegen/field_extract.rb', *headers)
569fccd2 » drbrain
2008-07-30 Move vm/Rakefile to rakelib/vm.rake, integrate it into the base rake …
375 end
Something went wrong with that request. Please try again.