-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathRakefile
27 lines (21 loc) · 819 Bytes
/
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
require "bundler/gem_tasks"
require "rake/clean"
require "rdoc/task"
task :default => :test
CLEAN.concat(FileList["lib/tecsgen/core/*.tab.rb"])
CLEAN.concat(FileList["lib/tecsgen/core/*.log"])
desc "Generate files"
task :generate => [:bnf, :yydebug, :c_parser]
task :bnf => ["lib/tecsgen/core/bnf.tab.rb"]
task :yydebug => ["lib/tecsgen/core/bnf-deb.tab.rb"]
task :c_parser => ["lib/tecsgen/core/C_parser.tab.rb"]
file "lib/tecsgen/core/bnf-deb.tab.rb" => ["lib/tecsgen/core/bnf.y"] do |t|
sh "bundle exec racc -O #{t.name}.log -v -g -o #{t.name} #{t.prerequisites.join(" ")}"
end
rule ".tab.rb" => [".y"] do |t|
sh "bundle exec racc -O #{t.name}.log -v -o #{t.name} #{t.source}"
end
RDoc::Task.new do |rdoc|
rdoc.main = "README.md"
rdoc.rdoc_files.include("README.md", "README.ja.md", "lib/**/*.rb")
end