packages: add lmbench
[openwrt/svn-archive/archive.git] / utils / lmbench / Makefile
1 #
2 # Copyright (C) 2009-2010 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7
8 include $(TOPDIR)/rules.mk
9
10 PKG_NAME:=lmbench
11 PKG_VERSION:=3.0-a9
12 PKG_RELEASE:=1
13
14 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tgz
15 PKG_SOURCE_URL:=@SF/lmbench/
16 PKG_MD5SUM:=784b0873361cd5442e02b2544d42917b
17 PKG_CAT:=cat
18
19 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
20 PKG_BUILD_DEPENDS:=librpc
21
22 include $(INCLUDE_DIR)/package.mk
23
24 define Package/lmbench
25 SECTION:=utils
26 CATEGORY:=Utilities
27 TITLE:=lmbench microbenchmarks
28 URL:=http://sourceforge.net/projects/lmbench
29 MENU:=1
30 endef
31
32 define Package/lmbench/description
33 lmbench is a series of micro benchmarks intended to measure basic operating
34 system and hardware system metrics.
35 endef
36
37 define Package/lmbench/install
38 true
39 endef
40
41 define Build/Compile
42 $(MAKE) -C $(PKG_BUILD_DIR)/src \
43 CC="$(TARGET_CC)" \
44 AR="$(TARGET_CROSS)ar" \
45 OS="$(ARCH)" \
46 BASE="$(PKG_INSTALL_DIR)" \
47 LDLIBS="-lrpc" \
48 COMPILE="$(TARGET_CC) $(TARGET_CFLAGS) $(TARGET_CPPFLAGS) $(TARGET_LDFLAGS)" \
49 lmbench install
50 endef
51
52 define PartGen
53 define Package/lmbench-$(subst _,-,$(1))
54 SECTION:=utils
55 CATEGORY:=Utilities
56 TITLE:=$(1) microbenchmark
57 URL:=http://sourceforge.net/projects/lmbench
58 DEPENDS:=lmbench +librpc
59 endef
60 endef
61
62 define PartInstall
63 define Package/lmbench-$(subst _,-,$(1))/install
64 $(INSTALL_DIR) $$(1)/usr/sbin
65 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/bin/$(1) $$(1)/usr/sbin/$(1)
66 endef
67 endef
68
69 LMBENCH_FILES:= \
70 bw_file_rd \
71 bw_mem \
72 bw_mmap_rd \
73 bw_pipe \
74 bw_tcp \
75 bw_unix \
76 cache \
77 disk \
78 enough \
79 flushdisk \
80 hello \
81 lat_cmd \
82 lat_connect \
83 lat_ctx \
84 lat_dram_page \
85 lat_fcntl \
86 lat_fifo \
87 lat_fs \
88 lat_http \
89 lat_mem_rd \
90 lat_mmap \
91 lat_ops \
92 lat_pagefault \
93 lat_pipe \
94 lat_pmake \
95 lat_proc \
96 lat_rand \
97 lat_rpc \
98 lat_select \
99 lat_sem \
100 lat_sig \
101 lat_syscall \
102 lat_tcp \
103 lat_udp \
104 lat_unix \
105 lat_unix_connect \
106 lat_usleep \
107 line \
108 lmdd \
109 lmhttp \
110 loop_o \
111 memsize \
112 mhz \
113 msleep \
114 par_mem \
115 par_ops \
116 stream \
117 timing_o \
118 tlb
119
120 $(foreach file,$(LMBENCH_FILES),$(eval $(call PartGen,$(file))))
121 $(foreach file,$(LMBENCH_FILES),$(eval $(call PartInstall,$(file))))
122
123 $(eval $(call BuildPackage,lmbench))
124 $(foreach file,$(LMBENCH_FILES),$(eval $(call BuildPackage,lmbench-$(subst _,-,$(file)))))