Class: Rscons::Builders::CFile
- Inherits:
-
Rscons::Builder
- Object
- Rscons::Builder
- Rscons::Builders::CFile
- Defined in:
- lib/rscons/builders/cfile.rb
Overview
Build a C or C++ source file given a lex (.l, .ll) or yacc (.y, .yy) input file.
- Examples
-
env.CFile(“parser.tab.cc”, “parser.yy”) env.CFile(“lex.yy.cc”, “parser.ll”)
Instance Attribute Summary
Attributes inherited from Rscons::Builder
#build_step, #cache, #env, #preferred_ld, #side_effects, #sources, #target, #vars
Instance Method Summary collapse
-
#run(options) ⇒ Object
Run the builder to produce a build target.
Methods inherited from Rscons::Builder
#depends, extra_path, #finalize_command, #initialize, name, #name, #print_run_message, #produces, #register_command, #standard_command, #wait_for
Constructor Details
This class inherits a constructor from Rscons::Builder
Instance Method Details
#run(options) ⇒ Object
Run the builder to produce a build target.
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/rscons/builders/cfile.rb', line 12 def run() if @command finalize_command else @vars["_TARGET"] = @target @vars["_SOURCES"] = @sources case when @sources.first.end_with?(*@env.("${LEXSUFFIX}")) cmd = "LEX" = "Generating lexer" when @sources.first.end_with?(*@env.("${YACCSUFFIX}")) cmd = "YACC" = "Generating parser" else raise "Unknown source file #{@sources.first.inspect} for CFile builder" end command = @env.build_command("${#{cmd}_CMD}", @vars) standard_command("#{} from <source>#{Util.short_format_paths(@sources)}<reset> => <target>#{@target}<reset>", command) end end |