-
Notifications
You must be signed in to change notification settings - Fork 1
/
Rakefile
89 lines (69 loc) · 2.82 KB
/
Rakefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
require 'rake/gempackagetask'
task :default => :spec
desc "Run the specs (default)"
task :spec => :build do
sh "mspec spec"
end
C = RbConfig::CONFIG
CC = ENV['CC'] || C['CC']
CFLAGS = ENV['CFLAGS'] || C['CFLAGS']
LDSHARED = ENV['LDSHARED'] || C['LDSHARED']
LDFLAGS = ENV['LDFLAGS'] || C['LDFLAGS']
dlext = C['DLEXT']
parser_d = File.expand_path "../lib/syme/bootstrap/parser/ext", __FILE__
parser_g = parser_d + "/parser.g"
parser_c = parser_d + "/parser.c"
parser_o = parser_d + "/parser.o"
parser_e = parser_d + "/parser.#{dlext}"
greg = File.expand_path "../tools/greg", __FILE__
file parser_c => [greg, parser_g] do |t|
sh "tools/greg #{t.prerequisites.last} > #{t.name}"
end
file parser_o => parser_c do |t|
sh "#{CC} -o #{t.name} -I#{C['rubyhdrdir']} #{CFLAGS} -c #{t.prerequisites.first}"
end
file parser_e => parser_o do |t|
sh "#{LDSHARED} -o #{t.name} #{LDFLAGS} #{t.prerequisites.first}"
end
desc "Generate the parser source"
task :parser => parser_c
desc "Build the parser extension"
task :build => [:parser, parser_e]
desc "Clean the parser extension files"
task :clean do
rm_f Dir[parser_d + "/{parser.c,*.o,*.#{dlext}}"]
end
desc "Build greg parser generator"
task :greg => greg
file greg do
sh "#{CC} -O3 -DNDEBUG -o tools/greg tools/greg.c tools/compile.c tools/tree.c -Itools"
end
spec = Gem::Specification.new do |s|
require File.expand_path('../lib/syme/version', __FILE__)
s.name = "syme"
s.version = Syme::VERSION.to_s
s.specification_version = 2 if s.respond_to? :specification_version=
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
s.authors = ["Brian Ford"]
s.date = %q{2010-11-06}
s.email = %q{brixen@gmail.com}
s.has_rdoc = true
s.extra_rdoc_files = %w[ README LICENSE ]
s.executables = ["syme"]
s.files = FileList[ '{bin,lib,spec}/**/*.{yaml,txt,rb}', 'Rakefile', *s.extra_rdoc_files ]
s.homepage = %q{http://github.com/brixen/syme}
s.require_paths = ["lib"]
s.rubygems_version = %q{1.3.5}
s.summary = "Syme is an interpretation of Newspeak on the Rubinius VM."
s.description = <<EOS
Newspeak is a programming language in the Smalltalk/Self tradition by
Gilad Bracha, Peter Ahe, Vassili Bykov, Eliot Miranda, Bill Maddox,
and Yaron Kashai. See http://newspeaklanguage.org/.
Syme is an implementation of Newspeak that runs on the Rubinius VM.
EOS
s.rdoc_options << '--title' << 'Syme Gem' <<
'--main' << 'README' <<
'--line-numbers'
s.add_dependency 'mspec', '~> 1.5.0'
end
Rake::GemPackageTask.new(spec){ |pkg| pkg.gem_spec = spec }