-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
46 lines (39 loc) · 1.55 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
all: static dynamic
dynamic:
go build -v .
mv toxtun-go toxtun
# 静态编译libtoxcore与其依赖库
static_libsodium:
git clone https://github.com/jedisct1/libsodium.git || \
cd libsodium/ && git checkout master && git pull
cd libsodium/ && git checkout 'tags/1.0.3' && ./autogen.sh && \
./configure --prefix=$(PWD)/build --disable-shared && \
make -j3 > /dev/null && \
make install > /dev/null
static_libopus:
wget -c http://downloads.xiph.org/releases/opus/opus-1.1.tar.gz > /dev/null
tar xzf opus-1.1.tar.gz > /dev/null
cd opus-1.1 && ./configure --prefix=$(PWD)/build --disable-shared && \
make -j3 > /dev/null && \
make install > /dev/null
static_libvpx:
git clone https://chromium.googlesource.com/webm/libvpx > /dev/null || \
cd libvpx/ && git pull
cd libvpx/ && ./configure --prefix=$(PWD)/build --disable-shared > /dev/null && \
make -j3 >/dev/null && \
make install > /dev/null
static_libtoxcore: export CFLAGS=-I$(PWD)/build/include/tox
static_libtoxcore: export LDFLAGS=-L$(PWD)/build/lib
static_libtoxcore:
git clone https://github.com/irungentoo/toxcore.git || \
cd toxcore/ && git pull
cd toxcore/ && ./configure --prefix=$(PWD)/build --disable-shared --disable-tests --disable-daemon --disable-ntox && \
make -j3 > /dev/null && \
make install > /dev/null
static: export CGO_CFLAGS=-I$(PWD)/build/include/tox
static: export CGO_LDFLAGS=-L$(PWD)/build/lib
static: static_libsodium static_libopus static_libvpx static_libtoxcore
# rm $(GOPATH)/pkg/linux_amd64/tox.a
go install -v -x tox
go build -v .
mv toxtun-go toxtun-static