summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorBen Morrison <ben@gbmor.dev>2019-08-28 15:29:37 -0400
committerBen Morrison <ben@gbmor.dev>2019-08-28 15:29:37 -0400
commit35e7aa025bd62b87435671e2d4e2156288707310 (patch)
tree6179fdf889f78750a5cb204755bce7d8c30b9053
parentc3b907d3c9887e8a2b6c7e0f4a432f3d02cc6c29 (diff)
downloadclinte-35e7aa025bd62b87435671e2d4e2156288707310.tar.gz
added makefile
-rw-r--r--Makefile55
1 files changed, 55 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..8ff0588
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,55 @@
+PREFIX?=/usr/local
+_INSTDIR=$(PREFIX)
+BINDIR?=$(_INSTDIR)/bin
+DBDIR?=$(_INSTDIR)/clinte
+
+clinte: src/main.rs src/db.rs src/logging.rs
+	@echo
+	@echo Building clinte. This may take a minute or two.
+	cargo build --release
+	@echo
+	@echo ...Done\!
+
+.PHONY: clean
+clean:
+	@echo
+	@echo Cleaning build cache of artifacts...
+	cargo clean
+	@echo
+	@echo ...Done\!
+
+.PHONY: update
+update:
+	@echo
+	@echo Updating from upstream repository...
+	@echo
+	git pull --rebase
+	@echo
+	@echo ...Done\!
+
+.PHONY: install
+install:
+	@echo
+	@echo Installing clinte...
+	@echo
+	@echo Creating directories...
+	mkdir -p $(BINDIR)
+	mkdir -p $(DBDIR)
+	@echo
+	@echo Copying files...
+	install -m755 target/release/clinte $(BINDIR)
+	touch $(DBDIR)/clinte.db
+	chmod 755 $(DBDIR)/clinte.db
+	@echo
+	@echo ...Done!
+
+.PHONY: uninstall
+uninstall:
+	@echo
+	@echo Uninstalling clinte...
+	@echo
+	@echo Removing files
+	rm -f $(BINDIR)/clinte
+	rm -rf $(DBDIR)
+	@echo
+	@echo ...Done\!