mirror of
https://github.com/wangyu-/UDPspeeder.git
synced 2025-09-17 12:44:31 +08:00
Compare commits
36 Commits
20170816.0
...
v1
Author | SHA1 | Date | |
---|---|---|---|
|
b006b651c8 | ||
|
08f2b5d405 | ||
|
ee9dab37fa | ||
|
d25e1ea9df | ||
|
3b5279235a | ||
|
cccff0a8a5 | ||
|
66da392357 | ||
|
a5bad45780 | ||
|
b1a47bb8ea | ||
|
00cffe1072 | ||
|
b5a873d073 | ||
|
8a2e2b8ce4 | ||
|
a13358cdb3 | ||
|
a4b8c5f5b9 | ||
|
916b5e94d8 | ||
|
19553d1bb8 | ||
|
b4bd385e88 | ||
|
d985eb6634 | ||
|
aa42887a67 | ||
|
0cafbff271 | ||
|
a04f976c20 | ||
|
2837f3b955 | ||
|
83ec1296a3 | ||
|
edfc23e273 | ||
|
32c51decad | ||
|
9ce560d9d1 | ||
|
3c333b59e6 | ||
|
073eb5fc2d | ||
|
8388c5dbce | ||
|
24e980069e | ||
|
9a42db3200 | ||
|
7e0d9f99f2 | ||
|
88564a1f56 | ||
|
a95c383cc6 | ||
|
f99de500ba | ||
|
aa7c520642 |
30
README.md
30
README.md
@@ -26,7 +26,7 @@ UDP双边加速工具,降低丢包率,配合vpn可以加速任何协议,
|
||||
|
||||
client支持多个udp连接,server也支持多个client
|
||||
|
||||
目前有amd64,x86,ar71xx,树莓派armv7的binary
|
||||
目前有amd64,x86,ar71xx,树莓派armv7和android的binary
|
||||
|
||||
如果你需要绕过UDP屏蔽/QoS,或者需要连接复用/连接保持功能,或者是加密。解决方案在另一个repo(可以跟UDPspeeder一起使用):
|
||||
|
||||
@@ -35,7 +35,9 @@ https://github.com/wangyu-/udp2raw-tunnel
|
||||
# 简明操作说明
|
||||
|
||||
### 环境要求
|
||||
Linux主机,可以使是openwrt路由器,也可以是树莓派。在windows和mac上配合虚拟机可以稳定使用(speeder跑在Linux里,其他应用照常跑在window里,桥接模式测试可用)。
|
||||
Linux主机,可以是桌面版,可以是android手机/平板,可以是openwrt路由器,也可以是树莓派。在windows和mac上配合虚拟机可以稳定使用(speeder跑在Linux里,其他应用照常跑在window里,桥接模式测试可用)。
|
||||
|
||||
android版需要通过terminal运行。
|
||||
|
||||
### 安装
|
||||
下载编译好的二进制文件,解压到本地和服务器的任意目录。
|
||||
@@ -60,12 +62,16 @@ https://github.com/wangyu-/UDPspeeder/releases
|
||||
|
||||
-k 指定一个字符串,server/client间所有收发的包都会被异或,改变协议特征,防止UDPspeeder的协议被运营商针对。
|
||||
|
||||
### MTU设置(重要)
|
||||
|
||||
不论你用udpspeeder来加速kcptun还是vpn,为了稳定使用,都需要设置合理的MTU(在kcptun/vpn里设置,而不是在udpspeeder里),建议把MTU设置成1200。client和server端都要设置。
|
||||
|
||||
# 进阶操作说明
|
||||
|
||||
### 命令选项
|
||||
```
|
||||
UDPspeeder
|
||||
version: Aug 9 2017 18:13:09
|
||||
git version:b4bd385e88 build date:Sep 11 2017 10:29:25
|
||||
repository: https://github.com/wangyu-/UDPspeeder
|
||||
|
||||
usage:
|
||||
@@ -84,14 +90,16 @@ main options:
|
||||
advanced options:
|
||||
-t tmin:tmax simliar to -t above,but delay randomly between tmin and tmax
|
||||
-j jmin:jmax simliar to -j above,but create jitter randomly between jmin and jmax
|
||||
--random-drop <number> simulate packet loss ,unit 0.01%
|
||||
-m <number> max pending packets,to prevent the program from eating up all your memory.
|
||||
--random-drop <number> simulate packet loss ,unit:0.01%
|
||||
--disable-filter disable duplicate packet filter.
|
||||
-m <number> max pending packets,to prevent the program from eating up all your memory,
|
||||
default value:0(disabled).
|
||||
other options:
|
||||
--log-level <number> 0:never 1:fatal 2:error 3:warn
|
||||
4:info (default) 5:debug 6:trace
|
||||
--log-position enable file name,function name,line number in log
|
||||
--disable-color disable log color
|
||||
--sock-buf <number> buf size for socket,>=10 and <=10240,unit:kbyte,default:512
|
||||
--sock-buf <number> buf size for socket,>=10 and <=10240,unit:kbyte,default:1024
|
||||
-h,--help print this help message
|
||||
|
||||
```
|
||||
@@ -99,7 +107,7 @@ other options:
|
||||
##### -d 选项
|
||||
设置冗余包数量。
|
||||
##### -t 选项
|
||||
为冗余包的发送,增加一个延迟.对中间路由buffer做优化,应对瞬时Buffer过长导致的连续丢包
|
||||
为冗余包的发送,增加一个延迟.对中间路由buffer做优化,应对瞬时Buffer过长导致的连续丢包.对于多个冗余包,依次在前一个包的基础上增加这个延迟。
|
||||
##### -j 选项
|
||||
为原始数据的发送,增加一个延迟抖动值。这样上层应用计算出来的RTT方差会更大,以等待后续冗余包的到达,不至于发生在冗余包到达之前就触发重传的尴尬。配合-t选项使用。正常情况下跨国网络本身的延迟抖动就很大。可以不用设-j
|
||||
|
||||
@@ -131,10 +139,16 @@ kcptun在udp层有RS code,也是一种冗余传输,通过openvpn把流量转
|
||||
|
||||
udp协议本身是ip协议加上了端口之后的直接封装,udp继承了ip协议的实时/乱序到达特性,更适合中转vpn。
|
||||
|
||||
#### UDPspeeder + kcptun/finalspeed同时加速tcp和udp流量
|
||||
#### UDPspeeder + kcptun/finalspeed + ss 同时加速tcp和udp流量
|
||||
如果你需要用加速的tcp看视频和下载文件,这样效果比vpn方案更好。不论是速度,还是流量的耗费上。
|
||||

