aboutsummaryrefslogtreecommitdiffstats
path: root/package/iostat/iostat.mk
blob: 04e58d01b8541de9c5dec99859169b9c79a2ced1 (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
#############################################################
#
# iostat
#
#############################################################
IOSTAT_VERSION:=2.2
IOSTAT_SOURCE:=iostat-$(IOSTAT_VERSION).tar.gz
IOSTAT_SITE:=http://linux.inet.hr/files
IOSTAT_DIR:=$(BUILD_DIR)/iostat-$(IOSTAT_VERSION)
IOSTAT_BINARY:=iostat
IOSTAT_TARGET_BINARY:=usr/bin/iostat

$(DL_DIR)/$(IOSTAT_SOURCE):
	 $(call DOWNLOAD,$(IOSTAT_SITE),$(IOSTAT_SOURCE))

iostat-source: $(DL_DIR)/$(IOSTAT_SOURCE)

$(IOSTAT_DIR)/.unpacked: $(DL_DIR)/$(IOSTAT_SOURCE)
	$(ZCAT) $(DL_DIR)/$(IOSTAT_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) -
	toolchain/patch-kernel.sh $(IOSTAT_DIR) package/iostat/ iostat\*.patch
	touch $(IOSTAT_DIR)/.unpacked

$(IOSTAT_DIR)/$(IOSTAT_BINARY): $(IOSTAT_DIR)/.unpacked
	$(MAKE) CC=$(TARGET_CC) -C $(IOSTAT_DIR)
	$(STRIPCMD) $(IOSTAT_DIR)/$(IOSTAT_BINARY)

$(TARGET_DIR)/$(IOSTAT_TARGET_BINARY): $(IOSTAT_DIR)/$(IOSTAT_BINARY)
	$(INSTALL) -m 0755 -D $(IOSTAT_DIR)/$(IOSTAT_BINARY) $(TARGET_DIR)/$(IOSTAT_TARGET_BINARY)

iostat: $(TARGET_DIR)/$(IOSTAT_TARGET_BINARY)

iostat-clean:
	rm -f $(TARGET_DIR)/$(IOSTAT_TARGET_BINARY)
	-$(MAKE) -C $(IOSTAT_DIR) clean

iostat-dirclean:
	rm -rf $(IOSTAT_DIR)

#############################################################
#
# Toplevel Makefile options
#
#############################################################
ifeq ($(BR2_PACKAGE_IOSTAT),y)
TARGETS+=iostat
endif