STAR_MESSGEN([msgfile-list])
Handle generating message, error, and facility files.
Declare that we will need to use the messgen utility.
This macro does not by itself cause the messgen rules to
be included in the makefile -- that is done by automake,
when it sees a include_MESSAGES
variable.
In the Makefile.am
you declare the
include_MESSAGES
or noinst_MESSAGES
variable to have as value each of the error files you
require from the .msg
file. For example, you
might write:
to generate, install and distribute the C and Fortran error message files. You may include ainclude_MESSAGES = ast_err.h AST_ERR
_SOURCES
declaration to indicate
the name of the .msg
file, but the default
value (ast_err.msg
in this case) is usually
correct. The files thus listed are installed in the same
include directory as other header files. You should not
list a file in both include_MESSAGES
and
include_HEADER
.If you need to work with an error file which is not public, you can declare it with
Such a file is generated but not installed. In order that it be distributed, you should includenoinst_MESSAGES = dat_err.h
$(noinst_MESSAGES)
in the _SOURCES
declaration of the program which includes it.Although it's difficult to see why you'd want to, you can
include the nodist_
prefix with this
primary.
You do not need to mention the fac_xxx_err
file which messgen also generates -- this is generated and
installed automatically.
The optional argument is a space-separated list of files,
each of which has a set of message declarations in it, in
the format prescribed by the messgen utility. If this is
present, then the named files are declared as
pre-distribution files (the macro calls STAR_PREDIST_SOURCES
on them), and so the resulting configure script should
expect not to find them in an unpacked distribution. This
is useful as documentation or as a shortcut for calling
the latter macro, but recall that it is the presence of
the automake include_MESSAGES
variable which
does the work.
The macro may be called more than once if you have more
than one .msg
file in the directory.
The files which this generates should be declared as sources in the Makefile.am if they are to be used in code, or are to be installed. For example:
If they are used in building the package, you will probably need to declare them additionally asbin_PROGRAMS = foo foo_SOURCES = foo.c $(include_MESSAGES) include_MESSAGES = foo_err.h BUILT_SOURCES = $(include_MESSAGES)
BUILT_SOURCES
.The macro also implicitly declares a `sourceset' dependency on the messgen package.