forked from vernemq/vernemq
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
42 lines (32 loc) · 859 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
40
41
42
BASE_DIR = $(shell pwd)
ERLANG_BIN = $(shell dirname $(shell which erl))
GIT_VERSION = $(shell git describe --tags)
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
rpi32: PROFILE = as rpi32
rpi32: rel
##
## Release targets
##
rel:
cat vars.config > vars.generated
echo "{app_version, \"${GIT_VERSION}\"}." >> vars.generated
ifeq ($(OVERLAY_VARS),)
else
cat $(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 rpi32 rel
export OVERLAY_VARS