~adnano/astronaut-devel

Makefile: make POSIX-compliant v2 SUPERSEDED

phoebos: 1
 Makefile: make POSIX-compliant

 1 files changed, 43 insertions(+), 15 deletions(-)
Export patchset (mbox)
How do I use this?

Copy & paste the following snippet into your terminal to import this patchset into git:

curl -s https://lists.sr.ht/~adnano/astronaut-devel/patches/27476/mbox | git am -3
Learn more about email & git

[PATCH v2] Makefile: make POSIX-compliant Export this patch

The Makefile was marked as POSIX-compliant (first target is .POSIX), but made
use of a number of extensions, such as the GNU extensions $(shell ...) and ifeq,
and the widely-used, but not POSIX, += ?= != := etc.

These other types of macro definitions _will_ be part of the next version of
POSIX, but they are not currently. For this Makefile, ?= and := were not
required, and != is replaced by adding the output of the `find` command
manually.

The RM macro was not defined, and it is not one of the predefined MACROS
required by POSIX.

Merging this commit will require the Makefile to be updated under the following
conditions:
    - new source files are added: add them to the GOSRC macro
    - version is updated: manually change the value of the VERSION macro
v2: oops, one := slipped through
---
 Makefile | 58 +++++++++++++++++++++++++++++++++++++++++---------------
 1 file changed, 43 insertions(+), 15 deletions(-)

diff --git a/Makefile b/Makefile
index 6645c33..62dc6f9 100644
--- a/Makefile
+++ b/Makefile
@@ -2,26 +2,54 @@
.SUFFIXES:
.SUFFIXES: .1 .1.scd

_git_version=$(shell git describe --tags --dirty 2>/dev/null)
ifeq ($(strip $(_git_version)),)
VERSION=0.1.0
else
VERSION=$(_git_version)
endif

PREFIX?=/usr/local
BINDIR?=$(PREFIX)/bin
SHAREDIR?=$(PREFIX)/share/astronaut
MANDIR?=$(PREFIX)/share/man
PREFIX=/usr/local
BINDIR=$(PREFIX)/bin
SHAREDIR=$(PREFIX)/share/astronaut
MANDIR=$(PREFIX)/share/man

VPATH=doc
GO?=go
GOFLAGS?=
GOSRC!=find . -name '*.go'
GOSRC+=go.mod go.sum
GOSRC+=about/*
RM=rm
GO=go
GOFLAGS=
GOSRC= \
	ui/wrap.go \
	ui/view.go \
	ui/ui.go \
	ui/splice.go \
	ui/spinner.go \
	ui/input.go \
	text.go \
	templates.go \
	tab.go \
	styles/styles.go \
	response.go \
	parse.go \
	main.go \
	io.go \
	errors.go \
	config.go \
	command.go \
	browser.go \
	bookmarks.go \
	binds.go \
	go.mod \
	go.sum \
	about/about.tmpl \
	about/bookmarks.gmi \
	about/certificate.tmpl \
	about/certificates.tmpl \
	about/error.tmpl \
	about/knownhosts.tmpl \
	about/mismatch.tmpl \
	about/newtab.gmi \
	about/redirect.tmpl \
	about/too-many-redirects.tmpl \
	about/trust.tmpl \
	about/welcome.gmi \

DOCS := \
DOCS = \
	astronaut.1

all: astronaut doc
-- 
2.34.1
Hi! Thanks for the patch.

On Sat Dec 18, 2021 at 10:57 PM EST, phoebos wrote:
> The Makefile was marked as POSIX-compliant (first target is .POSIX), but made
> use of a number of extensions, such as the GNU extensions $(shell ...) and ifeq,
> and the widely-used, but not POSIX, += ?= != := etc.
> 
> These other types of macro definitions _will_ be part of the next version of
> POSIX, but they are not currently. For this Makefile, ?= and := were not
> required, and != is replaced by adding the output of the `find` command manually.
If the other macro definitions will eventually be part of POSIX, should
we really be concerned? Are there implementations that don't support
these macros?