From f1b45dc2acdce72795e44cc53d5210559438db26 Mon Sep 17 00:00:00 2001 From: Umar Getagazov Date: Thu, 24 Mar 2022 22:42:55 +0700 Subject: [PATCH] Update Makefile for ease of packaging --- Makefile | 29 +++++++++++++++-------------- config.example.mk | 1 - 2 files changed, 15 insertions(+), 15 deletions(-) delete mode 100644 config.example.mk diff --git a/Makefile b/Makefile index f0c2492..6343dc6 100644 --- a/Makefile +++ b/Makefile @@ -1,19 +1,20 @@ .POSIX: -include config.example.mk --include config.mk +.SUFFIXES: + +PREFIX=/usr/local +BINDIR=$(PREFIX)/bin +MANDIR=$(PREFIX)/share/man +GO=go + +all: mycorrhiza mycorrhiza: - go build . + $(GO) generate $(GOFLAGS) + $(GO) build $(GOFLAGS) . -o mycorrhiza -generate: - go generate +install: + mkdir -m755 -p $(DESTDIR)$(BINDIR) $(DESTDIR)$(MANDIR)/man1 + install -m755 mycorrhiza $(DESTDIR)$(BINDIR)/mycorrhiza + install -m644 doc/mycorrhiza.1 $(DESTDIR)$(MANDIR)/man1/mycorrhiza.1 -run: mycorrhiza - ./mycorrhiza ${WIKIPATH} - -dev: generate run - -check: - go test . - -.PHONY: mycorrhiza generate run dev check +.PHONY: all mycorrhiza install diff --git a/config.example.mk b/config.example.mk deleted file mode 100644 index 2f65bdc..0000000 --- a/config.example.mk +++ /dev/null @@ -1 +0,0 @@ -WIKIPATH=~/src/example-wiki