[libvirt] [PATCH] build: enforce makefile conditional style

Eric Blake eblake at redhat.com
Wed Sep 4 15:44:24 UTC 2013


On 09/04/2013 02:41 AM, Michal Privoznik wrote:
> On 04.09.2013 04:41, Eric Blake wrote:
>> Automake has builtin support to prevent botched conditional nesting,
>> but only if you use:
>> if FOO
>> else !FOO
>> endif !FOO
>>
>> An example error message when using the wrong name:
>>
>> daemon/Makefile.am:378: error: else reminder (LIBVIRT_INIT_SCRIPT_SYSTEMD_TRUE) incompatible with current conditional: LIBVIRT_INIT_SCRIPT_SYSTEMD_FALSE
>> daemon/Makefile.am:381: error: endif reminder (LIBVIRT_INIT_SCRIPT_SYSTEMD_TRUE) incompatible with current conditional: LIBVIRT_INIT_SCRIPT_SYSTEMD_FALSE
>>
>> As our makefiles tend to have quite a bit of nested conditionals,
>> it's better to take advantage of the benefits of the build system
>> double-checking that our conditionals are well-nested, but that
>> requires a syntax check to enforce our usage stye.

I fixed the typo in the commit message...

>>
>> Alas, unlike C preprocessor and spec files, we can't use indentation
>> to make it easier to see how deeply nesting goes.
>>
>> * cfg.mk (sc_makefile_conditionals): New rule.
>> * daemon/Makefile.am: Enforce the style.
>> * gnulib/tests/Makefile.am: Likewise.
>> * python/Makefile.am: Likewise.
>> * src/Makefile.am: Likewise.
>> * tests/Makefile.am: Likewise.
>> * tools/Makefile.am: Likewise.
>>
>> Signed-off-by: Eric Blake <eblake at redhat.com>
>> ---
>>  cfg.mk                   |   8 ++
>>  daemon/Makefile.am       |  64 +++++-----
>>  gnulib/tests/Makefile.am |   2 +-
>>  python/Makefile.am       |   4 +-
>>  src/Makefile.am          | 326 +++++++++++++++++++++++------------------------
>>  tests/Makefile.am        | 130 +++++++++----------
>>  tools/Makefile.am        |  14 +-
>>  7 files changed, 278 insertions(+), 270 deletions(-)
> 
> ACK

and pushed.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 621 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20130904/684858a3/attachment-0001.sig>


More information about the libvir-list mailing list