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

From: Mattias Andrée <maandree_AT_kth.se>
Date: Thu, 30 Dec 2021 16:42:36 +0100

I agree that it shall be added to all Makefile, because
“otherwise, the behavior of make is unspecified.”
(Quote from the POSIX specifications)

Probably missing because people don't usually learn
make(1) by reading the entire manual.

.POSIX can be used as long a the makefile does not
use any feature that conflicts with POSIX. But I think
it would mislead people into thinking the non-POSIX
features are POSIX feature, so it would be best skip
it in that case.

I do however think some Makefile here that use the _AT_
macro in the prerequisite. This is not a POSIX feature,
is seldom needed, and should be removed assuming it
is redundant given the inferred prerequisite of
inference rules.


Regards,
Mattias Andrée


On Thu, 30 Dec 2021 15:58:33 +0100
craekz7_AT_gmail.com wrote:

> Hi,
>
> I'm wondering why the Makefiles of some suckless programs (and libs) have the
> special target `.POSIX` in them and some don't.
> For example, dwm doesn't have it in it's Makefile but there isn't a single
> non-POSIX feature used. I think it would be better to include the `.POSIX` target
> simply to follow the standard and guarantee portability.
> If there is a good reason why it isn't included, please let me know.
>
> --
> craekz
>
Received on Thu Dec 30 2021 - 16:42:36 CET

This archive was generated by hypermail 2.3.0 : Thu Dec 30 2021 - 16:48:07 CET