summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorBen Morrison <ben@gbmor.dev>2019-06-12 19:55:28 -0400
committerBen Morrison <ben@gbmor.dev>2019-06-12 19:55:28 -0400
commit96fbc6ec48e0613b0d377fc06376a5a767db4b9c (patch)
tree537c26444641a9673a08adc6644e4237a6b77176
parentb8561159e64e171790d8381e275cd24bcb99a58f (diff)
downloadgetwtxt-96fbc6ec48e0613b0d377fc06376a5a767db4b9c.tar.gz
updated makefile
-rw-r--r--Makefile53
1 files changed, 47 insertions, 6 deletions
diff --git a/Makefile b/Makefile
index b27b392..bda68ca 100644
--- a/Makefile
+++ b/Makefile
@@ -6,20 +6,41 @@ GOFLAGS?=-tags netgo \
 				 -ldflags '-X github.com/getwtxt/getwtxt/svc.Vers=${VERSION} -extldflags "-static"'
 
 getwtxt: getwtxt.go go.mod go.sum
+	@echo
+	@echo Building getwtxt. This may take a minute or two.
 	go build $(GOFLAGS) \
 		-o $@
+	@echo
+	@echo ...Done!
 
-RM?=rm -f
-
+.PHONY: clean
 clean:
-	$(RM) getwtxt
+	@echo
+	@echo Cleaning build and module caches...
+	go clean -cache -modcache
+	@echo
+	@echo ...Done!
 
+.PHONY: update
 update:
+	@echo
+	@echo Updating from upstream repository...
+	@echo
 	git pull --rebase
 
+.PHONY: install
 install:
+	@echo
+	@echo Installing getwtxt...
+	@echo
+	@echo Creating user/group...
 	adduser -home $(BINDIR) --system --group getwtxt
+	@echo
+	@echo
+	@echo Creating directories...
 	mkdir -p $(BINDIR)/assets/tmpl $(BINDIR)/docs
+	@echo
+	@echo Copying files...
 	install -m755 getwtxt $(BINDIR)
 	install -m644 getwtxt.yml $(BINDIR)
 	install -m644 assets/style.css $(BINDIR)/assets
@@ -27,11 +48,31 @@ install:
 	install -m644 README.md $(BINDIR)/docs
 	install -m644 LICENSE $(BINDIR)/docs
 	install -m644 etc/getwtxt.service /etc/systemd/system
+	@echo
+	@echo
+	@echo Setting ownership...
 	chown -R getwtxt:getwtxt $(BINDIR)
+	@echo
+	@echo ...Done!
 
+.PHONY: uninstall
 uninstall:
-	systemctl stop getwtxt >/dev/null 2>&1
-	systemctl disable getwtxt >/dev/null 2>&1
+	@echo
+	@echo Uninstalling getwtxt...
+	@echo
+	@echo Stopping service if running...
+	@echo systemctl stop getwtxt
+	@systemctl stop getwtxt >/dev/null 2>&1 || true
+	@echo
+	@echo Disabling service autostart...
+	@echo systemctl disable getwtxt
+	@systemctl disable getwtxt >/dev/null 2>&1 || true
+	@echo
+	@echo Removing files
 	rm -rf $(BINDIR)
 	rm -f /etc/systemd/system/getwtxt.service
-	userdel getwtxt
+	@echo
+	@echo Removing user
+	- userdel getwtxt
+	@echo
+	@echo ...Done!