add Makefile with `plugin` target
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..80fc5a4
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,18 @@
+NAME=couchperuser
+ERL=$(shell couch-config --erl-bin)
+ERLANG_VERSION=$(shell couch-config --erlang-version)
+VERSION=1.0.0
+PLUGIN_DIRS=ebin priv
+PLUGIN_VERSION_SLUG=$(NAME)-$(VERSION)-$(ERLANG_VERSION)
+PLUGIN_DIST=$(PLUGIN_VERSION_SLUG)
+
+all: compile
+
+compile:
+	rebar compile
+
+plugin: compile
+	mkdir -p $(PLUGIN_DIST)
+	cp -r $(PLUGIN_DIRS) $(PLUGIN_DIST)
+	tar czf $(PLUGIN_VERSION_SLUG).tar.gz $(PLUGIN_DIST)
+	@$(ERL) -eval 'File = "$(PLUGIN_VERSION_SLUG).tar.gz", {ok, Data} = file:read_file(File),io:format("~s: ~s~n", [File, base64:encode(crypto:sha(Data))]),halt()' -noshell