Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 165 lines (145 sloc) 4.823 kb
cc28068 Rearranged rake setup a lot, making browsing more intuitive (build secti...
Ryan Davis authored
1 desc "Build extensions from lib/ext"
2 task :extensions => %w[
ad861fe @brixen Added Melbourne parser extension.
brixen authored
3 extension:melbourne
3610ac3 @rue Build readline as part of `rake build`. Cleaned up lib/bin/compile.rb.
rue authored
4 extension:readline
9d7522a @rue Enable compiling the Digest extensions through `rake extension:digest`.
rue authored
5 extension:digest
0eb8c0f @brixen Added bigdecimal extension.
brixen authored
6 extension:bigdecimal
7cf24f4 @brixen Rake task to compile syck extension.
brixen authored
7 extension:syck
cc28068 Rearranged rake setup a lot, making browsing more intuitive (build secti...
Ryan Davis authored
8 ]
3610ac3 @rue Build readline as part of `rake build`. Cleaned up lib/bin/compile.rb.
rue authored
9
10 # lib/etc.rb
11 # lib/fcntl.rb
12 # lib/openssl/digest.rb
13 # lib/syslog.rb
14 # lib/zlib.rb
15
93747eb @drbrain Bring in extensions and platform stuff from shotgun
drbrain authored
16 #
3610ac3 @rue Build readline as part of `rake build`. Cleaned up lib/bin/compile.rb.
rue authored
17 # Ask the VM to build an extension from source.
18 #
7b861c6 @brixen Reorganized and renamed the C-API.
brixen authored
19 def compile_extension(path, flags = "-p -I#{Dir.pwd}/vm/capi")
a352624 Start of new LLVM JIT
Evan Phoenix authored
20 cflags = BASIC_FLAGS.reject {|f| f =~ /-Wno-deprecated|-Weffc\+\+/ }
3610ac3 @rue Build readline as part of `rake build`. Cleaned up lib/bin/compile.rb.
rue authored
21
3345de6 @rue Deeper DEV flags, added -Wextra to both. Extensions use the build flags.
rue authored
22 cflags.each {|flag| flags << " -C,#{flag}" }
23
3ffd142 @brixen Always compile extensions with debug symbols.
brixen authored
24 # @todo: this is a hack because the change from FLAGS above to
25 # BASIC_FLAGS means the debug flags don't come through. this
26 # all needs to be sorted out with a build system rewrite.
27 flags << " -C,-ggdb3"
28
f4290fe @brixen Added build command for toplevel Digest ext.
brixen authored
29 verbose = $verbose ? "-d" : ""
3610ac3 @rue Build readline as part of `rake build`. Cleaned up lib/bin/compile.rb.
rue authored
30
f4290fe @brixen Added build command for toplevel Digest ext.
brixen authored
31 command = "./bin/rbx compile #{verbose} #{flags} #{path}"
32
33 if $verbose
34 sh command
35 else
36 puts "Building extension #{path}"
37 sh command, :verbose => false
38 end
3610ac3 @rue Build readline as part of `rake build`. Cleaned up lib/bin/compile.rb.
rue authored
39 end
cc28068 Rearranged rake setup a lot, making browsing more intuitive (build secti...
Ryan Davis authored
40
41 namespace :extension do
3610ac3 @rue Build readline as part of `rake build`. Cleaned up lib/bin/compile.rb.
rue authored
42
43 desc "Cleans all C extension libraries and build products."
93747eb @drbrain Bring in extensions and platform stuff from shotgun
drbrain authored
44 task :clean do
3610ac3 @rue Build readline as part of `rake build`. Cleaned up lib/bin/compile.rb.
rue authored
45 Dir["lib/ext/**/*.{o,#{$dlext}}"].each do |f|
93747eb @drbrain Bring in extensions and platform stuff from shotgun
drbrain authored
46 rm_f f, :verbose => $verbose
47 end
48 end
49
0eb8c0f @brixen Added bigdecimal extension.
brixen authored
50 desc "Build the bigdecimal extension"
51 task :bigdecimal => %W[kernel:build lib/ext/bigdecimal/bigdecimal.#{$dlext}]
52 file "lib/ext/bigdecimal/bigdecimal.#{$dlext}" => FileList[
53 "lib/ext/bigdecimal/build.rb",
54 "lib/ext/bigdecimal/bigdecimal.c",
55 "lib/ext/bigdecimal/bigdecimal.h",
56 "vm/capi/ruby.h"
57 ] do
58 compile_extension 'lib/ext/bigdecimal'
59 end
60
3610ac3 @rue Build readline as part of `rake build`. Cleaned up lib/bin/compile.rb.
rue authored
61 desc "Build the readline extension"
67512db @drbrain Fix dependencies for drake
drbrain authored
62 task :readline => %W[kernel:build lib/ext/readline/readline.#{$dlext}]
3610ac3 @rue Build readline as part of `rake build`. Cleaned up lib/bin/compile.rb.
rue authored
63
64 file "lib/ext/readline/readline.#{$dlext}" => FileList[
65 "lib/ext/readline/build.rb",
e3ddbf8 @brixen Ensure C ext are built if ruby.h changes.
brixen authored
66 "lib/ext/readline/readline.c",
7b861c6 @brixen Reorganized and renamed the C-API.
brixen authored
67 "vm/capi/ruby.h"
3610ac3 @rue Build readline as part of `rake build`. Cleaned up lib/bin/compile.rb.
rue authored
68 ] do
69 compile_extension 'lib/ext/readline'
70 end
71
9d7522a @rue Enable compiling the Digest extensions through `rake extension:digest`.
rue authored
72 desc "Build the Digest extensions"
f4290fe @brixen Added build command for toplevel Digest ext.
brixen authored
73 task :digest => %w[extension:digest:digest
74 extension:digest:md5
75 extension:digest:rmd160
76 extension:digest:sha1
77 extension:digest:sha2
78 extension:digest:bubblebabble]
93747eb @drbrain Bring in extensions and platform stuff from shotgun
drbrain authored
79
9d7522a @rue Enable compiling the Digest extensions through `rake extension:digest`.
rue authored
80 namespace :digest do
0b51f8c Fixed deps for the rest of the extensions
Ryan Davis authored
81 def digest_task name
82 desc "Build Digest's #{name} extension."
67512db @drbrain Fix dependencies for drake
drbrain authored
83 task name => %W[kernel:build lib/ext/digest/#{name}/#{name}.#{$dlext}]
0b51f8c Fixed deps for the rest of the extensions
Ryan Davis authored
84 file "lib/ext/digest/#{name}/#{name}.#{$dlext}" =>
85 FileList["lib/ext/digest/#{name}/build.rb",
86 "lib/ext/digest/#{name}/{#{name},#{name}init}.c",
87 "lib/ext/digest/#{name}/#{name}.h",
e3ddbf8 @brixen Ensure C ext are built if ruby.h changes.
brixen authored
88 "lib/ext/digest/defs.h",
7b861c6 @brixen Reorganized and renamed the C-API.
brixen authored
89 "vm/capi/ruby.h"
e3ddbf8 @brixen Ensure C ext are built if ruby.h changes.
brixen authored
90 ] do
9eeed20 @rue Change Digest extension task to use new #compile_extension syntax.
rue authored
91 compile_extension "lib/ext/digest/#{name}"
9d7522a @rue Enable compiling the Digest extensions through `rake extension:digest`.
rue authored
92 end
93 end
cc28068 Rearranged rake setup a lot, making browsing more intuitive (build secti...
Ryan Davis authored
94
f4290fe @brixen Added build command for toplevel Digest ext.
brixen authored
95 desc "Build Digest extension."
96 task :digest => %W[kernel:build lib/ext/digest/digest.#{$dlext}]
97 file "lib/ext/digest/digest.#{$dlext}" =>
98 FileList["lib/ext/digest/build.rb",
99 "lib/ext/digest/digest.c",
100 "lib/ext/digest/digest.h",
101 "lib/ext/digest/defs.h",
7b861c6 @brixen Reorganized and renamed the C-API.
brixen authored
102 "vm/capi/ruby.h"
f4290fe @brixen Added build command for toplevel Digest ext.
brixen authored
103 ] do
104 compile_extension "lib/ext/digest"
105 end
106
0b51f8c Fixed deps for the rest of the extensions
Ryan Davis authored
107 digest_task "md5"
108 digest_task "rmd160"
109 digest_task "sha1"
110 digest_task "sha2"
f4290fe @brixen Added build command for toplevel Digest ext.
brixen authored
111 digest_task "bubblebabble"
0b51f8c Fixed deps for the rest of the extensions
Ryan Davis authored
112 end
7cf24f4 @brixen Rake task to compile syck extension.
brixen authored
113
114 desc "Build the syck extension"
115 task :syck => %W[kernel:build lib/ext/syck/syck.#{$dlext}]
116 file "lib/ext/syck/syck.#{$dlext}" => FileList[
117 "lib/ext/syck/build.rb",
118 "lib/ext/syck/bytecode.c",
119 "lib/ext/syck/emitter.c",
120 "lib/ext/syck/gram.c",
121 "lib/ext/syck/gram.h",
122 "lib/ext/syck/handler.c",
123 "lib/ext/syck/implicit.c",
124 "lib/ext/syck/node.c",
125 "lib/ext/syck/rubyext.c",
126 "lib/ext/syck/syck.h",
127 "lib/ext/syck/syck.c",
128 "lib/ext/syck/token.c",
129 "lib/ext/syck/yaml2byte.c",
130 "lib/ext/syck/yamlbyte.h",
131 "lib/ext/syck/st.h",
132 "lib/ext/syck/st.c",
133 "vm/capi/ruby.h"
134 ] do
135 compile_extension 'lib/ext/syck'
136 end
ad861fe @brixen Added Melbourne parser extension.
brixen authored
137
02c813d @brixen Put melbourne ext for rbx in a subdir.
brixen authored
138 directory "lib/ext/melbourne/rbx"
139
ad861fe @brixen Added Melbourne parser extension.
brixen authored
140 desc "Build the melbourne extension"
02c813d @brixen Put melbourne ext for rbx in a subdir.
brixen authored
141 task :melbourne => %W[kernel:build lib/ext/melbourne/rbx/melbourne.#{$dlext}]
142 file "lib/ext/melbourne/rbx/melbourne.#{$dlext}" => FileList[
143 "lib/ext/melbourne/rbx",
ad861fe @brixen Added Melbourne parser extension.
brixen authored
144 "lib/ext/melbourne/build.rb",
145 "lib/ext/melbourne/grammar.y",
146 "lib/ext/melbourne/grammar.hpp",
147 "lib/ext/melbourne/grammar.cpp",
148 "lib/ext/melbourne/internal.hpp",
149 "lib/ext/melbourne/melbourne.cpp",
150 "lib/ext/melbourne/node.hpp",
151 "lib/ext/melbourne/visitor.hpp",
152 "lib/ext/melbourne/visitor.cpp",
153 "lib/ext/melbourne/local_state.hpp",
154 "lib/ext/melbourne/node_types.hpp",
155 "lib/ext/melbourne/node_types.cpp",
dde577c @brixen Avoid repeatedly looking up symbols in melbourne.
brixen authored
156 "lib/ext/melbourne/symbols.hpp",
157 "lib/ext/melbourne/symbols.cpp",
ad861fe @brixen Added Melbourne parser extension.
brixen authored
158 "lib/ext/melbourne/var_table.hpp",
159 "lib/ext/melbourne/var_table.cpp",
c211e5e @brixen Interface changes for melbourne processor.
brixen authored
160 "vm/capi/ruby.h"
ad861fe @brixen Added Melbourne parser extension.
brixen authored
161 ] do
162 compile_extension "lib/ext/melbourne"
163 end
cc28068 Rearranged rake setup a lot, making browsing more intuitive (build secti...
Ryan Davis authored
164 end
Something went wrong with that request. Please try again.