From 66a83e6345ab03395b66f53c414b74f32a87396d Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Tue, 8 Feb 2022 16:10:19 +0100 Subject: [PATCH] makefile: switch to BSD/GNU make Let's stop using POSIX make, it's too much of a pain. --- Makefile | 21 +++++++++------------ README.md | 3 ++- 2 files changed, 11 insertions(+), 13 deletions(-) diff --git a/Makefile b/Makefile index cc7917d..8d7d6a3 100644 --- a/Makefile +++ b/Makefile @@ -1,13 +1,10 @@ -.POSIX: -.SUFFIXES: - -GO = go -RM = rm -SCDOC = scdoc -GOFLAGS = -PREFIX = /usr/local -BINDIR = bin -MANDIR = share/man +GO ?= go +RM ?= rm +SCDOC ?= scdoc +GOFLAGS ?= +PREFIX ?= /usr/local +BINDIR ?= bin +MANDIR ?= share/man all: soju sojuctl doc/soju.1 @@ -19,7 +16,7 @@ doc/soju.1: doc/soju.1.scd $(SCDOC) doc/soju.1 clean: - $(RM) -rf soju sojuctl doc/soju.1 + $(RM) -f soju sojuctl doc/soju.1 install: mkdir -p $(DESTDIR)$(PREFIX)/$(BINDIR) mkdir -p $(DESTDIR)$(PREFIX)/$(MANDIR)/man1 @@ -29,4 +26,4 @@ install: cp -f doc/soju.1 $(DESTDIR)$(PREFIX)/$(MANDIR)/man1 [ -f $(DESTDIR)/etc/soju/config ] || cp -f config.in $(DESTDIR)/etc/soju/config -.PHONY: soju sojuctl +.PHONY: soju sojuctl clean install diff --git a/README.md b/README.md index 278d882..a31f978 100644 --- a/README.md +++ b/README.md @@ -20,6 +20,7 @@ A user-friendly IRC bouncer. Dependencies: - Go +- BSD or GNU make - a C89 compiler (for SQLite) - scdoc (optional, for man pages) @@ -30,7 +31,7 @@ For end users, a `Makefile` is provided: For development, you can use `go run ./cmd/soju` as usual. -To link with the system libsqlite3, use `make GOFLAGS="-tags=libsqlite3"`. +To link with the system libsqlite3, set `GOFLAGS="-tags=libsqlite3"`. ## Contributing