aboutsummaryrefslogtreecommitdiff
path: root/package/ttcp/ttcp.mk
blob: 1c4fe6ff10f9b6955fdf2b4c77417a1ddb654a00 (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
#############################################################
#
# ttcp
#
#############################################################
#
TTCP_VERSION:=
TTCP_SOURCE_URL=http://ftp.sunet.se/pub/network/monitoring/ttcp
TTCP_SOURCE=ttcp$(TTCP_VERSION).c
TTCP_DIR=$(BUILD_DIR)/ttcp$(TTCP_VERSION)

$(DL_DIR)/$(TTCP_SOURCE):
	 $(call DOWNLOAD,$(TTCP_SOURCE_URL),$(TTCP_SOURCE))

$(TTCP_DIR)/.unpacked: $(DL_DIR)/$(TTCP_SOURCE)
	-mkdir $(TTCP_DIR)
	cp -af $(DL_DIR)/$(TTCP_SOURCE) $(TTCP_DIR)
	toolchain/patch-kernel.sh $(TTCP_DIR) package/ttcp/ ttcp-\*.patch
	touch $(TTCP_DIR)/.unpacked

$(TTCP_DIR)/.configured: $(TTCP_DIR)/.unpacked
	touch $(TTCP_DIR)/.configured

$(TTCP_DIR)/ttcp: $(TTCP_DIR)/.configured
	$(TARGET_CC) -O2 -o $(TTCP_DIR)/ttcp $(TTCP_DIR)/$(TTCP_SOURCE)

$(TARGET_DIR)/usr/bin/ttcp: $(TTCP_DIR)/ttcp
	cp -af $(TTCP_DIR)/ttcp $(TARGET_DIR)/usr/bin/

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

ttcp-source: $(DL_DIR)/$(TTCP_SOURCE)

ttcp-clean:
	rm -f $(TTCP_DIR)/*.o $(TTCP_DIR)/ttcp

ttcp-dirclean:
	rm -rf $(TTCP_DIR)

#############################################################
#
# Toplevel Makefile options
#
#############################################################
ifeq ($(BR2_PACKAGE_TTCP),y)
TARGETS+=ttcp
endif