mk: fix dynamic source dependencies with bsd make

When building with BSD make, running `make` after updating a source file
will not cause the binary to be rebuilt. After inspection, it appears
that the GOSRC variable only contains "go.mod go.sum". The aerc target
does not depend on .go source files.

The $(shell) construct is GNU make specific. BSD make has a special
assignment operator (!=) which evaluates a shell command. Since GNU make
4.0, the BSD != operator is supported for compatibility.

Use a syntax that is available in both make flavours.

Link: https://git.savannah.gnu.org/cgit/make.git/commit/?id=b34438bee83ee
Signed-off-by: Robin Jarry <robin@jarry.cc>
Tested-by: Koni Marti <koni.marti@gmail.com>
This commit is contained in:
Robin Jarry 2022-02-23 20:17:19 +01:00
parent e7e22aba60
commit daa26638bc
1 changed files with 1 additions and 1 deletions

View File

@ -12,7 +12,7 @@ GO?=go
GOFLAGS?= GOFLAGS?=
LDFLAGS+=-X main.Version=$(VERSION) LDFLAGS+=-X main.Version=$(VERSION)
GOSRC:=$(shell find * -name '*.go') GOSRC!=find * -name '*.go'
GOSRC+=go.mod go.sum GOSRC+=go.mod go.sum
DOCS := \ DOCS := \