[10669] | 1 | # ------------------------------------------------------------------------------ |
---|
| 2 | # (C) British Crown Copyright 2006-17 Met Office. |
---|
| 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 | # ------------------------------------------------------------------------------ |
---|
| 19 | use strict; |
---|
| 20 | use warnings; |
---|
| 21 | # ------------------------------------------------------------------------------ |
---|
| 22 | package FCM::System::Make::Build::Task::Compile::C; |
---|
| 23 | use base qw{FCM::System::Make::Build::Task::Compile}; |
---|
| 24 | |
---|
| 25 | our %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 | |
---|
| 37 | sub 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 | # ------------------------------------------------------------------------------ |
---|
| 48 | 1; |
---|
| 49 | __END__ |
---|
| 50 | |
---|
| 51 | =head1 NAME |
---|
| 52 | |
---|
| 53 | FCM::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 | |
---|
| 63 | Wraps L<FCM::System::Make::Build::Task::Compile> to compile a C source into an |
---|
| 64 | object. |
---|
| 65 | |
---|
| 66 | =head1 COPYRIGHT |
---|
| 67 | |
---|
| 68 | (C) Crown copyright Met Office. All rights reserved. |
---|
| 69 | |
---|
| 70 | =cut |
---|