Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 86 lines (67 sloc) 2.749 kb
86a6e29 @brixen Added gem task.
authored
1 require 'rake/gempackagetask'
0770716 @brixen A simple task.
authored
2
b5e3410 @brixen Add greg-based parser.
authored
3 task :default => :spec
4
5 desc "Run the specs (default)"
6 task :spec => :build do
7 sh "mspec spec"
0770716 @brixen A simple task.
authored
8 end
9
b5e3410 @brixen Add greg-based parser.
authored
10 C = RbConfig::CONFIG
11 CC = ENV['CC'] || C['CC']
12 CFLAGS = ENV['CFLAGS'] || C['CFLAGS']
13 LDSHARED = ENV['LDSHARED'] || C['LDSHARED']
14 LDFLAGS = ENV['LDFLAGS'] || C['LDFLAGS']
15 dlext = C['DLEXT']
16
17 parser_d = File.expand_path "../lib/poison/bootstrap/parser/ext", __FILE__
18 parser_g = parser_d + "/parser.g"
19 parser_c = parser_d + "/parser.c"
20 parser_o = parser_d + "/parser.o"
21 parser_e = parser_d + "/parser.#{dlext}"
22
ec27d19 @brixen Imported greg from Potion.
authored
23 greg = File.expand_path "../tools/greg", __FILE__
24
25 file parser_c => [greg, parser_g] do |t|
26 sh "tools/greg #{t.prerequisites.last} > #{t.name}"
b5e3410 @brixen Add greg-based parser.
authored
27 end
0770716 @brixen A simple task.
authored
28
b5e3410 @brixen Add greg-based parser.
authored
29 file parser_o => parser_c do |t|
30 sh "#{CC} -o #{t.name} -I#{C['rubyhdrdir']} #{CFLAGS} -c #{t.prerequisites.first}"
0770716 @brixen A simple task.
authored
31 end
32
b5e3410 @brixen Add greg-based parser.
authored
33 file parser_e => parser_o do |t|
34 sh "#{LDSHARED} -o #{t.name} #{LDFLAGS} #{t.prerequisites.first}"
35 end
0770716 @brixen A simple task.
authored
36
b5e3410 @brixen Add greg-based parser.
authored
37 desc "Generate the parser source"
38 task :parser => parser_c
0770716 @brixen A simple task.
authored
39
b5e3410 @brixen Add greg-based parser.
authored
40 desc "Build the parser extension"
41 task :build => [:parser, parser_e]
42
43 desc "Clean the parser extension files"
44 task :clean do
ec27d19 @brixen Imported greg from Potion.
authored
45 rm_f Dir[parser_d + "/{parser.c,*.o,*.#{dlext}}"]
3420c90 @vic Remove rbc files on clean task
vic authored
46 rm_f FileList["**/*.rbc"]
ec27d19 @brixen Imported greg from Potion.
authored
47 end
48
49 desc "Build greg parser generator"
50 file greg do
51 sh "#{CC} -O3 -DNDEBUG -o tools/greg tools/greg.c tools/compile.c tools/tree.c -Itools"
0770716 @brixen A simple task.
authored
52 end
86a6e29 @brixen Added gem task.
authored
53
54 spec = Gem::Specification.new do |s|
55 require File.expand_path('../lib/poison/version', __FILE__)
56
57 s.name = "poison"
58 s.version = Poison::VERSION.to_s
59
60 s.specification_version = 2 if s.respond_to? :specification_version=
61
62 s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
63 s.authors = ["Brian Ford"]
64 s.date = %q{2010-11-06}
65 s.email = %q{brixen@gmail.com}
66 s.has_rdoc = true
67 s.extra_rdoc_files = %w[ README LICENSE ]
68 s.executables = ["poison"]
69 s.files = FileList[ '{bin,lib,spec}/**/*.{yaml,txt,rb}', 'Rakefile', *s.extra_rdoc_files ]
70 s.homepage = %q{http://github.com/brixen/poison}
71 s.require_paths = ["lib"]
72 s.rubygems_version = %q{1.3.5}
73 s.summary = "Poison is an interpretation of Potion on the Rubinius VM."
74 s.description = <<EOS
75 Poison is a programming language based on Potion by Why The Lucky Stiff
76 that runs on the Rubinius VM.
77 EOS
78
79 s.rdoc_options << '--title' << 'Poison Gem' <<
80 '--main' << 'README' <<
81 '--line-numbers'
f830ac9 @brixen Add mspec as a dependency.
authored
82 s.add_dependency 'mspec', '~> 1.5.0'
86a6e29 @brixen Added gem task.
authored
83 end
84
85 Rake::GemPackageTask.new(spec){ |pkg| pkg.gem_spec = spec }
Something went wrong with that request. Please try again.