Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 726 lines (564 sloc) 20.508 kB
c04cc29 @drbrain Move rubypp stuff into its own task to reduce duplication.
drbrain authored
1 require 'tmpdir'
3bc5c5c @drbrain Use ENV to figure out make
drbrain authored
2 require 'rakelib/rubinius'
124dd5d @brixen Fix for platform dependent file ordering.
brixen authored
3 require 'rakelib/configuration'
7153156 Add a configure script
Evan Phoenix authored
4 require 'rakelib/build'
9b60cfd @brixen Rework VM instruction parsing and generation.
brixen authored
5 require 'rakelib/instruction_parser'
b09a24c Wire the JIT in via MachineMethod
Evan Phoenix authored
6 require 'ostruct'
c04cc29 @drbrain Move rubypp stuff into its own task to reduce duplication.
drbrain authored
7
9cc5dde @rue Move rakelib #require for ffi/generator_task.
rue authored
8 require 'lib/ffi/generator_task.rb'
9
b09a24c Wire the JIT in via MachineMethod
Evan Phoenix authored
10 config = OpenStruct.new
11 config.use_jit = true
9f159ff Add ability to compile project with LLVM
Evan Phoenix authored
12 config.compile_with_llvm = false
13
14 CONFIG = config
15
b09a24c Wire the JIT in via MachineMethod
Evan Phoenix authored
16
569fccd @drbrain Move vm/Rakefile to rakelib/vm.rake, integrate it into the base rake …
drbrain authored
17 task :vm => 'vm/vm'
18
19 ############################################################
20 # Files, Flags, & Constants
21
7153156 Add a configure script
Evan Phoenix authored
22 ENV.delete 'CDPATH' # confuses llvm_config
23
9f159ff Add ability to compile project with LLVM
Evan Phoenix authored
24 if CONFIG.compile_with_llvm
25 ENV['CC'] = "llvm-gcc"
26 end
27
32074b9 Fix condition
Evan Phoenix authored
28 LLVM_ENABLE = (Rubinius::BUILD_CONFIG[:llvm] != :no)
310a461 Cleanup stack usage and fix interpreter
Evan Phoenix authored
29
3ec6b24 The return of the C++ tests
Evan Phoenix authored
30
31 if ENV['TESTS_ONLY']
32 tests = FileList[ENV['TESTS_ONLY']]
33 else
02b07e1 @brixen Started new C-API tests.
brixen authored
34 tests = FileList["vm/test/**/test_*.hpp"]
3ec6b24 The return of the C++ tests
Evan Phoenix authored
35 end
ecc013d @drbrain Ensure that test_instructions.hpp is included in runner.cpp generation.
drbrain authored
36
37 tests.uniq!
38
a352624 Start of new LLVM JIT
Evan Phoenix authored
39 subdirs = %w!builtin capi parser util instruments gc llvm!
86e4f3f Move GC code under gc/
Evan Phoenix authored
40
41 srcs = FileList["vm/*.{cpp,c}"]
42 subdirs.each do |dir|
43 srcs += FileList["vm/#{dir}/*.{cpp,c}"]
44 end
5f4023f @brixen Import parser from shotgun.
brixen authored
45 srcs << 'vm/parser/grammar.cpp'
0db33b0 @rue Add vm/subtend/* to build targets for Rake.
rue authored
46
86e4f3f Move GC code under gc/
Evan Phoenix authored
47 hdrs = FileList["vm/*.{hpp,h}"]
48 subdirs.each do |dir|
49 hdrs += FileList["vm/#{dir}/*.{cpp,c}"]
50 end
0db33b0 @rue Add vm/subtend/* to build targets for Rake.
rue authored
51
7d35d7e @agardiner Add PortableUContext for platforms that need it
agardiner authored
52 objs = srcs.map { |f| f.sub(/((c(pp)?)|S)$/, 'o') }
0db33b0 @rue Add vm/subtend/* to build targets for Rake.
rue authored
53
569fccd @drbrain Move vm/Rakefile to rakelib/vm.rake, integrate it into the base rake …
drbrain authored
54 dep_file = "vm/.depends.mf"
55 vm_objs = %w[ vm/drivers/cli.o ]
56 vm_srcs = %w[ vm/drivers/cli.cpp ]
a2ef6b4 A bunch more assembler/jit work
Evan Phoenix authored
57
b09a24c Wire the JIT in via MachineMethod
Evan Phoenix authored
58 jit_objs = %w[ vm/assembler/jit.o vm/assembler/assembler_x86.o ]
59 jit_srcs = %w[ vm/assembler/jit.cpp vm/assembler/assembler_x86.cpp]
60
61 if config.use_jit
62 objs += jit_objs
63 srcs += jit_srcs
64 end
65
b5771b4 @brixen Import libgdtoa and use ruby_strtod instead of libc strtod.
brixen authored
66 EX_INC = %w[ libtommath libgdtoa onig libffi/include
d6b2ac1 @dbussink Fix a bunch of test issues on 64 bit platforms
dbussink authored
67 libbstring libcchash libmquark libmpa
7153156 Add a configure script
Evan Phoenix authored
68 libltdl libev
569fccd @drbrain Move vm/Rakefile to rakelib/vm.rake, integrate it into the base rake …
drbrain authored
69 ].map { |f| "vm/external_libs/#{f}" }
9901699 @drbrain Fix vm:clean, simplify vm/instructions.{o,bc}
drbrain authored
70
569fccd @drbrain Move vm/Rakefile to rakelib/vm.rake, integrate it into the base rake …
drbrain authored
71 INSN_GEN = %w[ vm/gen/iseq_instruction_names.cpp
72 vm/gen/iseq_instruction_names.hpp
72ad3d4 @drbrain Hook up more dependencies in vm.rake, especially for generated files.
drbrain authored
73 vm/gen/iseq_instruction_size.gen
9b60cfd @brixen Rework VM instruction parsing and generation.
brixen authored
74 vm/gen/implementation_prototype.hpp
75 vm/gen/instruction_defines.hpp
76 vm/gen/instruction_locations.hpp
77 vm/gen/instruction_implementations.hpp
78 vm/gen/inst_list.hpp
79 vm/gen/inst_stack.hpp
3ec6b24 The return of the C++ tests
Evan Phoenix authored
80 ]
ecc013d @drbrain Ensure that test_instructions.hpp is included in runner.cpp generation.
drbrain authored
81 TYPE_GEN = %w[ vm/gen/includes.hpp
0e1df2f @brixen Added rake install and rake uninstall tasks.
brixen authored
82 vm/gen/kind_of.hpp
83 vm/gen/object_types.hpp
569fccd @drbrain Move vm/Rakefile to rakelib/vm.rake, integrate it into the base rake …
drbrain authored
84 vm/gen/typechecks.gen.cpp
85 vm/gen/primitives_declare.hpp
86 vm/gen/primitives_glue.gen.cpp ]
87
bfd65dd Added recursive dependency reporting
Ryan Davis authored
88 task :bogo_field_extract => TYPE_GEN
89
dce6244 @brixen Exposed CompactLookupTable to Ruby.
brixen authored
90 # Files are in order based on dependencies. For example,
91 # CompactLookupTable inherits from Tuple, so the header
92 # for compactlookuptable.hpp has to come after tuple.hpp
ecc013d @drbrain Ensure that test_instructions.hpp is included in runner.cpp generation.
drbrain authored
93 field_extract_headers = %w[
94 vm/builtin/object.hpp
b881222 Steamroller session getting the kernel running.
Evan Phoenix authored
95 vm/builtin/integer.hpp
cce8a02 @drbrain Add access_variable to list of things with primitives to extract
drbrain authored
96 vm/builtin/executable.hpp
97 vm/builtin/access_variable.hpp
690b762 @drbrain Implement array_aset and array_aref primitives
drbrain authored
98 vm/builtin/fixnum.hpp
ecc013d @drbrain Ensure that test_instructions.hpp is included in runner.cpp generation.
drbrain authored
99 vm/builtin/array.hpp
100 vm/builtin/bignum.hpp
101 vm/builtin/block_environment.hpp
102 vm/builtin/bytearray.hpp
77fae25 Wire up IO#open, IO#close, and IO#gets
Evan Phoenix authored
103 vm/builtin/io.hpp
ecc013d @drbrain Ensure that test_instructions.hpp is included in runner.cpp generation.
drbrain authored
104 vm/builtin/channel.hpp
221f2f1 @brixen Change instructions gen to not use a temp file (pair Ryan).
brixen authored
105 vm/builtin/module.hpp
ecc013d @drbrain Ensure that test_instructions.hpp is included in runner.cpp generation.
drbrain authored
106 vm/builtin/class.hpp
107 vm/builtin/compiledmethod.hpp
47565fe @drbrain Add Data class
drbrain authored
108 vm/builtin/data.hpp
ecc013d @drbrain Ensure that test_instructions.hpp is included in runner.cpp generation.
drbrain authored
109 vm/builtin/dir.hpp
110 vm/builtin/exception.hpp
111 vm/builtin/float.hpp
112 vm/builtin/immediates.hpp
113 vm/builtin/iseq.hpp
114 vm/builtin/list.hpp
115 vm/builtin/lookuptable.hpp
116 vm/builtin/memorypointer.hpp
117 vm/builtin/methodtable.hpp
118 vm/builtin/nativefunction.hpp
0be116a Add prelim support for packed object layout
Evan Phoenix authored
119 vm/builtin/packed_object.hpp
ecc013d @drbrain Ensure that test_instructions.hpp is included in runner.cpp generation.
drbrain authored
120 vm/builtin/regexp.hpp
121 vm/builtin/selector.hpp
122 vm/builtin/staticscope.hpp
01a15c7 Rework MethodTable to be independent
Evan Phoenix authored
123 vm/builtin/sendsite.hpp
ecc013d @drbrain Ensure that test_instructions.hpp is included in runner.cpp generation.
drbrain authored
124 vm/builtin/string.hpp
125 vm/builtin/symbol.hpp
126 vm/builtin/thread.hpp
127 vm/builtin/tuple.hpp
dce6244 @brixen Exposed CompactLookupTable to Ruby.
brixen authored
128 vm/builtin/compactlookuptable.hpp
44d61f8 @brixen Added Time C++ class and primitives.
brixen authored
129 vm/builtin/time.hpp
6d2f889 @brixen Made TaskProbe proper Ruby class shadow under Rubinius module.
brixen authored
130 vm/builtin/taskprobe.hpp
90820fa @rue Changed field extract order of Subtend files.
rue authored
131 vm/builtin/nativemethod.hpp
8bfb765 @rue Update field_extract list for System.
rue authored
132 vm/builtin/system.hpp
0de682b @brixen Added autoload.hpp to list of processed headers.
brixen authored
133 vm/builtin/autoload.hpp
b09a24c Wire the JIT in via MachineMethod
Evan Phoenix authored
134 vm/builtin/machine_method.hpp
e512828 @libc Rename BlockWrapper to Proc, and fix calling Method#to_proc
libc authored
135 vm/builtin/proc.hpp
77c68c4 Checkout. Add CallFrame
Evan Phoenix authored
136 vm/builtin/variable_scope.hpp
d5bcc5b Long returns and backtraces!
Evan Phoenix authored
137 vm/builtin/location.hpp
4c6a1ef Rework capi Handles entirely
Evan Phoenix authored
138 vm/builtin/capi_handle.hpp
025b132 Remove LookupTableAssociation, add GlobalCacheEntry
Evan Phoenix authored
139 vm/builtin/global_cache_entry.hpp
90c657e Clean up GC by making WeakRef first class
Evan Phoenix authored
140 vm/builtin/weakref.hpp
ecc013d @drbrain Ensure that test_instructions.hpp is included in runner.cpp generation.
drbrain authored
141 ]
142
07cabfc Make LLVM optional (and off by default)
Evan Phoenix authored
143 EXTERNALS = %W[ vm/external_libs/libmpa/libptr_array.a
d6b2ac1 @dbussink Fix a bunch of test issues on 64 bit platforms
dbussink authored
144 vm/external_libs/libcchash/libcchash.a
1dfd1f9 @dbussink Ugly but actually working fix for linux linking order
dbussink authored
145 vm/external_libs/libmquark/libmquark.a
569fccd @drbrain Move vm/Rakefile to rakelib/vm.rake, integrate it into the base rake …
drbrain authored
146 vm/external_libs/libtommath/libtommath.a
5f4023f @brixen Import parser from shotgun.
brixen authored
147 vm/external_libs/libbstring/libbstring.a
b5771b4 @brixen Import libgdtoa and use ruby_strtod instead of libc strtod.
brixen authored
148 vm/external_libs/libgdtoa/libgdtoa.a
569fccd @drbrain Move vm/Rakefile to rakelib/vm.rake, integrate it into the base rake …
drbrain authored
149 vm/external_libs/onig/.libs/libonig.a
150 vm/external_libs/libffi/.libs/libffi.a
151 vm/external_libs/libltdl/.libs/libltdl.a
152 vm/external_libs/libev/.libs/libev.a ]
07cabfc Make LLVM optional (and off by default)
Evan Phoenix authored
153
b09a24c Wire the JIT in via MachineMethod
Evan Phoenix authored
154
7153156 Add a configure script
Evan Phoenix authored
155 INCLUDES = EX_INC + %w[vm/test/cxxtest vm . vm/assembler vm/assembler/udis86-1.7]
32bc94b @drbrain Add /usr/local/include to pick up libexecinfo, disable strict aliasin…
drbrain authored
156 INCLUDES.map! { |f| "-I#{f}" }
d19313c Compile the kernel, and load it in
Evan Phoenix authored
157
bdcf9cb @rue DEV is gone. See `rake build:help`. vm:test always uses debug flags.
rue authored
158 # Default build options
a352624 Start of new LLVM JIT
Evan Phoenix authored
159 BASIC_FLAGS = %W[ -pipe -Wall -Wno-deprecated
0e1df2f @brixen Added rake install and rake uninstall tasks.
brixen authored
160 -DBASE_PATH=\\"#{RBX_BASE_PATH}\\"
161 -DRBA_PATH=\\"#{RBX_RBA_PATH}\\"
162 ]
9465f22 @brixen Enhanced handling of base directory path in executable.
brixen authored
163
a352624 Start of new LLVM JIT
Evan Phoenix authored
164 FLAGS = BASIC_FLAGS.dup
165
799bf3c @rue Work around compilation issue on OS X 10.5 GCC 4.3.
rue authored
166 # Check compiler preferences (LLVM may still override.)
167 CC = ENV['CC'] || "gcc"
168 CXX = ENV["CXX"] || "g++"
169
16da2bb Include -mdynamic-no-pic on OS X
Evan Phoenix authored
170 if RUBY_PLATFORM =~ /darwin/i
171 if `sw_vers` =~ /10\.4/
172 FLAGS.concat %w(-DHAVE_STRLCAT -DHAVE_STRLCPY)
173 end
799bf3c @rue Work around compilation issue on OS X 10.5 GCC 4.3.
rue authored
174
175 # This flag makes the executable non-relocatable (and
176 # slightly faster), but 4.3 does not support it.
177 # TODO: Look for workarounds.
178 unless `#{CC} -v 2>&1` =~ /gcc version 4\.3/i
179 FLAGS << "-mdynamic-no-pic"
180 end
7d35d7e @agardiner Add PortableUContext for platforms that need it
agardiner authored
181 end
a0c67de @rue Added grain to DEV. DEV=1 DOES NOT abort on warnings! Use DEV=2 norma…
rue authored
182
07cabfc Make LLVM optional (and off by default)
Evan Phoenix authored
183 if LLVM_ENABLE
0356ed3 Conditionalize using LLVM
Evan Phoenix authored
184 FLAGS << "-DENABLE_LLVM"
7153156 Add a configure script
Evan Phoenix authored
185 STDERR.puts "LLVM inclusion enabled."
186 =begin
a352624 Start of new LLVM JIT
Evan Phoenix authored
187 llvm_flags = `#{LLVM_CONFIG} --cflags`.split(/\s+/)
188 llvm_flags.delete_if { |e| e.index("-O") == 0 }
189 FLAGS.concat llvm_flags
926be1c @brixen Better fix for LLVM needing __STDC macros.
brixen authored
190 FLAGS << '-D__STDC_LIMIT_MACROS' unless FLAGS.include? '-D__STDC_LIMIT_MACROS'
191 FLAGS << '-D__STDC_CONSTANT_MACROS' unless FLAGS.include? '-D__STDC_CONSTANT_MACROS'
7153156 Add a configure script
Evan Phoenix authored
192 =end
07cabfc Make LLVM optional (and off by default)
Evan Phoenix authored
193 end
194
7310df7 Do proper libc function detection
Evan Phoenix authored
195 Rubinius::BUILD_CONFIG[:defines].each do |flag|
196 FLAGS << "-D#{flag}"
197 end
198
1565ff2 Make RBX_HOST a #define
Evan Phoenix authored
199 FLAGS << "-DRBX_HOST=\\\"#{RBX_HOST}\\\""
200
003fa6d Restore setup of DEV builds
Evan Phoenix authored
201 BUILD_PRETASKS = []
202
203 if ENV['DEV']
204 BUILD_PRETASKS << "build:debug_flags"
205 end
206
16da2bb Include -mdynamic-no-pic on OS X
Evan Phoenix authored
207 def compile_c(obj, src, output_kind="c")
7153156 Add a configure script
Evan Phoenix authored
208 flags = INCLUDES + FLAGS + llvm_flags
07cabfc Make LLVM optional (and off by default)
Evan Phoenix authored
209
9f159ff Add ability to compile project with LLVM
Evan Phoenix authored
210 if CONFIG.compile_with_llvm
211 flags << "-emit-llvm"
212 end
213
719c98f Fix Thread and Channel to interact properly
Evan Phoenix authored
214 # GROSS
215 if src == "vm/test/runner.cpp"
216 flags.delete_if { |f| /-O.*/.match(f) }
217 end
9465f22 @brixen Enhanced handling of base directory path in executable.
brixen authored
218
7d35d7e @agardiner Add PortableUContext for platforms that need it
agardiner authored
219 if src =~ /c$/
220 # command line option "-Wno-deprecated" is valid for C++ but not for C
221 flags.delete_if { |f| f == '-Wno-deprecated' }
222 end
223
719c98f Fix Thread and Channel to interact properly
Evan Phoenix authored
224 flags = flags.join(" ")
569fccd @drbrain Move vm/Rakefile to rakelib/vm.rake, integrate it into the base rake …
drbrain authored
225
7a3a84c @wilson Produce 'terse' build output by default. Use --trace to override.
wilson authored
226 if $verbose
16da2bb Include -mdynamic-no-pic on OS X
Evan Phoenix authored
227 sh "#{CC} #{flags} -#{output_kind} -o #{obj} #{src} 2>&1"
7a3a84c @wilson Produce 'terse' build output by default. Use --trace to override.
wilson authored
228 else
d19313c Compile the kernel, and load it in
Evan Phoenix authored
229 puts "CC #{src}"
16da2bb Include -mdynamic-no-pic on OS X
Evan Phoenix authored
230 sh "#{CC} #{flags} -#{output_kind} -o #{obj} #{src} 2>&1", :verbose => false
d19313c Compile the kernel, and load it in
Evan Phoenix authored
231 end
569fccd @drbrain Move vm/Rakefile to rakelib/vm.rake, integrate it into the base rake …
drbrain authored
232 end
233
f7cb6ca Add proper build steps for new JIT code
Evan Phoenix authored
234 def ld(t)
7153156 Add a configure script
Evan Phoenix authored
235 link_opts = llvm_link_flags()
d19313c Compile the kernel, and load it in
Evan Phoenix authored
236
7153156 Add a configure script
Evan Phoenix authored
237 link_opts += ' -Wl,--export-dynamic' if RUBY_PLATFORM =~ /linux/i
238 link_opts += ' -rdynamic' if RUBY_PLATFORM =~ /bsd/
4692b41 @rue Linux (at least) needs export-dynamic to dlopen self.
rue authored
239
d19313c Compile the kernel, and load it in
Evan Phoenix authored
240 ld = ENV['LD'] || 'g++'
9f159ff Add ability to compile project with LLVM
Evan Phoenix authored
241
242 if CONFIG.compile_with_llvm
243 objs = t.prerequisites.find_all { |f| f =~ /o$/ }.join(' ')
244
245 sh "llvm-link -f -o vm/tmp.bc #{objs}"
246 sh "opt -O3 -f -o vm/objs.bc vm/tmp.bc"
247 sh "rm vm/tmp.bc"
248 sh "llc -filetype=asm -f -o vm/objs.s vm/objs.bc"
249 sh "rm vm/objs.bc"
250 flags = INCLUDES + FLAGS
251 sh "gcc #{flags} -c -o vm/objs.o vm/objs.s"
252 sh "rm vm/objs.s"
253
254 o = (["vm/objs.o"] + t.prerequisites.find_all { |f| f =~ /a$/ }).join(' ')
255 else
256 o = t.prerequisites.find_all { |f| f =~ /[oa]$/ }.join(' ')
257 end
258
d19313c Compile the kernel, and load it in
Evan Phoenix authored
259 l = ex_libs.join(' ')
260
7a3a84c @wilson Produce 'terse' build output by default. Use --trace to override.
wilson authored
261 if $verbose
7153156 Add a configure script
Evan Phoenix authored
262 sh "#{ld} #{link_opts} -o #{t.name} #{o} #{l}"
7a3a84c @wilson Produce 'terse' build output by default. Use --trace to override.
wilson authored
263 else
d19313c Compile the kernel, and load it in
Evan Phoenix authored
264 puts "LD #{t.name}"
7153156 Add a configure script
Evan Phoenix authored
265 sh "#{ld} #{link_opts} -o #{t.name} #{o} #{l}", :verbose => false
d19313c Compile the kernel, and load it in
Evan Phoenix authored
266 end
267 end
268
569fccd @drbrain Move vm/Rakefile to rakelib/vm.rake, integrate it into the base rake …
drbrain authored
269 ############################################################
270 # Other Tasks
271
bdcf9cb @rue DEV is gone. See `rake build:help`. vm:test always uses debug flags.
rue authored
272 # Build options.
273 namespace :build do
274
275 # The top-level build task uses this, so undocumented.
255a070 @brixen Re-enabled instrumenting profiler.
brixen authored
276 task :normal => %w[ build:normal_flags build:profiler_flags build:build ]
bdcf9cb @rue DEV is gone. See `rake build:help`. vm:test always uses debug flags.
rue authored
277
278 desc "Show methods that are not inlined in the optimized build"
bd46f4c @brixen Fixed rake build tasks using profiler_flags.
brixen authored
279 task :inline => %w[ build:inline_flags build:profiler_flags build:build ]
bdcf9cb @rue DEV is gone. See `rake build:help`. vm:test always uses debug flags.
rue authored
280
281 desc "Build debug image for GDB. No optimizations, more warnings."
255a070 @brixen Re-enabled instrumenting profiler.
brixen authored
282 task :debug => %w[ build:debug_flags build:stats_flags
283 build:profiler_flags build:build ]
122e9ef @brixen Added build:stats task.
brixen authored
284
255a070 @brixen Re-enabled instrumenting profiler.
brixen authored
285 task :stats => %w[ build:normal_flags build:stats_flags
bd46f4c @brixen Fixed rake build tasks using profiler_flags.
brixen authored
286 build:profiler_flags build:build ]
bdcf9cb @rue DEV is gone. See `rake build:help`. vm:test always uses debug flags.
rue authored
287
288 desc "Build to check for possible problems in the code. See build:help."
289 task :strict => %w[ build:strict_flags build:build ]
290
291 desc "Build to enforce coding practices. See build:help for info."
292 task :ridiculous => %w[ build:ridiculous_flags build:build ]
293
5beed31 @rue Unf.. fix depends slightly. gcc -MM runs on builds only.
rue authored
294 desc "Generate dependency file"
b040ccf Fix dependencies calculation (and faster!)
Evan Phoenix authored
295 task :depends => dep_file
296
297 import dep_file
5beed31 @rue Unf.. fix depends slightly. gcc -MM runs on builds only.
rue authored
298
7153156 Add a configure script
Evan Phoenix authored
299 desc "Build LLVM"
300 task :llvm do
301 if LLVM_ENABLE and Rubinius::BUILD_CONFIG[:llvm] == :svn
302 unless File.file?("vm/external_libs/llvm/Release/bin/llvm-config")
dcb61a1 @dbussink Use the proper make on BSD like systems
dbussink authored
303 sh "cd vm/external_libs/llvm; ./configure #{llvm_config_flags} && #{make}"
7153156 Add a configure script
Evan Phoenix authored
304 end
305 end
306 end
307
bdcf9cb @rue DEV is gone. See `rake build:help`. vm:test always uses debug flags.
rue authored
308 # Issue the actual build commands. NEVER USE DIRECTLY.
003fa6d Restore setup of DEV builds
Evan Phoenix authored
309 task :build => BUILD_PRETASKS +
5beed31 @rue Unf.. fix depends slightly. gcc -MM runs on builds only.
rue authored
310 %w[
7153156 Add a configure script
Evan Phoenix authored
311 build:llvm
5beed31 @rue Unf.. fix depends slightly. gcc -MM runs on builds only.
rue authored
312 vm
bdcf9cb @rue DEV is gone. See `rake build:help`. vm:test always uses debug flags.
rue authored
313 kernel:build
314 lib/rbconfig.rb
ba590b2 @rue Enable lib/*.rb.ffi -> lib/*.rb processing as part of a build.
rue authored
315 build:ffi:preprocessor
bdcf9cb @rue DEV is gone. See `rake build:help`. vm:test always uses debug flags.
rue authored
316 extensions
317 ]
318
319 # Flag setup
320
321 task :normal_flags do
b137c8e Generate debug information in all builds
Evan Phoenix authored
322 FLAGS.concat %w[ -ggdb3 -O2 -Werror ]
bdcf9cb @rue DEV is gone. See `rake build:help`. vm:test always uses debug flags.
rue authored
323 end
324
325 task :inline_flags => :normal_flags do
9e458f1 @rue Move -Wuninitialized to build:inline (since it is useless with -O0.)
rue authored
326 FLAGS.concat %w[ -Winline -Wuninitialized ]
bdcf9cb @rue DEV is gone. See `rake build:help`. vm:test always uses debug flags.
rue authored
327 end
328
329 # -Wuninitialized requires -O, so it is not here.
b137c8e Generate debug information in all builds
Evan Phoenix authored
330 task :debug_flags => "build:normal_flags" do
003fa6d Restore setup of DEV builds
Evan Phoenix authored
331 FLAGS.delete "-O2"
dadf3c6 Conditionalize some debugging code
Evan Phoenix authored
332 FLAGS.concat %w[ -O0 -fno-inline -DRBX_DEBUG ]
bdcf9cb @rue DEV is gone. See `rake build:help`. vm:test always uses debug flags.
rue authored
333 end
334
122e9ef @brixen Added build:stats task.
brixen authored
335 task :stats_flags do
336 FLAGS.concat %w[ -DRBX_GC_STATS ]
337 end
338
255a070 @brixen Re-enabled instrumenting profiler.
brixen authored
339 task :profiler_flags do
340 FLAGS.concat %w[ -DRBX_PROFILER ] unless ENV['RBX_NO_PROFILER']
341 end
342
bdcf9cb @rue DEV is gone. See `rake build:help`. vm:test always uses debug flags.
rue authored
343 task :strict_flags => "build:debug_flags" do
9e458f1 @rue Move -Wuninitialized to build:inline (since it is useless with -O0.)
rue authored
344 FLAGS.concat %w[ -Wextra -W -pedantic
bdcf9cb @rue DEV is gone. See `rake build:help`. vm:test always uses debug flags.
rue authored
345 -Wshadow -Wfloat-equal -Wsign-conversion
9e458f1 @rue Move -Wuninitialized to build:inline (since it is useless with -O0.)
rue authored
346 -Wno-long-long -Wno-inline -Wno-unused-parameter
bdcf9cb @rue DEV is gone. See `rake build:help`. vm:test always uses debug flags.
rue authored
347 ]
348 end
349
350 task :ridiculous_flags => "build:strict_flags" do
003fa6d Restore setup of DEV builds
Evan Phoenix authored
351 FLAGS.concat %w[ -Weffc++ ]
bdcf9cb @rue DEV is gone. See `rake build:help`. vm:test always uses debug flags.
rue authored
352 end
353
354 desc "Print more information about the build task options."
355 task :help do
356 puts <<-ENDHELP
357
358 There are five ways to build the VM. Each of the last three
359 special tasks is cumulative with the one(s) above it:
360
361
362 Users
363 -------
364
365 build Build normal, optimized image.
366
367
368 Developers
369 ------------
370
371 build:inline Use to check if any methods requested to be
372 inlined were not. The image is otherwise the
373 normal optimized one.
374
375 build:debug Use when you need to debug in GDB. Builds an
376 image with debugging symbols, optimizations
377 are disabled and more warnings emitted by the
122e9ef @brixen Added build:stats task.
brixen authored
378 compiler. Also adds defines to turn on stats.
379
380 build:stats Use when you want to enable various VM stats,
381 like garbage collector or JIT stats. The build
382 is optimized but adds defines to turn on stats.
bdcf9cb @rue DEV is gone. See `rake build:help`. vm:test always uses debug flags.
rue authored
383
384 build:strict Use to check for and fix potential problems
385 in the codebase. Shows many more warnings.
386
387 build:ridiculous Use to enforce good practices. Adds warnings
388 for not abiding by "Efficient C++" guidelines
389 and treats all warnings as errors. It may be
390 necessary to disable some warning types for
391 this build.
392
393 Notes:
394 - If you do not want to use --trace but do want to see the exact
395 shell commands issued for compilation, invoke Rake thus:
396
397 `rake build:debug -- -v`
398
399 ENDHELP
400 end
401
ba590b2 @rue Enable lib/*.rb.ffi -> lib/*.rb processing as part of a build.
rue authored
402 namespace :ffi do
403
404 FFI_PREPROCESSABLES = %w[ lib/etc.rb
405 lib/fcntl.rb
406 lib/openssl/digest.rb
407 lib/syslog.rb
408 lib/zlib.rb
409 ]
410
411 # Generate the .rb files from lib/*.rb.ffi
412 task :preprocessor => FFI_PREPROCESSABLES
413
414 FFI::Generator::Task.new FFI_PREPROCESSABLES
415
416 end
417
bdcf9cb @rue DEV is gone. See `rake build:help`. vm:test always uses debug flags.
rue authored
418 end
419
420
421 # Compilation tasks
422
569fccd @drbrain Move vm/Rakefile to rakelib/vm.rake, integrate it into the base rake …
drbrain authored
423 rule '.o' do |t|
424 obj = t.name
7d35d7e @agardiner Add PortableUContext for platforms that need it
agardiner authored
425 src = t.prerequisites.find { |f| f =~ /#{File.basename obj, '.o'}\.((c(pp)?)|S)$/}
569fccd @drbrain Move vm/Rakefile to rakelib/vm.rake, integrate it into the base rake …
drbrain authored
426
d8b6f6b @drbrain Disambiguate compile_c from other possible compile methods
drbrain authored
427 compile_c obj, src
569fccd @drbrain Move vm/Rakefile to rakelib/vm.rake, integrate it into the base rake …
drbrain authored
428 end
429
16da2bb Include -mdynamic-no-pic on OS X
Evan Phoenix authored
430 rule '.S' do |t|
431 obj = t.name
0e2bc30 handle .S rule properly
Evan Phoenix authored
432 src = obj.gsub(/\.S$/, ".cpp")
16da2bb Include -mdynamic-no-pic on OS X
Evan Phoenix authored
433
434 compile_c obj, src, "S"
435 end
436
f7cb6ca Add proper build steps for new JIT code
Evan Phoenix authored
437 def files(targets, dependencies=nil, &block)
569fccd @drbrain Move vm/Rakefile to rakelib/vm.rake, integrate it into the base rake …
drbrain authored
438 targets.each do |target|
439 if dependencies then
440 file target => dependencies, &block
441 else
442 file target, &block
443 end
444 end
445 end
446
447 directory "vm/gen"
448 file "vm/type_info.o" => "vm/gen/typechecks.gen.cpp"
449 file "vm/primitives.hpp" => "vm/gen/primitives_declare.hpp"
ec70491 Fixed rakefile for vm/builtin move
Ryan Davis authored
450 files Dir["vm/builtin/*.hpp"], INSN_GEN
569fccd @drbrain Move vm/Rakefile to rakelib/vm.rake, integrate it into the base rake …
drbrain authored
451 files vm_objs, vm_srcs
a2ef6b4 A bunch more assembler/jit work
Evan Phoenix authored
452 files jit_objs, jit_srcs
569fccd @drbrain Move vm/Rakefile to rakelib/vm.rake, integrate it into the base rake …
drbrain authored
453
454 objs.zip(srcs).each do |obj, src|
455 file obj => src
456 end
457
4cecf54 Introduce InlineCache, a SendSite replacement
Evan Phoenix authored
458 objs.zip(srcs).each do |obj, src|
459 file "#{File.basename obj, '.o'}.S" => src
460 end
461
569fccd @drbrain Move vm/Rakefile to rakelib/vm.rake, integrate it into the base rake …
drbrain authored
462 files EXTERNALS do |t|
9752730 Revert the split index for building an external
Evan Phoenix authored
463 path = File.join(*split_all(t.name)[0..2])
569fccd @drbrain Move vm/Rakefile to rakelib/vm.rake, integrate it into the base rake …
drbrain authored
464 configure_path = File.join(path, 'configure')
465
466 if File.exist? configure_path then
239108c Add prebuilt LLVM support
Evan Phoenix authored
467 sh "cd #{path}; ./configure && #{make}"
569fccd @drbrain Move vm/Rakefile to rakelib/vm.rake, integrate it into the base rake …
drbrain authored
468 else
3bc5c5c @drbrain Use ENV to figure out make
drbrain authored
469 sh "cd #{path}; #{make}"
569fccd @drbrain Move vm/Rakefile to rakelib/vm.rake, integrate it into the base rake …
drbrain authored
470 end
471 end
472
6fabe0b Move udis86.a as a HACK to build properly
Evan Phoenix authored
473 if config.use_jit
474 EXTERNALS << "vm/assembler/libudis86.a"
475 end
476
19df0c6 Remove udis86 from being build by default
Evan Phoenix authored
477 file "vm/assembler/libudis86.a" do
578033a Don't run assembler tests at build time
Evan Phoenix authored
478 sh "cd vm/assembler; make libudis86.a"
19df0c6 Remove udis86 from being build by default
Evan Phoenix authored
479 end
480
346134d @brixen Line up deps.
brixen authored
481 file 'vm/primitives.o' => 'vm/codegen/field_extract.rb'
f3d26e9 @wilson Rebuild primitives.o when the primitive glue changes
wilson authored
482 file 'vm/primitives.o' => TYPE_GEN
346134d @brixen Line up deps.
brixen authored
483 file 'vm/codegen/field_extract.rb' => 'vm/gen'
719f0a0 Fixed dependency bug
Ryan Davis authored
484
fa2dd31 Make field_extract run only once
Evan Phoenix authored
485 task :run_field_extract do
ecc013d @drbrain Ensure that test_instructions.hpp is included in runner.cpp generation.
drbrain authored
486 field_extract field_extract_headers
569fccd @drbrain Move vm/Rakefile to rakelib/vm.rake, integrate it into the base rake …
drbrain authored
487 end
488
fa2dd31 Make field_extract run only once
Evan Phoenix authored
489 files TYPE_GEN, field_extract_headers + %w[vm/codegen/field_extract.rb] + [:run_field_extract] do
490 end
491
51a2393 @libc Rewire JIT
libc authored
492 file 'vm/jit-test' => EXTERNALS + objs + jit_objs + ["vm/drivers/jit-test.o", "vm/assembler/libudis86.a"] do |t|
a2ef6b4 A bunch more assembler/jit work
Evan Phoenix authored
493 ld t
494 end
495
51a2393 @libc Rewire JIT
libc authored
496 file "vm/drivers/jit-test.o" => "vm/drivers/jit-test.cpp" do
497 compile_c "vm/drivers/jit-test.o", "vm/drivers/jit-test.cpp"
498 end
499
569fccd @drbrain Move vm/Rakefile to rakelib/vm.rake, integrate it into the base rake …
drbrain authored
500 file 'vm/vm' => EXTERNALS + objs + vm_objs do |t|
7ed276a @drbrain Use ld instead of link to avoid overwriting FileUtils
drbrain authored
501 ld t
569fccd @drbrain Move vm/Rakefile to rakelib/vm.rake, integrate it into the base rake …
drbrain authored
502 end
503
504 file 'vm/gen/primitives_glue.gen.cpp' => hdrs
505
8684bc6 @drbrain tests depend on objs
drbrain authored
506 file 'vm/test/runner.cpp' => tests + objs do
cafd187 Implemented object_send primitive
Evan Phoenix authored
507 tests = tests.sort
508 puts "GEN vm/test/runner.cpp" unless $verbose
509 tests << { :verbose => $verbose }
569fccd @drbrain Move vm/Rakefile to rakelib/vm.rake, integrate it into the base rake …
drbrain authored
510 sh("vm/test/cxxtest/cxxtestgen.pl", "--error-printer", "--have-eh",
719cbea Fixup tests to deal with new size code
Evan Phoenix authored
511 "--abort-on-fail", "-include=string.h", "-include=stdlib.h",
512 "-include=vm/test/test_setup.h",
513 "-o", "vm/test/runner.cpp", *tests)
569fccd @drbrain Move vm/Rakefile to rakelib/vm.rake, integrate it into the base rake …
drbrain authored
514 end
515
5f4023f @brixen Import parser from shotgun.
brixen authored
516 file 'vm/parser/grammar.cpp' => 'vm/parser/grammar.y' do
517 src = 'vm/parser/grammar.y'
518 bison = "bison -o vm/parser/grammar.cpp #{src}"
519 if $verbose
520 sh bison
521 else
522 puts "BISON #{src}"
523 sh bison, :verbose => false
524 end
525 end
526
569fccd @drbrain Move vm/Rakefile to rakelib/vm.rake, integrate it into the base rake …
drbrain authored
527 file 'vm/test/runner.o' => 'vm/test/runner.cpp' # no rule .o => .cpp
528
529 file 'vm/test/runner' => EXTERNALS + objs + %w[vm/test/runner.o] do |t|
7ed276a @drbrain Use ld instead of link to avoid overwriting FileUtils
drbrain authored
530 ld t
569fccd @drbrain Move vm/Rakefile to rakelib/vm.rake, integrate it into the base rake …
drbrain authored
531 end
532
310a461 Cleanup stack usage and fix interpreter
Evan Phoenix authored
533 # A simple JIT tester driver
534
535 file 'vm/drivers/compile.o' => 'vm/drivers/compile.cpp'
536
537 file 'vm/compile' => EXTERNALS + objs + %w[vm/drivers/compile.o] do |t|
7ed276a @drbrain Use ld instead of link to avoid overwriting FileUtils
drbrain authored
538 ld t
310a461 Cleanup stack usage and fix interpreter
Evan Phoenix authored
539 end
540
9b60cfd @brixen Rework VM instruction parsing and generation.
brixen authored
541 # Generate files for instructions and interpreters
542
543 iparser = InstructionParser.new "vm/instructions.def"
544
545 def generate_instruction_file(parser, generator, name)
546 puts "GEN #{name}"
547 parser.parse
548 parser.send generator, name
549 end
550
551 insn_deps = %w[ vm/gen
552 vm/instructions.def
553 rakelib/instruction_parser.rb
554 ]
5beed31 @rue Unf.. fix depends slightly. gcc -MM runs on builds only.
rue authored
555
9b60cfd @brixen Rework VM instruction parsing and generation.
brixen authored
556 file "kernel/compiler/opcodes.rb" => insn_deps do |t|
557 generate_instruction_file iparser, :generate_definitions, t.name
569fccd @drbrain Move vm/Rakefile to rakelib/vm.rake, integrate it into the base rake …
drbrain authored
558 end
559
9b60cfd @brixen Rework VM instruction parsing and generation.
brixen authored
560 file "vm/gen/iseq_instruction_names.hpp" => insn_deps do |t|
561 generate_instruction_file iparser, :generate_names_header, t.name
16da2bb Include -mdynamic-no-pic on OS X
Evan Phoenix authored
562 end
563
9b60cfd @brixen Rework VM instruction parsing and generation.
brixen authored
564 file "vm/gen/iseq_instruction_names.cpp" => insn_deps do |t|
565 generate_instruction_file iparser, :generate_names, t.name
5beed31 @rue Unf.. fix depends slightly. gcc -MM runs on builds only.
rue authored
566 end
567
9b60cfd @brixen Rework VM instruction parsing and generation.
brixen authored
568 file "vm/gen/implementation_prototype.hpp" => insn_deps do |t|
569 generate_instruction_file iparser, :generate_prototypes, t.name
570 end
571
572 file "vm/gen/iseq_instruction_size.gen" => insn_deps do |t|
573 generate_instruction_file iparser, :generate_sizes, t.name
574 end
575
576 file "vm/gen/instruction_defines.hpp" => insn_deps do |t|
577 generate_instruction_file iparser, :generate_defines, t.name
578 end
579
580 file "vm/gen/instruction_locations.hpp" => insn_deps do |t|
581 generate_instruction_file iparser, :generate_locations, t.name
582 end
583
584 file "vm/gen/instruction_implementations.hpp" => insn_deps do |t|
585 generate_instruction_file iparser, :generate_implementations , t.name
586 end
587
588 file "vm/gen/inst_list.hpp" => insn_deps do |t|
589 generate_instruction_file iparser, :generate_visitors, t.name
590 end
5beed31 @rue Unf.. fix depends slightly. gcc -MM runs on builds only.
rue authored
591
9b60cfd @brixen Rework VM instruction parsing and generation.
brixen authored
592 file "vm/gen/inst_stack.hpp" => insn_deps do |t|
593 generate_instruction_file iparser, :generate_stack_effects, t.name
569fccd @drbrain Move vm/Rakefile to rakelib/vm.rake, integrate it into the base rake …
drbrain authored
594 end
595
ec70491 Fixed rakefile for vm/builtin move
Ryan Davis authored
596 namespace :vm do
a64c449 @drbrain Add filter argument for vm:test to set test suite
drbrain authored
597 desc 'Run all VM tests. Uses its argument as a filter of tests to run.'
598 task :test, :filter do |task, args|
599 ENV['SUITE'] = args[:filter] if args[:filter]
bebd2d1 Add coverage task back in as vm:coverage
Evan Phoenix authored
600 ENV['VERBOSE'] = '1' if $verbose
ec70491 Fixed rakefile for vm/builtin move
Ryan Davis authored
601 sh 'vm/test/runner', :verbose => $verbose
602 end
bdcf9cb @rue DEV is gone. See `rake build:help`. vm:test always uses debug flags.
rue authored
603
604 task :test => %w[ build:debug_flags vm/test/runner ]
ec70491 Fixed rakefile for vm/builtin move
Ryan Davis authored
605
bebd2d1 Add coverage task back in as vm:coverage
Evan Phoenix authored
606 task :coverage do
607 Dir.mkdir "vm/test/coverage" unless File.directory? "vm/test/coverage"
7153156 Add a configure script
Evan Phoenix authored
608 link_opts = llvm_link_flags()
bebd2d1 Add coverage task back in as vm:coverage
Evan Phoenix authored
609
7153156 Add a configure script
Evan Phoenix authored
610 flags = (INCLUDES + FLAGS + llvm_flags).join(' ')
bebd2d1 Add coverage task back in as vm:coverage
Evan Phoenix authored
611
612 puts "CC/LD vm/test/coverage/runner"
613 begin
9b60cfd @brixen Rework VM instruction parsing and generation.
brixen authored
614 path = "vm/instructions.cpp"
7153156 Add a configure script
Evan Phoenix authored
615 sh "#{CXX} -fprofile-arcs -ftest-coverage #{flags} -o vm/test/coverage/runner vm/test/runner.cpp vm/*.cpp vm/builtin/*.cpp #{path} #{link_opts} #{(ex_libs + EXTERNALS).join(' ')}"
221f2f1 @brixen Change instructions gen to not use a temp file (pair Ryan).
brixen authored
616
617 puts "RUN vm/test/coverage/runner"
618 sh "vm/test/coverage/runner"
619 if $verbose
620 sh "vm/test/lcov/bin/lcov --directory . --capture --output-file vm/test/coverage/app.info"
621 else
622 sh "vm/test/lcov/bin/lcov --directory . --capture --output-file vm/test/coverage/app.info > /dev/null 2>&1"
623 end
624
625 puts "GEN vm/test/coverage/index.html"
626 if $verbose
627 sh "cd vm/test/coverage; ../lcov/bin/genhtml app.info"
628 else
629 sh "cd vm/test/coverage; ../lcov/bin/genhtml app.info > /dev/null 2>&1"
bebd2d1 Add coverage task back in as vm:coverage
Evan Phoenix authored
630 end
631 ensure
632 sh "rm -f *.gcno *.gcda"
633 end
634 end
635
221f2f1 @brixen Change instructions gen to not use a temp file (pair Ryan).
brixen authored
636 # TODO: for ryan: fix up dependencies between rubypp and the source files now that they're persistent
637 # TODO: for ryan: dependencies on vm/test/test_instructions.hpp causes rebuild of vm/*.cpp files. lame
bebd2d1 Add coverage task back in as vm:coverage
Evan Phoenix authored
638
ec70491 Fixed rakefile for vm/builtin move
Ryan Davis authored
639 desc "Clean up vm build files"
640 task :clean do
641 files = [
3d3db89 Cleanup driver/*.o files
Evan Phoenix authored
642 objs, vm_objs, dep_file, TYPE_GEN, INSN_GEN,
9901699 @drbrain Fix vm:clean, simplify vm/instructions.{o,bc}
drbrain authored
643 'vm/gen',
72ad3d4 @drbrain Hook up more dependencies in vm.rake, especially for generated files.
drbrain authored
644 'vm/test/runner',
645 'vm/test/runner.cpp',
ac3e96c @brixen Fix vm:clean task.
brixen authored
646 'vm/test/runner.o',
b040ccf Fix dependencies calculation (and faster!)
Evan Phoenix authored
647 'vm/vm',
648 'vm/.deps'
9901699 @drbrain Fix vm:clean, simplify vm/instructions.{o,bc}
drbrain authored
649 ].flatten
ec70491 Fixed rakefile for vm/builtin move
Ryan Davis authored
650
651 files.each do |filename|
9901699 @drbrain Fix vm:clean, simplify vm/instructions.{o,bc}
drbrain authored
652 rm_rf filename, :verbose => $verbose
ec70491 Fixed rakefile for vm/builtin move
Ryan Davis authored
653 end
654 end
655
656 desc "Clean up, including all external libs"
657 task :distclean => :clean do
658 EXTERNALS.each do |lib|
db2be41 Fix for distclean trying to cd to a path that wasn't a directory
Ian Leitch authored
659 path = File.join(*(lib.split(File::SEPARATOR)[0..-2].reject{|i| i =~ /^\./}))
aa987bf Assume 'make clean' always works out
Evan Phoenix authored
660 system "cd #{path}; #{make} clean || true"
ec70491 Fixed rakefile for vm/builtin move
Ryan Davis authored
661 end
662 end
663
664 desc "Show which primitives are missing"
665 task :missing_primitives do
41bc510 @brixen Get list of primitives directly from kernel/**/*.rb files.
brixen authored
666 kernel_files = FileList['kernel/**/*.rb'].join " "
667 kernel_primitives = `grep 'Ruby.primitive' #{kernel_files} | awk '{ print $3 }'`
668 kernel_primitives = kernel_primitives.gsub(':', '').split("\n").sort.uniq
ec70491 Fixed rakefile for vm/builtin move
Ryan Davis authored
669
41bc510 @brixen Get list of primitives directly from kernel/**/*.rb files.
brixen authored
670 cpp_primitives = `grep 'Ruby.primitive' vm/builtin/*.hpp | awk '{ print $4 }'`
ec70491 Fixed rakefile for vm/builtin move
Ryan Davis authored
671 cpp_primitives = cpp_primitives.gsub(':', '').split("\n").sort.uniq
672
41bc510 @brixen Get list of primitives directly from kernel/**/*.rb files.
brixen authored
673 missing = kernel_primitives - cpp_primitives
ec70491 Fixed rakefile for vm/builtin move
Ryan Davis authored
674
675 puts missing.join("\n")
676 end
677 end
678
569fccd @drbrain Move vm/Rakefile to rakelib/vm.rake, integrate it into the base rake …
drbrain authored
679 ############################################################$
680 # Importers & Methods:
681
682 require 'rake/loaders/makefile'
865474f @brixen Enabled new dependency grapher.
brixen authored
683 require 'rakelib/dependency_grapher'
569fccd @drbrain Move vm/Rakefile to rakelib/vm.rake, integrate it into the base rake …
drbrain authored
684
d19313c Compile the kernel, and load it in
Evan Phoenix authored
685 generated = (TYPE_GEN + INSN_GEN).select { |f| f =~ /pp$/ }
72ad3d4 @drbrain Hook up more dependencies in vm.rake, especially for generated files.
drbrain authored
686
9b60cfd @brixen Rework VM instruction parsing and generation.
brixen authored
687 object_sources = srcs + vm_srcs + generated
72ad3d4 @drbrain Hook up more dependencies in vm.rake, especially for generated files.
drbrain authored
688
865474f @brixen Enabled new dependency grapher.
brixen authored
689 # vm/.depends.mf depends on all source and include files. If any of
690 # those files are newer than vm/.depends.mf, all dependencies are
691 # recalculated.
569fccd @drbrain Move vm/Rakefile to rakelib/vm.rake, integrate it into the base rake …
drbrain authored
692
865474f @brixen Enabled new dependency grapher.
brixen authored
693 file dep_file => hdrs + object_sources do |t|
b040ccf Fix dependencies calculation (and faster!)
Evan Phoenix authored
694 warn "Updating dependencies..."
865474f @brixen Enabled new dependency grapher.
brixen authored
695
08a196d @brixen Get libxml-ruby gem closer to building.
brixen authored
696 directories = ".", "vm", "vm/capi"
865474f @brixen Enabled new dependency grapher.
brixen authored
697 defines = FLAGS.join ' '
698 defines.slice!(/-Wno-deprecated/)
699
700 grapher = DependencyGrapher.new object_sources, directories, defines
701 grapher.process
702
703 File.open t.name, "w" do |file|
704 grapher.print_dependencies file
569fccd @drbrain Move vm/Rakefile to rakelib/vm.rake, integrate it into the base rake …
drbrain authored
705 end
706 end
707
708 def ex_libs # needs to be method to delay running of llvm_config
709 unless defined? $ex_libs then
1dfd1f9 @dbussink Ugly but actually working fix for linux linking order
dbussink authored
710 $ex_libs = EXTERNALS.reverse
8f0daef @drbrain Set libraries for FreeBSD
drbrain authored
711 $ex_libs << "-ldl" unless RUBY_PLATFORM =~ /bsd/
3d3c195 @dbussink Small build fixes for FreeBSD
dbussink authored
712 $ex_libs << "-lcrypt -L/usr/local/lib" if RUBY_PLATFORM =~ /bsd/
713 $ex_libs << "-lexecinfo" if RUBY_PLATFORM =~ /bsd/ && Rubinius::BUILD_CONFIG[:defines].include?('HAS_EXECINFO')
04f1ce9 @brixen A couple linux compile fixups from Mitchell Riley.
brixen authored
714 $ex_libs << "-lrt -lcrypt" if RUBY_PLATFORM =~ /linux/
569fccd @drbrain Move vm/Rakefile to rakelib/vm.rake, integrate it into the base rake …
drbrain authored
715
7153156 Add a configure script
Evan Phoenix authored
716 $ex_libs += llvm_lib_files
569fccd @drbrain Move vm/Rakefile to rakelib/vm.rake, integrate it into the base rake …
drbrain authored
717 end
718 $ex_libs
719 end
720
ecc013d @drbrain Ensure that test_instructions.hpp is included in runner.cpp generation.
drbrain authored
721 def field_extract(headers)
722 headers += [{ :verbose => $verbose}]
72ad3d4 @drbrain Hook up more dependencies in vm.rake, especially for generated files.
drbrain authored
723
8503a1c @wilson Move field_extract.rb under codegen directory
wilson authored
724 ruby('vm/codegen/field_extract.rb', *headers)
569fccd @drbrain Move vm/Rakefile to rakelib/vm.rake, integrate it into the base rake …
drbrain authored
725 end
Something went wrong with that request. Please try again.