From daa26638bc525fc5fd4e0d68e9c33f9d3789f1a3 Mon Sep 17 00:00:00 2001 From: Robin Jarry Date: Wed, 23 Feb 2022 20:17:19 +0100 Subject: [PATCH] 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 Tested-by: Koni Marti --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index df8a0c0..9b9d24f 100644 --- a/Makefile +++ b/Makefile @@ -12,7 +12,7 @@ GO?=go GOFLAGS?= LDFLAGS+=-X main.Version=$(VERSION) -GOSRC:=$(shell find * -name '*.go') +GOSRC!=find * -name '*.go' GOSRC+=go.mod go.sum DOCS := \