aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorJordan <me@jordan.im>2021-12-03 07:19:28 -0700
committerJordan <me@jordan.im>2021-12-03 07:19:28 -0700
commitb0835fc63877c63e88e75840c5d52d3167ad5e10 (patch)
tree9db697711cab98fa9c49f87d40d6f7212baae19c /Makefile
downloadkeep-b0835fc63877c63e88e75840c5d52d3167ad5e10.tar.gz
keep-b0835fc63877c63e88e75840c5d52d3167ad5e10.zip
initial commit
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile29
1 files changed, 29 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..ddff8eb
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,29 @@
+.POSIX:
+.SUFFIXES:
+
+GO = go
+RM = rm
+GOFLAGS =
+PREFIX = /usr/local
+BINDIR = $(PREFIX)/bin
+CONFIGDIR = $(HOME)/.keep
+
+goflags = $(GOFLAGS)
+
+all: keep
+
+keep:
+ $(GO) build $(goflags) -ldflags "-X main.buildPrefix=$(PREFIX)"
+
+clean:
+ $(RM) -f keep
+
+test:
+ $(GO) test -v ./...
+
+install: all
+ mkdir -p $(DESTDIR)$(BINDIR)
+ mkdir -p $(DESTDIR)$(CONFIGDIR)
+ cp -f keep $(DESTDIR)$(BINDIR)
+ cp -n keep.json $(DESTDIR)$(CONFIGDIR)
+