Rakefile in ruby-vpi-21.0.0 vs Rakefile in ruby-vpi-21.1.0
- old
+ new
@@ -1,8 +1,12 @@
# = Environment variables
-# CFLAGS:: Arguments to the compiler.
-# LDFLAGS:: Arguments to the linker.
+#
+# CFLAGS :: Override the default options passed to the compiler.
+# CFLAGS_EXTRA :: Provide additional options for the compiler.
+# LDFLAGS :: Override the default options passed to the linker.
+# LDFLAGS_EXTRA :: Provide additional options for the linker.
+#
#--
# Copyright 2006 Suraj N. Kurapati
# See the file named LICENSE for details.
require 'rake/clean'
@@ -53,12 +57,12 @@
task :build
directory 'obj'
CLOBBER.include 'obj'
- ccFlags = ENV['CFLAGS']
- ldFlags = ENV['LDFLAGS']
+ ccFlags = ENV['CFLAGS_EXTRA']
+ ldFlags = ENV['LDFLAGS_EXTRA']
RubyVPI::SIMULATORS.each do |sim|
taskName = "build_#{sim.id}"
desc "Builds object files for #{sim.name}."
@@ -66,12 +70,12 @@
src = RubyVPI::Project[:name] + '.' + Config::CONFIG['DLEXT']
dst = File.expand_path(File.join('obj', "#{sim.id}.so"))
unless File.exist? dst
cd 'ext' do
- ENV['CFLAGS'] = [ccFlags, sim.compiler_args].compact.join(' ')
- ENV['LDFLAGS'] = [ldFlags, sim.linker_args].compact.join(' ')
+ ENV['CFLAGS_EXTRA'] = [ccFlags, sim.compiler_args].compact.join(' ')
+ ENV['LDFLAGS_EXTRA'] = [ldFlags, sim.linker_args].compact.join(' ')
sh "rake SIMULATOR=#{sim.id}"
mv src, dst
sh 'rake clean'
end
@@ -81,16 +85,17 @@
task :build => taskName
end
# documentation
desc "Build the documentation."
- task :doc
+ task :doc => 'doc/guide'
- # the user guide
+ desc 'Generate the HTML user guide.'
+ task 'doc/guide' => 'doc/guide.html'
+
file 'doc/guide.html' => 'doc/guide.erb' do |t|
sh "gerbil -u html #{t.prerequisites} > #{t.name}"
end
- task :doc => 'doc/guide.html'
CLOBBER.include 'doc/guide.html'
# API reference
directory 'doc/api'
CLOBBER.include 'doc/api'