-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
54 lines (41 loc) · 1.76 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
STATIC_FFMPEG_URL := "https://johnvansickle.com/ffmpeg/releases/ffmpeg-release-64bit-static.tar.xz"
.PHONY: all
all: docker
build/sbin/nginx: nginx/objs/nginx
mkdir -p build/sbin && cp nginx/objs/nginx build/sbin/nginx
nginx/objs/nginx:
cd nginx && \
./auto/configure \
--prefix= \
--sbin-path=/sbin/nginx \
--conf-path=/etc/nginx.conf \
--pid-path=/tmp/nginx.pid \
--lock-path=/tmp/nginx.lock \
--error-log-path=/dev/stderr \
--http-log-path=/dev/stdout \
--http-client-body-temp-path=/tmp \
--http-proxy-temp-path=/tmp \
--with-cc-opt="-static -static-libgcc" --with-ld-opt="-static" --with-cpu-opt=generic \
--add-module=../nginx-rtmp-module \
$$(./auto/configure --help | grep without | awk '{print $$1}' | grep -v '^--without-http$$' | grep -v '^--without-select_module$$' | grep -v '^--without-poll_module$$')
$(MAKE) -C nginx
build/bin/ffmpeg: ffmpeg-release-64bit-static.tar.xz
mkdir -p build/bin && tar xvpf ffmpeg-release-64bit-static.tar.xz -C build/bin --strip 1 --wildcards ffmpeg-*-64bit-static/ffmpeg && touch build/bin/ffmpeg
ffmpeg-release-64bit-static.tar.xz:
wget ${STATIC_FFMPEG_URL} -O $@
build/etc/nginx.conf: nginx.conf
mkdir -p build/etc && cp nginx.conf build/etc/nginx.conf
build/bin/publish: publish
mkdir -p build/bin && cp publish build/bin/publish
build/bin/daemon: daemon
mkdir -p build/bin && cp daemon build/bin/daemon
build/bin/entrypoint: entrypoint
mkdir -p build/bin && cp entrypoint build/bin/entrypoint
build/Dockerfile: Dockerfile
mkdir -p build && cp Dockerfile build/Dockerfile
.PHONY: docker
docker: build/sbin/nginx build/bin/ffmpeg build/etc/nginx.conf build/bin/publish build/bin/daemon build/bin/entrypoint build/Dockerfile
docker build -t ziyan/livebox:latest build
.PHONY: clean
clean:
rm -rf build