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

From: Mattias Andrée <maandree_AT_kth.se>
Date: Thu, 30 Dec 2021 21:17:32 +0100

On Thu, 30 Dec 2021 21:07:06 +0100
Laslo Hunhold <dev_AT_frign.de> wrote:

> On Thu, 30 Dec 2021 17:49:23 +0100
> craekz7_AT_gmail.com wrote:
>
> Dear craekz,
>
> > As far as I can see, we could add `.POSIX` to the following programs:
> > dwm, dmenu, dwmstatus, sent and tabbed
> > I've just looked over the Makefiles very briefly, so I may have
> > overseen something. Note: I just picked out the "biggest" programs.
>
> sadly the make-implementations out there don't offer a "strict" mode to
> warn you about non-compliance or undefined behaviour. GNU make (as

I've actually being thinking of writing a makefile linter.
How interested would people be in such a tool?

The reason to have a linter separate from a make utility itself
is that it would not have to reject non-standard features that
you don't want to implement in make. And I also think it would for
cleaner implementation of both projects. Additionally, I would
suspect that a lot of people would just stay with GNU make because
it's in every distro, so having it as a separate project would
probably give it wider adoption.


> usual with GNU products) added a lot of GNU-extensions and poisoned the
> entire ecosystem. It's really easy to write non-compliant makefiles and
> have things silently break or behave slightly different across
> implementations.
>
> Adding a .POSIX target is one thing, it's another to actually verify
> the makefiles are POSIX-compliant.
>
> It would be a cool project-idea to write a very strict POSIX-compliant
> make-implementation that, if it includes extensions, marks them as such
> and prints a warning if desired. mk by plan9 is also very nice, of
> course, but makefiles are the common denominator in the scene and it
> might be a cool incentive to have such a validating make.
>
> A lot of new systems are used all over the place, like cmake, ninja and
> whatnot, so it might be cool to show how zen it is to just work with a
> make-based build-system. One example is the really trivial way to
> package suckless-projects, e.g. libgrapheme[0]. It doesn't get simpler
> than that.
>
> With best regards
>
> Laslo
>
> [0]:https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=libgrapheme
>
Received on Thu Dec 30 2021 - 21:17:32 CET

This archive was generated by hypermail 2.3.0 : Thu Dec 30 2021 - 21:24:07 CET