automake-ng
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Automake-NG] Input preprocessing, verbatim output, etc. (was: Re: [PATC


From: Stefano Lattarini
Subject: [Automake-NG] Input preprocessing, verbatim output, etc. (was: Re: [PATCH] [ng] parallel-tests: use 'am__error' instead of hand-rolled equivalent)
Date: Thu, 07 Jun 2012 13:27:04 +0200

On 06/07/2012 11:59 AM, Akim Demaille wrote:
> 
> Le 6 juin 2012 à 18:40, Stefano Lattarini a écrit :
> 
>> @@ -94,8 +87,8 @@ am__tpfx = \
>> ## FIXME: this will pick up the default from the environment; are we sure
>> ## FIXME: we want that?
>> !TEST_EXTENSIONS ?= .test
>> -!$(call am__maybe_invalid_test_extensions,\
>> -!  $(filter-out .%,$(TEST_EXTENSIONS)))
>> +!$(foreach am__e,$(filter-out .%,$(TEST_EXTENSIONS)),\
>> +!     $(call am__error,invalid test extension: '$(am__e)'))
>> !$(foreach am__e,$(TEST_EXTENSIONS), \
>> !  $(eval $(call am__handle_per_suffix_test,$(am__e))))
>> ## It is *imperative* that the "empty" suffix goes last.  Otherwise, a
> 
> Really, have you considered using a "block" like
> approach instead of prefixing with "!"?
> 
Not yet, since I find the "!" approach good enough so far (and it certainly
has been quite easy to implement).  And since it is intended *and supported*
only for use in our private '*.am' fragments, it doesn't matter if its API
is suboptimal, since we can change that at any time without impacting on
user's Makefiles.

In the long term, as we move more and more logic at make runtime, it *might*
indeed make sense to add general-purpose "blocks" that inform Automake on
how to reorder the input, and on how to process it; for example:

    &AM-BEGIN verbatim-rules am-rule1 am-rule2
    am-rule1 am-rule2: am-rule% :
            @cmd-start
    ifeq "$*" 1
            @cmd-1
    else
            @cmd-2
    endif
            @cmd-end
    &AM-END verbatim-rules

would tell automake that:

   1. the code in the block must not go through fully-fledged parsing;
   2. it must be output with the other rule's definitions;
   3. it defines two rules "am-rule1" and "am-rule2" (so that automake
      will be able to give a warning if the user tries to override any
      of these).

But we'll cross that bridge when we come to it (if ever).

Regards,
  Stefano



reply via email to

[Prev in Thread] Current Thread [Next in Thread]