|
||||
|
||||
#### UDPspeeder + openvpn + ss 混合方案
|
||||
也是我正在用的方案。优点是可以随时在vpn和ss方案间快速切换。
|
||||
实际部署起来比图中看起来的还要简单。不需要改路由表,需要做的只是用openvpn的ip访问ss server。
|
||||
|
||||

|
||||
(也可以把图中的ss server换成其他的socks5 server,这样连ss client也不需要了)
|
||||
# 编译教程
|
||||
暂时先参考udp2raw的这篇教程,几乎一样的过程。
|
||||
|
||||
|
@@ -23,7 +23,7 @@ u64_t get_current_time()
|
||||
{
|
||||
timespec tmp_time;
|
||||
clock_gettime(CLOCK_MONOTONIC, &tmp_time);
|
||||
return tmp_time.tv_sec*1000+tmp_time.tv_nsec/(1000*1000l);
|
||||
return ((u64_t)tmp_time.tv_sec)*1000llu+((u64_t)tmp_time.tv_nsec)/(1000*1000llu);
|
||||
}
|
||||
|
||||
u64_t get_current_time_us()
|
||||
|
2
common.h
2
common.h
@@ -67,7 +67,7 @@ const u32_t conv_clear_interval=200;
|
||||
const u32_t timer_interval=400;
|
||||
const int conv_clear_ratio=40;
|
||||
const int conv_clear_min=5;
|
||||
const u32_t conv_timeout=20000;
|
||||
const u32_t conv_timeout=180000;
|
||||
const int max_conv_num=10000;
|
||||
|
||||
/*
|
||||
|
BIN
images/Capture10.PNG
Normal file
BIN
images/Capture10.PNG
Normal file
Binary file not shown.
After Width: | Height: | Size: 66 KiB |
Binary file not shown.
Before Width: | Height: | Size: 73 KiB After Width: | Height: | Size: 73 KiB |
BIN
images/Capture9.PNG
Normal file
BIN
images/Capture9.PNG
Normal file
Binary file not shown.
After Width: | Height: | Size: 65 KiB |
80
main.cpp
80
main.cpp
@@ -1,5 +1,6 @@
|
||||
#include "common.h"
|
||||
#include "log.h"
|
||||
#include "git_version.h"
|
||||
|
||||
using namespace std;
|
||||
|
||||
@@ -28,7 +29,7 @@ int local_fd=-1;
|
||||
int is_client = 0, is_server = 0;
|
||||
int local_listen_fd=-1;
|
||||
|
||||
int disable_conv_clear=0;
|
||||
int disable_conn_clear=0;
|
||||
int mtu_warn=1350;
|
||||
u32_t remote_address_uint32=0;
|
||||
|
||||
@@ -48,6 +49,7 @@ u64_t packet_send_count=0;
|
||||
u64_t dup_packet_send_count=0;
|
||||
u64_t packet_recv_count=0;
|
||||
u64_t dup_packet_recv_count=0;
|
||||
int max_pending_packet=0;
|
||||
|
||||
int random_between(u32_t a,u32_t b)
|
||||
{
|
||||
@@ -60,7 +62,7 @@ int random_between(u32_t a,u32_t b)
|
||||
else return a+get_true_random_number()%(b+1-a);
|
||||
}
|
||||
|
||||
int max_pending_packet=0;
|
||||
|
||||
int VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV;
|
||||
|
||||
struct anti_replay_t
|
||||
@@ -160,7 +162,7 @@ struct conn_manager_t //TODO change map to unordered map
|
||||
}
|
||||
void clear()
|
||||
{
|
||||
if(disable_conv_clear) return ;
|
||||
if(disable_conn_clear) return ;
|
||||
|
||||
for(it=fd_to_u64.begin();it!=fd_to_u64.end();it++)
|
||||
{
|
||||
@@ -196,14 +198,20 @@ struct conn_manager_t //TODO change map to unordered map
|
||||
}
|
||||
int insert_fd(u32_t fd,u64_t u64)
|
||||
{
|
||||
int before=fd_last_active_time.bucket_count();
|
||||
u64_to_fd[u64]=fd;
|
||||
fd_to_u64[fd]=u64;
|
||||
fd_last_active_time[fd]=get_current_time();
|
||||
int after=fd_last_active_time.bucket_count();
|
||||
if(after!=before)//rehash happens!
|
||||
{
|
||||
clear_it=fd_last_active_time.begin();
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
int erase_fd(u32_t fd)
|
||||
{
|
||||
if(disable_conv_clear) return 0;
|
||||
if(disable_conn_clear) return 0;
|
||||
u64_t u64=fd_to_u64[fd];
|
||||
|
||||
u32_t ip= (u64 >> 32u);
|
||||
@@ -239,7 +247,7 @@ struct conn_manager_t //TODO change map to unordered map
|
||||
}
|
||||
int clear_inactive0()
|
||||
{
|
||||
if(disable_conv_clear) return 0;
|
||||
if(disable_conn_clear) return 0;
|
||||
|
||||
|
||||
//map<uint32_t,uint64_t>::iterator it;
|
||||
@@ -275,6 +283,7 @@ struct conn_manager_t //TODO change map to unordered map
|
||||
}
|
||||
cnt++;
|
||||
}
|
||||
clear_it=it;
|
||||
return 0;
|
||||
}
|
||||
}conn_manager;
|
||||
@@ -420,7 +429,7 @@ int remove_seq(char * data,int &data_len)
|
||||
seq=ntoh64(seq);
|
||||
if(anti_replay.is_vaild(seq)==0)
|
||||
{
|
||||
if(disable_replay_filter==1)
|
||||
if(disable_replay_filter==1) // inefficient, to make packet_recv_count++ work for only non-dup packet
|
||||
return 0;
|
||||
mylog(log_trace,"seq %llx dropped bc of replay-filter\n ",seq);
|
||||
return -1;
|
||||
@@ -591,7 +600,7 @@ int create_new_udp(int &new_udp_fd)
|
||||
mylog(log_debug, "created new udp_fd %d\n", new_udp_fd);
|
||||
int ret = connect(new_udp_fd, (struct sockaddr *) &remote_addr_in, slen);
|
||||
if (ret != 0) {
|
||||
mylog(log_warn, "udp fd connect fail\n");
|
||||
mylog(log_warn, "udp fd connect fail %d %s\n",ret,strerror(errno));
|
||||
close(new_udp_fd);
|
||||
return -1;
|
||||
}
|
||||
@@ -696,8 +705,17 @@ int event_loop()
|
||||
int nfds = epoll_wait(epollfd, events, max_events, 180 * 1000); //3mins
|
||||
if (nfds < 0)
|
||||
{
|
||||
mylog(log_fatal,"epoll_wait return %d\n", nfds);
|
||||
myexit(-1);
|
||||
if(errno==EINTR )
|
||||
{
|
||||
mylog(log_info,"epoll interrupted by signal,continue\n");
|
||||
//myexit(0);
|
||||
}
|
||||
else
|
||||
{
|
||||
mylog(log_fatal,"epoll_wait return %d,%s\n", nfds,strerror(errno));
|
||||
myexit(-1);
|
||||
}
|
||||
|
||||
}
|
||||
int n;
|
||||
int clear_triggered=0;
|
||||
@@ -771,7 +789,18 @@ int event_loop()
|
||||
if (ret < 0) {
|
||||
mylog(log_warn, "send returned %d ,errno:%s\n", ret,strerror(errno));
|
||||
}
|
||||
add_and_new(new_udp_fd, dup_num - 1,random_between(dup_delay_min,dup_delay_max), data, data_len,u64);
|
||||
if(dup_delay_max!=0)
|
||||
{
|
||||
add_and_new(new_udp_fd, dup_num - 1,random_between(dup_delay_min,dup_delay_max), data, data_len,u64);
|
||||
}
|
||||
else
|
||||
{
|
||||
for(int i=0;i<dup_num - 1;i++)
|
||||
{
|
||||
do_obscure(data, data_len, new_data, new_len);
|
||||
ret = send_fd(new_udp_fd, new_data,new_len, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -887,7 +916,18 @@ int event_loop()
|
||||
do_obscure(data, data_len, new_data, new_len);
|
||||
ret = sendto_u64(local_listen_fd, new_data,
|
||||
new_len , 0,u64);
|
||||
if(dup_delay_max!=0)
|
||||
{
|
||||
add_and_new(udp_fd, dup_num - 1,random_between(dup_delay_min,dup_delay_max), data, data_len,u64);
|
||||
}
|
||||
else
|
||||
{
|
||||
for(int i=0;i<dup_num-1;i++)
|
||||
{
|
||||
do_obscure(data, data_len, new_data, new_len);
|
||||
ret = sendto_u64(local_listen_fd, new_data,new_len , 0,u64);
|
||||
}
|
||||
}
|
||||
if (ret < 0) {
|
||||
mylog(log_warn, "sento returned %d,%s\n", ret,strerror(errno));
|
||||
//perror("ret<0");
|
||||
@@ -923,8 +963,12 @@ int event_loop()
|
||||
}
|
||||
void print_help()
|
||||
{
|
||||
char git_version_buf[100]={0};
|
||||
strncpy(git_version_buf,gitversion,10);
|
||||
|
||||
printf("UDPspeeder\n");
|
||||
printf("version: %s %s\n",__DATE__,__TIME__);
|
||||
printf("git version:%s ",git_version_buf);
|
||||
printf("build date:%s %s\n",__DATE__,__TIME__);
|
||||
printf("repository: https://github.com/wangyu-/UDPspeeder\n");
|
||||
printf("\n");
|
||||
printf("usage:\n");
|
||||
@@ -944,8 +988,10 @@ void print_help()
|
||||
printf("advanced options:\n");
|
||||
printf(" -t tmin:tmax simliar to -t above,but delay randomly between tmin and tmax\n");
|
||||
printf(" -j jmin:jmax simliar to -j above,but create jitter randomly between jmin and jmax\n");
|
||||
printf(" --random-drop <number> simulate packet loss ,unit 0.01%%\n");
|
||||
printf(" -m <number> max pending packets,to prevent the program from eating up all your memory.\n");
|
||||
printf(" --random-drop <number> simulate packet loss ,unit:0.01%%\n");
|
||||
printf(" --disable-filter disable duplicate packet filter.\n");
|
||||
printf(" -m <number> max pending packets,to prevent the program from eating up all your memory,\n");
|
||||
printf(" default value:0(disabled).\n");
|
||||
printf("other options:\n");
|
||||
printf(" --log-level <number> 0:never 1:fatal 2:error 3:warn \n");
|
||||
printf(" 4:info (default) 5:debug 6:trace\n");
|
||||
@@ -1079,9 +1125,9 @@ void process_arg(int argc, char *argv[])
|
||||
{
|
||||
int dup_delay=-1;
|
||||
sscanf(optarg,"%d\n",&dup_delay);
|
||||
if(dup_delay<1||dup_delay>1000*100)
|
||||
if(dup_delay<0||dup_delay>1000*100)
|
||||
{
|
||||
mylog(log_fatal,"dup_delay must be between 1 and 100,000(10 second)\n");
|
||||
mylog(log_fatal,"dup_delay must be between 0 and 100,000(10 second)\n");
|
||||
myexit(-1);
|
||||
}
|
||||
dup_delay_min=dup_delay_max=dup_delay;
|
||||
@@ -1089,9 +1135,9 @@ void process_arg(int argc, char *argv[])
|
||||
else
|
||||
{
|
||||
sscanf(optarg,"%d:%d\n",&dup_delay_min,&dup_delay_max);
|
||||
if(dup_delay_min<1 ||dup_delay_max<1||dup_delay_min>dup_delay_max)
|
||||
if(dup_delay_min<0 ||dup_delay_max<0||dup_delay_min>dup_delay_max)
|
||||
{
|
||||
mylog(log_fatal," must satisfy 1<=dmin<=dmax\n");
|
||||
mylog(log_fatal," must satisfy 0<=tmin<=tmax\n");
|
||||
myexit(-1);
|
||||
}
|
||||
}
|
||||
|
72
makefile
72
makefile
@@ -1,45 +1,63 @@
|
||||
cc_cross=/home/wangyu/OpenWrt-SDK-ar71xx-for-linux-x86_64-gcc-4.8-linaro_uClibc-0.9.33.2/staging_dir/toolchain-mips_34kc_gcc-4.8-linaro_uClibc-0.9.33.2/bin/mips-openwrt-linux-g++
|
||||
cc_cross=/home/wangyu/Desktop/arm-2014.05/bin/arm-none-linux-gnueabi-g++
|
||||
cc_local=g++
|
||||
cc_ar71xx=/home/wangyu/OpenWrt-SDK-ar71xx-for-linux-x86_64-gcc-4.8-linaro_uClibc-0.9.33.2/staging_dir/toolchain-mips_34kc_gcc-4.8-linaro_uClibc-0.9.33.2/bin/mips-openwrt-linux-g++
|
||||
cc_bcm2708=/home/wangyu/raspberry/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/arm-linux-gnueabihf-g++
|
||||
cc_arm=/home/wangyu/Desktop/arm-2014.05/bin/arm-none-linux-gnueabi-g++
|
||||
FLAGS= -std=c++11 -Wall -Wextra -Wno-unused-variable -Wno-unused-parameter
|
||||
SOURCES=main.cpp log.cpp common.cpp
|
||||
NAME=speeder
|
||||
TAR=${NAME}_binaries.tar.gz ${NAME}_amd64 ${NAME}_x86 ${NAME}_ar71xx ${NAME}_bcm2708 ${NAME}_arm
|
||||
#cc_mips34kc=/toolchains/OpenWrt-SDK-ar71xx-for-linux-x86_64-gcc-4.8-linaro_uClibc-0.9.33.2/staging_dir/toolchain-mips_34kc_gcc-4.8-linaro_uClibc-0.9.33.2/bin/mips-openwrt-linux-g++
|
||||
cc_mips24kc_be=/toolchains/lede-sdk-17.01.2-ar71xx-generic_gcc-5.4.0_musl-1.1.16.Linux-x86_64/staging_dir/toolchain-mips_24kc_gcc-5.4.0_musl-1.1.16/bin/mips-openwrt-linux-musl-g++
|
||||
cc_mips24kc_le=/toolchains/lede-sdk-17.01.2-ramips-mt7621_gcc-5.4.0_musl-1.1.16.Linux-x86_64/staging_dir/toolchain-mipsel_24kc_gcc-5.4.0_musl-1.1.16/bin/mipsel-openwrt-linux-musl-g++
|
||||
#cc_arm= /toolchains/gcc-linaro-4.9.4-2017.01-x86_64_arm-linux-gnueabi/bin/arm-linux-gnueabi-g++ -march=armv6 -marm
|
||||
cc_arm= /toolchains/arm-2014.05/bin/arm-none-linux-gnueabi-g++
|
||||
#cc_bcm2708=/home/wangyu/raspberry/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/arm-linux-gnueabihf-g++
|
||||
FLAGS= -std=c++11 -Wall -Wextra -Wno-unused-variable -Wno-unused-parameter -Wno-missing-field-initializers
|
||||
|
||||
all:
|
||||
SOURCES=main.cpp log.cpp common.cpp
|
||||
|
||||
NAME=speeder
|
||||
TARGETS=amd64 arm mips24kc_be x86 mips24kc_le
|
||||
|
||||
TAR=${NAME}_binaries.tar.gz `echo ${TARGETS}|sed -r 's/([^ ]+)/speeder_\1/g'`
|
||||
|
||||
all:git_version
|
||||
rm -f ${NAME}
|
||||
${cc_local} -o ${NAME} -I. ${SOURCES} ${FLAGS} -lrt -static -O3
|
||||
fast:
|
||||
${cc_local} -o ${NAME} -I. ${SOURCES} ${FLAGS} -lrt -ggdb -static -O3
|
||||
fast: git_version
|
||||
rm -f ${NAME}
|
||||
${cc_local} -o ${NAME} -I. ${SOURCES} ${FLAGS} -lrt
|
||||
debug:
|
||||
${cc_local} -o ${NAME} -I. ${SOURCES} ${FLAGS} -lrt -ggdb
|
||||
debug: git_version
|
||||
rm -f ${NAME}
|
||||
${cc_local} -o ${NAME} -I. ${SOURCES} ${FLAGS} -lrt -Wformat-nonliteral -D MY_DEBUG
|
||||
debug2: git_version
|
||||
rm -f ${NAME}
|
||||
${cc_local} -o ${NAME} -I. ${SOURCES} ${FLAGS} -lrt -Wformat-nonliteral -ggdb
|
||||
|
||||
ar71xx:
|
||||
${cc_ar71xx} -o ${NAME}_ar71xx -I. ${SOURCES} ${FLAGS} -lrt -lgcc_eh -static -O3
|
||||
bcm2708:
|
||||
${cc_bcm2708} -o ${NAME}_bcm2708 -I. ${SOURCES} ${FLAGS} -lrt -static -O3
|
||||
amd64:
|
||||
${cc_local} -o ${NAME}_amd64 -I. ${SOURCES} ${FLAGS} -lrt -static -O3
|
||||
x86:
|
||||
${cc_local} -o ${NAME}_x86 -I. ${SOURCES} ${FLAGS} -lrt -m32 -static -O3
|
||||
arm:
|
||||
${cc_arm} -o ${NAME}_arm -I. ${SOURCES} ${FLAGS} -lrt -static -O3
|
||||
mips24kc_be: git_version
|
||||
${cc_mips24kc_be} -o ${NAME}_$@ -I. ${SOURCES} ${FLAGS} -lrt -lgcc_eh -static -O3
|
||||
|
||||
cross:
|
||||
mips24kc_le: git_version
|
||||
${cc_mips24kc_le} -o ${NAME}_$@ -I. ${SOURCES} ${FLAGS} -lrt -lgcc_eh -static -O3
|
||||
|
||||
amd64:git_version
|
||||
${cc_local} -o ${NAME}_$@ -I. ${SOURCES} ${FLAGS} -lrt -static -O3
|
||||
x86:git_version
|
||||
${cc_local} -o ${NAME}_$@ -I. ${SOURCES} ${FLAGS} -lrt -static -O3 -m32
|
||||
arm:git_version
|
||||
${cc_arm} -o ${NAME}_$@ -I. ${SOURCES} ${FLAGS} -lrt -static -O3
|
||||
|
||||
cross:git_version
|
||||
${cc_cross} -o ${NAME}_cross -I. ${SOURCES} ${FLAGS} -lrt -O3
|
||||
|
||||
cross2:
|
||||
cross2:git_version
|
||||
${cc_cross} -o ${NAME}_cross -I. ${SOURCES} ${FLAGS} -lrt -static -lgcc_eh -O3
|
||||
|
||||
cross3:git_version
|
||||
${cc_cross} -o ${NAME}_cross -I. ${SOURCES} ${FLAGS} -lrt -static -O3
|
||||
|
||||
release: amd64 x86 ar71xx bcm2708 arm
|
||||
release: ${TARGETS}
|
||||
tar -zcvf ${TAR}
|
||||
|
||||
clean:
|
||||
rm -f ${TAR}
|
||||
rm -f ${NAME}_cross ${NAME}
|
||||
rm -f speeder speeder_cross
|
||||
rm -f git_version.h
|
||||
|
||||
git_version:
|
||||
echo "const char *gitversion = \"$(shell git rev-parse HEAD)\";" > git_version.h
|
||||
|
||||
|
Reference in New Issue
Block a user