makefile: switch to BSD/GNU make

Let's stop using POSIX make, it's too much of a pain.
This commit is contained in:
Simon Ser 2022-02-08 16:10:19 +01:00
parent f858ec163c
commit 66a83e6345
2 changed files with 11 additions and 13 deletions

View File

@ -1,13 +1,10 @@
.POSIX: GO ?= go
.SUFFIXES: RM ?= rm
SCDOC ?= scdoc
GO = go GOFLAGS ?=
RM = rm PREFIX ?= /usr/local
SCDOC = scdoc BINDIR ?= bin
GOFLAGS = MANDIR ?= share/man
PREFIX = /usr/local
BINDIR = bin
MANDIR = share/man
all: soju sojuctl doc/soju.1 all: soju sojuctl doc/soju.1
@ -19,7 +16,7 @@ doc/soju.1: doc/soju.1.scd
$(SCDOC) <doc/soju.1.scd >doc/soju.1 $(SCDOC) <doc/soju.1.scd >doc/soju.1
clean: clean:
$(RM) -rf soju sojuctl doc/soju.1 $(RM) -f soju sojuctl doc/soju.1
install: install:
mkdir -p $(DESTDIR)$(PREFIX)/$(BINDIR) mkdir -p $(DESTDIR)$(PREFIX)/$(BINDIR)
mkdir -p $(DESTDIR)$(PREFIX)/$(MANDIR)/man1 mkdir -p $(DESTDIR)$(PREFIX)/$(MANDIR)/man1
@ -29,4 +26,4 @@ install:
cp -f doc/soju.1 $(DESTDIR)$(PREFIX)/$(MANDIR)/man1 cp -f doc/soju.1 $(DESTDIR)$(PREFIX)/$(MANDIR)/man1
[ -f $(DESTDIR)/etc/soju/config ] || cp -f config.in $(DESTDIR)/etc/soju/config [ -f $(DESTDIR)/etc/soju/config ] || cp -f config.in $(DESTDIR)/etc/soju/config
.PHONY: soju sojuctl .PHONY: soju sojuctl clean install

View File

@ -20,6 +20,7 @@ A user-friendly IRC bouncer.
Dependencies: Dependencies:
- Go - Go
- BSD or GNU make
- a C89 compiler (for SQLite) - a C89 compiler (for SQLite)
- scdoc (optional, for man pages) - 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. 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 ## Contributing