-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
26 lines (21 loc) · 876 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# Customize here
NAME=couch_custom_uuids
VERSION=1.0.0
# Stop customizing here
ERL=$(shell couch-config --erl-bin)
ERLANG_VERSION=$(shell couch-config --erlang-version)
COUCHDB_VERSION=$(shell couch-config --couch-version | sed 's/\+.*//')
PLUGIN_DIRS=ebin priv
PLUGIN_VERSION_SLUG=$(NAME)-$(VERSION)-$(ERLANG_VERSION)-$(COUCHDB_VERSION)
PLUGIN_DIST=$(PLUGIN_VERSION_SLUG)
all: compile
compile:
ERL_LIBS=$(shell couch-config --erl-libs-dir):$(ERL_LIBS) rebar compile
dev: compile
@ERL_LIBS=$(shell pwd) couchdb -i -a priv/default.d/*.ini
plugin: compile
@mkdir -p $(PLUGIN_DIRS)
@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