From 65a08f2ee361c5fd7da1a700154ea3f91997ea59 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yaroslav=20de=20la=20Pe=C3=B1a=20Smirnov?= Date: Mon, 12 Oct 2020 23:46:17 +0300 Subject: Added Makefile; Version bump --- Makefile | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 Makefile (limited to 'Makefile') diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..75f0afd --- /dev/null +++ b/Makefile @@ -0,0 +1,40 @@ +VERSION=0.2.0 + +BUILDDIR=target +RELEASEDIR=$(BUILDDIR)/release +DOCSOUTPUTDIR=$(BUILDDIR)/man +PREFIX?=/usr +_INSTDIR=$(DESTDIR)$(PREFIX) +BINDIR?=$(_INSTDIR)/bin +MANDIR?=$(PREFIX)/share/man +CARGO?=cargo +CARGOFLAGS?=--release + +all: build docs + +build: build-unstripped + strip $(RELEASEDIR)/finbudg + +build-unstripped: + $(CARGO) build $(CARGOFLAGS) + +docs: + mkdir -p $(DOCSOUTPUTDIR) + scdoc < docs/finbudg.1.scd > $(DOCSOUTPUTDIR)/finbudg.1 + scdoc < docs/finbudg.5.scd > $(DOCSOUTPUTDIR)/finbudg.5 + +clean: + rm -rf target/ + +install: + mkdir -p $(BINDIR) $(MANDIR)/man1 $(MANDIR)/man5 + install -m755 $(RELEASEDIR)/finbudg $(BINDIR)/finbudg + install -m644 $(DOCSOUTPUTDIR)/finbudg.1 $(MANDIR)/man1/finbudg.1 + install -m644 $(DOCSOUTPUTDIR)/finbudg.5 $(MANDIR)/man5/finbudg.5 + +uninstall: + rm -f $(BINDIR)/finbudg + rm -f $(MANDIR)/man1/finbudg.1 + rm -f $(MANDIR)/man5/finbudg.5 + +.PHONY: all build build-unstripped docs clean install uninstall -- cgit v1.2.3