Re: [dev] Special target ".POSIX" in Makefiles

From: Mattias Andrée <maandree_AT_kth.se>
Date: Fri, 31 Dec 2021 16:05:14 +0100

On Fri, 31 Dec 2021 12:53:59 +0100
craekz7_AT_gmail.com wrote:

> > Yeah you make a strong argument. I too think a linting tool would be
> > useful. I imagine it would function like shellcheck does for shells. If
> > nothing else it would really help people identify GNU extensions vs
> > portable behavior.
> Something like shellcheck would be awesome! Given that the POSIX
> Makefile syntax isn't very large or complicated, the implementation of
> such a tool could be pretty simple (in the manner of suckless).
> Although I wouldn't mind a strict POSIX compliant make(1) without any
> extensions. There a far too few programs that could be used to
> verify compliance with standards (and buying a test suite isn't a
> great solution).
>
> --
> craekz
>

I think a make(1) implementation without any extensions isn't the
best idea. There are a lot of makefiles out there that rely on
extensions, and its not always that bad, it could be that it just
uses +=. I would much rather have a make implementation with a
sane set of commonly used extensions, that nags me if I use
extensions, than a minimal[0] implementation that I use for many
own projects and a garbage implementation for when I compile
software I download (of course the minimal would do in some cases,
but if I build from the AUR, what would happen is that it would
be used for every AUR package I download).


Regards,
Mattias Andrée



[0] Minimal only run when building from a makefile. When building
    for a makefile, optional stuff like default rules for compiling
    C code would be omitted, but there is no reason to not allow
    such stuff, even for languages that POSIX does not specify,
    when running without a makefile.
Received on Fri Dec 31 2021 - 16:05:14 CET

This archive was generated by hypermail 2.3.0 : Fri Dec 31 2021 - 16:12:07 CET