This makes Makefile POSIX-compliant by getting rid of non-standard
operators. When there's a need for an user to build project with
values from environment variables, they can pass -e flag to make.
---
Makefile | 17 +++++++++--------
1 file changed, 9 insertions(+), 8 deletions(-)
diff --git a/Makefile b/Makefile
index d4a9da4..1636f09 100644
--- a/Makefile+++ b/Makefile
@@ -1,12 +1,13 @@
+.POSIX:VERSION=1.0.0
-CFLAGS?=-g-MAINFLAGS:=-DVERSION='"$(VERSION)"' -Wall -Wextra -Werror -Wno-unused-parameter-LDFLAGS+=-static-INCLUDE+=-Iinclude-PREFIX?=/usr/local-BINDIR?=$(PREFIX)/bin-MANDIR?=$(PREFIX)/share/man-PCDIR?=$(PREFIX)/share/pkgconfig+CFLAGS=-g+MAINFLAGS=-DVERSION='"$(VERSION)"' -Wall -Wextra -Werror -Wno-unused-parameter+LDFLAGS=-static+INCLUDE=-Iinclude+PREFIX=/usr/local+BINDIR=$(PREFIX)/bin+MANDIR=$(PREFIX)/share/man+PCDIR=$(PREFIX)/share/pkgconfigOUTDIR=.build
.DEFAULT_GOAL=all
--
2.37.3
On 9/28/22 17:01, Grigory Kirillov wrote:
> This makes Makefile POSIX-compliant by getting rid of non-standard> operators. When there's a need for an user to build project with> values from environment variables, they can pass -e flag to make.
I am in fact not entirely sure that this is desirable. I'd be curious:
what make are you using that you'd need this? I am pretty sure there is
very little software out there that you could actually build with pure
POSIX make?
Conrad
On Thu, Sep 29, 2022 at 12:01:16PM +0200, Conrad Hoffmann wrote:
> On 9/28/22 17:01, Grigory Kirillov wrote:> > This makes Makefile POSIX-compliant by getting rid of non-standard> > operators. When there's a need for an user to build project with> > values from environment variables, they can pass -e flag to make.> > I am in fact not entirely sure that this is desirable. I'd be curious: what> make are you using that you'd need this? I am pretty sure there is very> little software out there that you could actually build with pure POSIX> make?> > Conrad
I don't think this is the only true way to organize a Makefile,
I just thought it worth mentioning that the Makefile used in scd2html
is fairly easy to make POSIX-compliant (as far as I know, in some BSDs'
environments they prefer to use built-in make, which doesn't support
some GNU extensions; however, in most cases GNU make is available). It
was also a good opportunity for me to try email-based patch workflow :^)
Feel free to ignore this proposal