forked from vernemq/vernemq
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
39 lines (31 loc) · 908 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
27
28
29
30
31
32
33
34
35
36
37
38
39
BASE_DIR = $(shell pwd)
ERLANG_BIN = $(shell dirname $(shell which erl))
GIT_VERSION = $(shell git describe --tags --always)
OVERLAY_VARS ?=
REBAR ?= $(BASE_DIR)/rebar3
$(if $(ERLANG_BIN),,$(warning "Warning: No Erlang found in your path, this will probably not work"))
all: compile
compile:
$(REBAR) $(PROFILE) compile
##
## Release targets
##
rel:
cat vars.config > vars.generated
echo "{app_version, \"${GIT_VERSION}\"}." >> vars.generated
ifeq ($(OVERLAY_VARS),)
else
echo "%% including OVERLAY_VARS from an additional file." >> vars.generated
echo \"./${OVERLAY_VARS}\". >> vars.generated
endif
$(REBAR) $(PROFILE) release
##
## Developer targets
##
## devN - Make a dev build for node N
dev% :
./gen_dev $@ vars/dev_vars.config.src vars/$@_vars.config
cat vars/$@_vars.config > vars.generated
(./rebar3 as $@ release)
.PHONY: all compile rel
export OVERLAY_VARS