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 | # ------------------------------------------------------------------------------ |
---|
19 | use strict; |
---|
20 | use warnings; |
---|
21 | # ------------------------------------------------------------------------------ |
---|
22 | package FCM::System::Make::Preprocess; |
---|
23 | use base qw{FCM::System::Make::Build}; |
---|
24 | |
---|
25 | use FCM::System::Make::Build::FileType::CPP; |
---|
26 | use FCM::System::Make::Build::FileType::FPP; |
---|
27 | use FCM::System::Make::Build::FileType::H ; |
---|
28 | |
---|
29 | # Default target selection |
---|
30 | our %TARGET_SELECT_BY = ( |
---|
31 | 'category' => {}, |
---|
32 | 'key' => {}, |
---|
33 | 'task' => {q{} => {'process' => 1}}, |
---|
34 | ); |
---|
35 | |
---|
36 | # Classes for working with typed source files |
---|
37 | our @FILE_TYPE_UTILS = ( |
---|
38 | 'FCM::System::Make::Build::FileType::FPP', |
---|
39 | 'FCM::System::Make::Build::FileType::CPP', |
---|
40 | 'FCM::System::Make::Build::FileType::HPP', |
---|
41 | ); |
---|
42 | |
---|
43 | # Default properties |
---|
44 | my %PROP_OF = ( |
---|
45 | 'ignore-missing-dep-ns' => [q{}, undef], |
---|
46 | 'no-step-source' => [q{}, undef], |
---|
47 | 'no-inherit-source' => [q{}, undef], |
---|
48 | 'no-inherit-target-category' => [q{}, undef], |
---|
49 | ); |
---|
50 | |
---|
51 | # Returns an instance of FCM::System::Make::Build; |
---|
52 | sub new { |
---|
53 | my ($class, $attrib_ref) = @_; |
---|
54 | bless( |
---|
55 | FCM::System::Make::Build->new({ |
---|
56 | target_select_by => {%TARGET_SELECT_BY}, |
---|
57 | file_type_utils => [@FILE_TYPE_UTILS], |
---|
58 | prop_of => {%PROP_OF}, |
---|
59 | %{$attrib_ref}, |
---|
60 | }), |
---|
61 | $class, |
---|
62 | ); |
---|
63 | } |
---|
64 | |
---|
65 | # ------------------------------------------------------------------------------ |
---|
66 | 1; |
---|
67 | __END__ |
---|
68 | |
---|
69 | =head1 NAME |
---|
70 | |
---|
71 | FCM::System::Make::Preprocess |
---|
72 | |
---|
73 | =head1 SYNOPSIS |
---|
74 | |
---|
75 | use FCM::System::Make::Preprocess; |
---|
76 | my $system = FCM::System::Make::Preprocess->new(\%attrib); |
---|
77 | $system->main(\%option_of, @args); |
---|
78 | |
---|
79 | =head1 DESCRIPTION |
---|
80 | |
---|
81 | A wrapper of L<FCM::System::Make::Build|FCM::System::Make::Build> with |
---|
82 | configuration to trigger the preprocessing of Fortran and C source files. |
---|
83 | |
---|
84 | =back |
---|
85 | |
---|
86 | =head1 COPYRIGHT |
---|
87 | |
---|
88 | Copyright (C) 2006-2021 British Crown (Met Office) & Contributors. |
---|
89 | |
---|
90 | =cut |
---|
91 | |
---|