bin: Rely only on the shebang line
[automake.git] / lib / Automake / Language.pm
blob8ce7ed6903fbaf5db8f6b8c3bee95956ab8e571c
1 # Copyright (C) 2013-2018 Free Software Foundation, Inc.
3 # This program is free software; you can redistribute it and/or modify
4 # it under the terms of the GNU General Public License as published by
5 # the Free Software Foundation; either version 2, or (at your option)
6 # any later version.
8 # This program is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 # GNU General Public License for more details.
13 # You should have received a copy of the GNU General Public License
14 # along with this program. If not, see <https://www.gnu.org/licenses/>.
16 package Automake::Language;
18 use 5.006;
19 use strict;
21 use Class::Struct ();
22 Class::Struct::struct (
23 # Short name of the language (c, f77...).
24 'name' => "\$",
25 # Nice name of the language (C, Fortran 77...).
26 'Name' => "\$",
28 # List of configure variables which must be defined.
29 'config_vars' => '@',
31 # 'pure' is '1' or ''. A 'pure' language is one where, if
32 # all the files in a directory are of that language, then we
33 # do not require the C compiler or any code to call it.
34 'pure' => "\$",
36 'autodep' => "\$",
38 # Name of the compiling variable (COMPILE).
39 'compiler' => "\$",
40 # Content of the compiling variable.
41 'compile' => "\$",
42 # Flag to require compilation without linking (-c).
43 'compile_flag' => "\$",
44 'extensions' => '@',
45 # A subroutine to compute a list of possible extensions of
46 # the product given the input extensions.
47 # (defaults to a subroutine which returns ('.$(OBJEXT)', '.lo'))
48 'output_extensions' => "\$",
49 # A list of flag variables used in 'compile'.
50 # (defaults to [])
51 'flags' => "@",
53 # Any tag to pass to libtool while compiling.
54 'libtool_tag' => "\$",
56 # The file to use when generating rules for this language.
57 # The default is 'depend2'.
58 'rule_file' => "\$",
60 # Name of the linking variable (LINK).
61 'linker' => "\$",
62 # Content of the linking variable.
63 'link' => "\$",
65 # Name of the compiler variable (CC).
66 'ccer' => "\$",
68 # Name of the linker variable (LD).
69 'lder' => "\$",
70 # Content of the linker variable ($(CC)).
71 'ld' => "\$",
73 # Flag to specify the output file (-o).
74 'output_flag' => "\$",
75 '_finish' => "\$",
77 # This is a subroutine which is called whenever we finally
78 # determine the context in which a source file will be
79 # compiled.
80 '_target_hook' => "\$",
82 # If TRUE, nodist_ sources will be compiled using specific rules
83 # (i.e. not inference rules). The default is FALSE.
84 'nodist_specific' => "\$");
87 sub finish ($)
89 my ($self) = @_;
90 if (defined $self->_finish)
92 &{$self->_finish} (@_);
96 sub target_hook ($$$$%)
98 my ($self) = @_;
99 if (defined $self->_target_hook)
101 $self->_target_hook->(@_);