You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
38 lines
1.1 KiB
38 lines
1.1 KiB
6 years ago
|
iperf3_version := 3.6
|
||
|
iperf3_tarball := iperf3-$(iperf3_version).tar.gz
|
||
|
iperf3_tarball_path := src/$(iperf3_tarball)
|
||
|
build_dir := build/$(arch)
|
||
|
iperf3_dir := $(build_dir)/iperf-$(iperf3_version)
|
||
|
cc := $(arch)-linux-musl-gcc
|
||
|
strip := $(arch)-linux-musl-strip
|
||
|
bin_unstripped := build/$(arch)/iperf3_unstripped
|
||
|
bin := build/$(arch)/iperf3
|
||
|
|
||
|
$(iperf3_tarball_path):
|
||
|
wget https://github.com/esnet/iperf/archive/$(iperf3_version).tar.gz -O $(iperf3_tarball_path)
|
||
|
|
||
|
$(iperf3_dir): $(iperf3_tarball_path)
|
||
|
mkdir -p $(build_dir)
|
||
|
cd $(build_dir) && tar xvf ../../$(iperf3_tarball_path)
|
||
|
|
||
|
$(iperf3_dir)/src/iperf3: $(iperf3_dir)
|
||
|
sed -i 's/AM_INIT_AUTOMAKE$$/AM_INIT_AUTOMAKE\([foreign]\)/' $(iperf3_dir)/configure.ac
|
||
|
sed -i 's/-pg//' $(iperf3_dir)/src/Makefile.am
|
||
|
cd $(iperf3_dir) && autoreconf
|
||
|
cd $(iperf3_dir) && ./configure CC=$(cc) --disable-shared --enable-static --without-openssl --host $(arch)-linux-musl
|
||
|
cd $(iperf3_dir) && make
|
||
|
|
||
|
$(bin_unstripped): $(iperf3_dir)/src/iperf3
|
||
|
cp $(iperf3_dir)/src/iperf3 $(bin_unstripped)
|
||
|
|
||
|
$(bin): $(bin_unstripped)
|
||
|
cp $(bin_unstripped) $(bin)
|
||
|
$(strip) $(bin)
|
||
|
|
||
|
.PHONY: all clean
|
||
|
|
||
|
all: $(bin)
|
||
|
|
||
|
clean:
|
||
|
rm -rf build/$(arch)
|