forked from windock/erlyvideo
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
87 lines (63 loc) · 2.56 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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
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:=deps:lib:plugins:..
ERL=erl +A 4 +K true
APP_NAME=ems
all: snmp compile plugins doc
compile:
ERL_LIBS=$(ERL_LIBS) erl -make
plugins:
[ -d deps/rtmp ] && for dep in deps/*/ ; do (cd $$dep; echo $$dep; test -f Makefile && $(MAKE) -f Makefile) ; done; true
@# for plugin in plugins/* ; do ERL_LIBS=../../lib:../../deps $(MAKE) -C $$plugin; done
snmp: include/ERLYVIDEO-MIB.hrl
include/ERLYVIDEO-MIB.hrl: snmp/ERLYVIDEO-MIB.bin
erlc -o include snmp/ERLYVIDEO-MIB.bin
snmp/ERLYVIDEO-MIB.bin: snmp/ERLYVIDEO-MIB.mib
erlc -o snmp snmp/ERLYVIDEO-MIB.mib
doc:
mkdir -p doc/html
cp -f doc/*.png doc/html/
erl -pa ebin -s erlyvideo edoc -s init stop -noinput -noshell
archive: ../erlyvideo-$(VERSION).tgz
../erlyvideo-$(VERSION).tgz:
(cd ..; tar zcvf erlyvideo-$(VERSION).tgz --exclude='.git*' --exclude='.DS_Store' --exclude='erlyvideo/plugins/*' --exclude=erlyvideo/$(MNESIA_DATA)* --exclude='erlyvideo/*/._*' erlyvideo)
ebin:
mkdir ebin
clean:
rm -fv ebin/*.beam
rm -fv deps/*/ebin/*.beam
rm -fv lib/*/ebin/*.beam
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
contrib/erlyctl run
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
start: priv/erlyvideo.conf
contrib/erlyctl start
install: compile
mkdir -p $(DESTROOT)/var/lib/erlyvideo/movies
mkdir -p $(DESTROOT)/var/lib/erlyvideo/plugins
mkdir -p $(DESTROOT)$(ERLDIR)
cp -r ebin src include lib Emakefile $(DESTROOT)$(ERLDIR)/
mkdir -p $(DESTROOT)/usr/bin/
cp contrib/reverse_mpegts $(DESTROOT)/usr/bin/reverse_mpegts
cp contrib/erlyctl.debian $(DESTROOT)/usr/bin/erlyctl
mkdir -p $(DESTROOT)/etc/init.d/
ln -s /usr/bin/erlyctl $(DESTROOT)/etc/init.d/erlyvideo
cp -r wwwroot $(DESTROOT)/var/lib/erlyvideo/
rm -rf $(DESTROOT)/var/lib/erlyvideo/wwwroot/player/.git
mkdir -p $(DESTROOT)/var/log/erlyvideo
cp priv/erlyvideo.conf.debian $(DESTROOT)/etc/erlyvideo/erlyvideo.conf
cp priv/log4erl.conf.debian $(DESTROOT)/etc/erlyvideo/log4erl.conf
cp priv/production.config.debian $(DESTROOT)/etc/erlyvideo/production.config
cp -r snmp $(DESTROOT)/var/lib/erlyvideo/
.PHONY: doc debian compile snmp