soju/Makefile
delthas ab235f0099 sojuctl: rename to sojudb
sojuctl will be used to control the soju deamon directly.

sojudb is a better name because it operates on the database file only.
2023-02-06 15:15:09 +01:00

35 lines
854 B
Makefile

GO ?= go
RM ?= rm
SCDOC ?= scdoc
GOFLAGS ?=
PREFIX ?= /usr/local
BINDIR ?= bin
MANDIR ?= share/man
SYSCONFDIR ?= etc
config_path := $(DESTDIR)/$(SYSCONFDIR)/soju/config
goflags := $(GOFLAGS) \
-ldflags="-X 'git.sr.ht/~emersion/soju/config.DefaultPath=$(config_path)'"
all: soju sojudb doc/soju.1
soju:
$(GO) build $(goflags) ./cmd/soju
sojudb:
$(GO) build $(goflags) ./cmd/sojudb
doc/soju.1: doc/soju.1.scd
$(SCDOC) <doc/soju.1.scd >doc/soju.1
clean:
$(RM) -f soju sojudb doc/soju.1
install:
mkdir -p $(DESTDIR)$(PREFIX)/$(BINDIR)
mkdir -p $(DESTDIR)$(PREFIX)/$(MANDIR)/man1
mkdir -p $(DESTDIR)/$(SYSCONFDIR)/soju
mkdir -p $(DESTDIR)/var/lib/soju
cp -f soju sojudb $(DESTDIR)$(PREFIX)/$(BINDIR)
cp -f doc/soju.1 $(DESTDIR)$(PREFIX)/$(MANDIR)/man1
[ -f $(config_path) ] || cp -f config.in $(config_path)
.PHONY: soju sojudb clean install