summaryrefslogtreecommitdiff
path: root/package/iperf/iperf.mk
blob: 562b39b97087966850aa9e7db0feeb59c0f0fd1e (plain)
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
63
64
65
66
67
68
69
70
71
72
73
74
#############################################################
#
# iperf
#
#############################################################

IPERF_VERSION:=2.0.2
IPERF_SOURCE:=iperf-$(IPERF_VERSION).tar.gz
IPERF_SITE:=http://$(BR2_SOURCEFORGE_MIRROR).dl.sourceforge.net/sourceforge/iperf
IPERF_DIR:=$(BUILD_DIR)/iperf-$(IPERF_VERSION)
IPERF_CAT:=$(ZCAT)

$(DL_DIR)/$(IPERF_SOURCE):
	$(WGET) -P $(DL_DIR) $(IPERF_SITE)/$(IPERF_SOURCE)

$(IPERF_DIR)/.unpacked: $(DL_DIR)/$(IPERF_SOURCE)
	$(IPERF_CAT) $(DL_DIR)/$(IPERF_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) -
	toolchain/patch-kernel.sh $(IPERF_DIR) package/iperf/ iperf\*.patch
	$(CONFIG_UPDATE) $(IPERF_DIR)
	touch $(IPERF_DIR)/.unpacked

$(IPERF_DIR)/.configured: $(IPERF_DIR)/.unpacked
	(cd $(IPERF_DIR); rm -rf config.cache; \
		$(TARGET_CONFIGURE_OPTS) \
		$(TARGET_CONFIGURE_ARGS) \
		ac_cv_func_malloc_0_nonnull=yes \
		./configure \
		--with-gnu-ld \
		--target=$(GNU_TARGET_NAME) \
		--host=$(GNU_TARGET_NAME) \
		--build=$(GNU_HOST_NAME) \
		$(DISABLE_IPV6) \
		--disable-dependency-tracking \
		--disable-web100 \
		--prefix=/usr \
		--exec-prefix=/usr \
		--bindir=/usr/bin \
		--sbindir=/usr/sbin \
		--libexecdir=/usr/sbin \
		--sysconfdir=/etc \
		--datadir=/usr/share \
		--localstatedir=/var \
		--mandir=/usr/man \
		--infodir=/usr/info \
		--includedir=$(STAGING_DIR)/usr/include \
	)
	touch $(IPERF_DIR)/.configured

$(IPERF_DIR)/src/iperf: $(IPERF_DIR)/.configured
	$(MAKE) CC=$(TARGET_CC) -C $(IPERF_DIR)
	-$(STRIP) $(STRIP_STRIP_UNNEEDED) $(IPERF_DIR)/src/iperf

$(TARGET_DIR)/usr/bin/iperf: $(IPERF_DIR)/src/iperf
	cp $(IPERF_DIR)/src/iperf $(TARGET_DIR)/usr/bin/iperf

iperf: $(TARGET_DIR)/usr/bin/iperf

iperf-source: $(DL_DIR)/$(IPERF_SOURCE)

iperf-clean:
	@if [ -d $(IPERF_KDIR)/Makefile ]; then \
		$(MAKE) -C $(IPERF_DIR) clean; \
	fi

iperf-dirclean:
	rm -rf $(IPERF_DIR)
#############################################################
#
# Toplevel Makefile options
#
#############################################################
ifeq ($(strip $(BR2_PACKAGE_IPERF)),y)
TARGETS+=iperf
endif