Dear all,

Assume the following macros that define different categories of
OCaml-related source files:

define OCAML_MODULE
  $(1).mli $(1).ml
endef

define OCAML_CONFIGURED_MODULE
  $(1).mli $(1).ml.in
endef

define OCAML_LEXER_MODULE
  $(1).mli $(1).mll
endef

define OCAML_PARSER_MODULE
  $(1).mly
endef

Such macros can then be used to list source files of one given program,
here ocamltest, say:

ocamltest_SOURCES = \
  $(call OCAML_CONFIGURED_MODULE, ocamltest_config) \
  $(call OCAML_MODULE, ocamltest_unix) \
  $(call OCAML_PARSER_MODULE, tsl_parser) \
  $(call OCAML_LEXER_MODULE, tsl_lexer) \
  ...

It is possible to define other variables similar to ocamltest_SOURCES,
ocamldoc_SOURCES, say.

As such variables are defined, I would like to accumulate, in LEXERS and
PARSERS vairables, say, the names of modules of each category so that I
can then use the LEXERS and PARSERS variable to specify dependencies,
say.

Is there a way to achieve this by somehow extending the macros so that
they modifiy the LEXERS & co varialbes each time they are called before
returning the string they currently return? If not, as I suspect, can
anybody think aobut an alternative way to reach the expected feature?

Many thanks in advnace for any hint,

Sébastien.

Reply via email to