source: LMDZ6/branches/Amaury_dev/tools/fcm/lib/FCM/System/Make/Build/Task/Compile/C.pm @ 5095

Last change on this file since 5095 was 5095, checked in by abarral, 2 months ago

Revert cosp*/ from the trunk, as it's external code
Add missing bits from FCM2 source

File size: 2.1 KB
Line 
1# ------------------------------------------------------------------------------
2# Copyright (C) 2006-2021 British Crown (Met Office) & Contributors.
3#
4# This file is part of FCM, tools for managing and building source code.
5#
6# FCM is free software: you can redistribute it and/or modify
7# it under the terms of the GNU General Public License as published by
8# the Free Software Foundation, either version 3 of the License, or
9# (at your option) any later version.
10#
11# FCM is distributed in the hope that it will be useful,
12# but WITHOUT ANY WARRANTY; without even the implied warranty of
13# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14# GNU General Public License for more details.
15#
16# You should have received a copy of the GNU General Public License
17# along with FCM. If not, see <http://www.gnu.org/licenses/>.
18# ------------------------------------------------------------------------------
19use strict;
20use warnings;
21# ------------------------------------------------------------------------------
22package FCM::System::Make::Build::Task::Compile::C;
23use base qw{FCM::System::Make::Build::Task::Compile};
24
25our %PROP_OF = (
26    'cc'               => 'gcc',
27    'cc.defs'          => '',
28    'cc.flags'         => '',
29    'cc.flag-compile'  => '-c',
30    'cc.flag-define'   => '-D%s',
31    'cc.flag-include'  => '-I%s',
32    'cc.flag-omp'      => '',
33    'cc.flag-output'   => '-o%s',
34    'cc.include-paths' => '',
35);
36
37sub new {
38    my ($class, $attrib_ref) = @_;
39    bless(
40        $class->SUPER::new(
41            {name => 'cc', prop_of => sub {return {%PROP_OF}}, %{$attrib_ref}},
42        ),
43        $class,
44    );
45}
46
47# ------------------------------------------------------------------------------
481;
49__END__
50
51=head1 NAME
52
53FCM::System::Make::Build::Task::Compile::C
54
55=head1 SYNOPSIS
56
57    use FCM::System::Make::Build::Task::Compile::C;
58    my $task = FCM::System::Make::Build::Task::Compile::C->new(\%attrib);
59    $task->main($target);
60
61=head1 DESCRIPTION
62
63Wraps L<FCM::System::Make::Build::Task::Compile> to compile a C source into an
64object.
65
66=head1 COPYRIGHT
67
68Copyright (C) 2006-2021 British Crown (Met Office) & Contributors.
69
70=cut
Note: See TracBrowser for help on using the repository browser.