forked from windock/erlyvideo
/
Makefile
70 lines (49 loc) · 1.63 KB
/
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
include debian/version.mk
ERLANG_ROOT := $(shell erl -eval 'io:format("~s", [code:root_dir()])' -s init stop -noshell)
ERLDIR=$(ERLANG_ROOT)/lib/erlyvideo-$(VERSION)
DESTROOT:=$(CURDIR)/debian/erlyvideo
ERL_LIBS:=apps:deps:plugins
# NIFDIR := `erl -eval 'io:format("~s", [code:lib_dir(erts,include)])' -s init stop -noshell| sed s'/erlang\/lib\//erlang\//'`
#
# ifeq ($(shell uname), Linux)
# NIF_FLAGS := gcc -shared -O3 -fPIC -fno-common -Wall
# endif
#
# ifeq ($(shell uname), Darwin)
# NIF_FLAGS := cc -arch i386 -arch x86_64 -pipe -bundle -undefined dynamic_lookup -O3 -fPIC -fno-common -Wall
# endif
#
# ifeq ($(shell uname), FreeBSD)
# NIF_FLAGS := cc -shared -O3 -fPIC -fno-common -Wall
# endif
ERL=erl +A 4 +K true
APP_NAME=ems
all: compile
update:
git pull
compile:
./rebar compile
release: compile
./rebar generate force=1
chmod +x erlyvideo/bin/erlyvideo
ebin/mmap.so: src/core/mmap.c
$(NIF_FLAGS) -o $@ $< -I $(NIFDIR) || touch $@
archive:
git archive --prefix=erlyvideo-$(VERSION)/ v$(VERSION) | gzip -9 > ../erlyvideo-$(VERSION).tar.gz
tgz: release
tar zcvf erlyvideo-$(VERSION).tar.gz erlyvideo
clean:
./rebar clean
rm -fv plugins/*/ebin/*.beam
rm -fv erl_crash.dump
clean-doc:
rm -fv doc/*.html
rm -fv doc/edoc-info
rm -fv doc/*.css
run: priv/erlyvideo.conf priv/log4erl.conf compile
ERL_LIBS=apps:.. erl -boot start_sasl -s erlyvideo
priv/log4erl.conf: priv/log4erl.conf.sample
[ -f priv/log4erl.conf ] || cp priv/log4erl.conf.sample priv/log4erl.conf
priv/erlyvideo.conf: priv/erlyvideo.conf.sample
[ -f priv/erlyvideo.conf ] || cp priv/erlyvideo.conf.sample priv/erlyvideo.conf
.PHONY: doc debian compile