GO ?= go RM ?= rm GOFLAGS ?= -v -ldflags "-w -X `go list`.Version=$(VERSION) -X `go list`.Commit=$(COMMIT)" PREFIX ?= /usr/local BINDIR ?= bin MANDIR ?= share/man MKDIR ?= mkdir CP ?= cp SYSCONFDIR ?= /etc VERSION = 0.4.6 COMMIT = `svn info --show-item revision || echo "$COMMIT"` GOARCH ?= amd64 GOOS ?= linux all: suika suikadb suika-znc-import suika: $(GO) build $(GOFLAGS) ./cmd/suika @strip -s suika suikadb: $(GO) build $(GOFLAGS) ./cmd/suikadb @strip -s suikadb suika-znc-import: $(GO) build $(GOFLAGS) ./cmd/suika-znc-import @strip -s suika-znc-import clean: $(RM) -f suika suikadb suikactl suika-znc-import docs: asciidoctor -b manpage doc/suika.adoc -o doc/suika.1 asciidoctor -b manpage doc/suikadb.adoc -o doc/suikadb.1 asciidoctor -b manpage doc/suika-config.adoc -o doc/suika-config.5 asciidoctor -b manpage doc/suika-bouncerserv.adoc -o doc/suika-bouncerserv.7 install: $(MKDIR) -p $(DESTDIR)$(PREFIX)/$(BINDIR) $(MKDIR) -p $(DESTDIR)$(PREFIX)/$(MANDIR)/man1 $(MKDIR) -p $(DESTDIR)$(PREFIX)/$(MANDIR)/man5 $(MKDIR) -p $(DESTDIR)$(PREFIX)/$(MANDIR)/man7 $(MKDIR) -p $(DESTDIR)${SYSCONFDIR}/suika $(MKDIR) -p $(DESTDIR)/var/lib/suika $(CP) -f suika suikadb suika-znc-import $(DESTDIR)$(PREFIX)/$(BINDIR) $(CP) -f doc/suika.1 $(DESTDIR)$(PREFIX)/$(MANDIR)/man1 $(CP) -f doc/suikadb.1 $(DESTDIR)$(PREFIX)/$(MANDIR)/man1 $(CP) -f doc/suika-znc-import.1 $(DESTDIR)/$(MANDIR)/man1 $(CP) -f doc/suika-config.5 $(DESTDIR)$(PREFIX)/$(MANDIR)/man5 $(CP) -f doc/suika-bouncerserv.7 $(DESTDIR)$(PREFIX)/$(MANDIR)/man7 [ -f $(DESTDIR)${SYSCONFDIR}/suika/config ] || $(CP) -f config.in $(DESTDIR)${SYSCONFDIR}/suika/config test: go test vendor: go mod vendor .PHONY: suika suikadb suika-znc-import clean install