.POSIX:
.SUFFIXES:
HARE=hare
HAREFLAGS=
SCDOC=scdoc

DESTDIR=
PREFIX=/usr/local
SRCDIR=$(PREFIX)/src
SHAREDIR=$(PREFIX)/share
MANDIR=$(SHAREDIR)/man
HARESRCDIR=$(SRCDIR)/hare
THIRDPARTYDIR=$(HARESRCDIR)/third-party

all: bonsaid bonsaictl

bonsaid:
	hare build -o $@ cmd/$@/

bonsaictl:
	hare build -o $@ cmd/$@/

check:
	hare test

clean:
	rm -f bonsaid bonsaictl

install:
	mkdir -p $(DESTDIR)$(PREFIX)/bin
	install -m755 bonsaid $(DESTDIR)$(PREFIX)/bin
	install -m755 bonsaictl $(DESTDIR)$(PREFIX)/bin

uninstall:
	rm -f $(DESTDIR)$(PREFIX)/bin/bonsaid
	rm -f $(DESTDIR)$(PREFIX)/bin/bonsaictl

.PHONY: all bonsaid bonsaictl check clean install uninstall docs
