NAME
Build::Hopen::T::Gnu::C - support for the GNU toolset, C language
SYNOPSIS
In a hopen file:
use language 'C';
my $op = C->new(op=>'compile');
# Create instances manually
# Or use via Build::Hopen::G::GraphBuilder:
$Build->H::files(...)->C::compile->default_goal;
The inputs come from earlier in the build graph. TODO support specifying compiler arguments.
ATTRIBUTES
op
What this node is going to do: compile or link.
files
Arrayref of which files this node will process. Values are destination file names. Extensions may be added.
STATIC FUNCTIONS
Arguments to the static functions are parsed using Build::Hopen::Arrrgs. Therefore, named arguments start with a hyphen (e.g., -name=>'foo', not name=>'foo').
compile
Create a new with "op" set to compile. Inputs come from the build graph, so parameters other than -name are disregarded (TODO permit specifying compilation options or object-file names). Usage:
use language 'C';
$builder_or_dag->H::files('file1.c')->C::compile([-name=>'node name']);
link
Create a new with "op" set to link. Pass the name of the executable. Usage:
use language 'C';
$builder_or_dag->C::link('file1'[, -name=>'node name');
MEMBER FUNCTIONS
_run
Create the compile or link command lines.
BUILD
Find the C compiler.
TODO should this happen when the DAG runs? Maybe toolsets should get the chance to add a node to the beginning of the graph, before anything else runs. TODO figure this out.