[PATCH] New package CPUsage
[openwrt/svn-archive/archive.git] / utils / cpusage / Makefile
1 #
2 # Copyright (C) 2005 Fabian Schneider, 2010 Florian Sesser, TU Muenchen
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6
7 include $(TOPDIR)/rules.mk
8
9 PKG_NAME:=cpusage
10 PKG_VERSION:=0.31
11
12 PKG_BUILD_DIR:=$(BUILD_DIR)/cpusage
13
14 include $(INCLUDE_DIR)/package.mk
15
16 define Package/cpusage
17 SECTION:=utils
18 CATEGORY:=Utilities
19 TITLE:=Outputs CPU usage statistics once per second
20 URL:=http://www.net.t-labs.tu-berlin.de/~fabian/proj_en.html\#cpusage
21 endef
22
23 define Package/cpusage/description
24 CPUsage outputs CPU usage statistics once per second.
25 Optionally writes CSV output (see '-o' option).
26 Written by Fabian Schneider (TUM, TUB) in 2005.
27 Timestamp and CSV-compliance by Florian Sesser (TUM), 2010.
28 endef
29
30 define Build/Prepare
31 mkdir -p $(PKG_BUILD_DIR)
32 $(CP) src/* $(PKG_BUILD_DIR)/
33 endef
34
35 TARGET_CFLAGS += $(FPIC)
36
37 define Build/Compile
38 $(TARGET_CC) $(TARGET_CFLAGS) -D__Linux26__ -D_BSD_SOURCE=1 -c -I$(PKG_BUILD_DIR) -I$(STAGING_DIR)/usr/include -o $(PKG_BUILD_DIR)/cpusage.o $(PKG_BUILD_DIR)/cpusage.c
39 $(TARGET_CC) $(TARGET_CFLAGS) -o $(PKG_BUILD_DIR)/cpusage -L$(STAGING_DIR)/usr/lib $(PKG_BUILD_DIR)/cpusage.o
40 endef
41
42 define Package/cpusage/install
43 $(INSTALL_DIR) $(1)/usr/bin
44 $(INSTALL_BIN) $(PKG_BUILD_DIR)/cpusage $(1)/usr/bin/
45 endef
46
47 $(eval $(call BuildPackage,cpusage))