-
Notifications
You must be signed in to change notification settings - Fork 21
/
Copy pathMakefile
63 lines (45 loc) · 1.64 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
include version.mk
all: compile
compile:
@find . -name '._*' -delete
#[ -d deps/alsa ] || ./rebar get-deps
./rebar compile
linux:
ERL_LIBS=apps ./rebar -C rebar-linux.config get-deps compile
linux-compile:
ERL_LIBS=apps ./rebar -C rebar-linux.config get-deps compile
clean:
./rebar clean
get-deps:
./rebar get-deps
start:
run_erl -daemon /tmp/ /tmp/ ./start
attach:
to_erl /tmp/
image:
rm -rf root
mkdir -p root
make DESTROOT=root install
mksquashfs root publisher.squashfs
install:
mkdir -p $(DESTROOT)/opt/erlyvideo/lib/
cp -r deps/gproc deps/gen_leader deps/edown $(DESTROOT)/opt/erlyvideo/lib/
mkdir -p $(DESTROOT)/opt/erlyvideo/lib/publisher-$(VERSION)/priv/
cp -r apps/publisher/ebin $(DESTROOT)/opt/erlyvideo/lib/publisher-$(VERSION)/
cp publisher.erl $(DESTROOT)/opt/erlyvideo/lib/publisher-$(VERSION)/priv/
mkdir -p $(DESTROOT)/etc/service $(DESTROOT)/etc/sv
cp -r runit $(DESTROOT)/etc/sv/publisher
ln -sf ../sv/publisher $(DESTROOT)/etc/service/publisher
package: compile
rm -rf tmproot
mkdir -p tmproot/opt/erlyvideo/lib/publisher-$(VERSION)/priv/
cp -r apps/publisher/ebin tmproot/opt/erlyvideo/lib/publisher-$(VERSION)/
cp publisher.erl tmproot/opt/erlyvideo/lib/publisher-$(VERSION)/priv/
cp -r runit tmproot/opt/erlyvideo/lib/publisher-$(VERSION)/priv/
mkdir -p tmproot/etc/service/
ln -s ../../opt/erlyvideo/lib/publisher-$(VERSION)/priv/runit tmproot/etc/service/publisher
cd tmproot && \
fpm -s dir -t deb -n publisher -d erlyvideo -d erly-h264 -d erly-alsa -d erly-uvc -d erly-jpeg -v $(VERSION) -m "Max Lapshin <[email protected]>" opt etc
mv tmproot/*.deb .
rm -rf tmproot
.PHONY: start attach package