c758cbc4d33088e1837dc96d265aa369c24c1bad
[openwrt.git] / package / devel / oprofile / 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:=oprofile
11 PKG_VERSION:=0.9.9
12 PKG_RELEASE:=1
13
14 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
15 PKG_SOURCE_URL:=@SF/oprofile/
16 PKG_MD5SUM:=00aec1287da2dfffda17a9b1c0a01868
17
18 PKG_MAINTAINER:=Felix Fietkau <nbd@openwrt.org>
19
20 PKG_BUILD_DEPENDS:=binutils
21 PKG_FIXUP:=autoreconf
22 PKG_INSTALL:=1
23 PKG_BUILD_PARALLEL:=1
24
25 include $(INCLUDE_DIR)/package.mk
26 include $(INCLUDE_DIR)/kernel.mk
27
28 define Package/oprofile
29   SECTION:=devel
30   CATEGORY:=Development
31   TITLE:=OProfile System Profiler
32   URL:=http://oprofile.sourceforge.net
33   DEPENDS:=+libpopt +kmod-oprofile +libstdcpp +objdump
34 endef
35
36 define Package/oprofile/description
37  A transparent low-overhead system-wide profiler.
38 endef
39
40 define Package/oprofile-utils
41   SECTION:=devel
42   CATEGORY:=Development
43   TITLE:=OProfile System Profiler (extra utilities)
44   URL:=http://oprofile.sourceforge.net
45   DEPENDS:=oprofile
46 endef
47
48 define Build/Configure
49         $(call Build/Configure/Default, \
50                 --with-kernel-support \
51                 --without-x \
52         )
53 endef
54
55 TARGET_CXXFLAGS += -fpermissive
56 TARGET_LDFLAGS := -L$(STAGING_DIR)/usr/lib $(TARGET_LDFLAGS)
57
58 define Package/oprofile-utils/install
59         $(INSTALL_DIR) $(1)/usr/bin
60         $(INSTALL_BIN) \
61                 $(PKG_INSTALL_DIR)/usr/bin/opannotate \
62                 $(PKG_INSTALL_DIR)/usr/bin/oparchive \
63                 $(PKG_INSTALL_DIR)/usr/bin/opgprof \
64                 $(1)/usr/bin
65 endef
66
67 define Package/oprofile/install
68         $(INSTALL_DIR) $(1)/usr/bin
69         $(INSTALL_BIN) \
70                 $(PKG_INSTALL_DIR)/usr/bin/* \
71                 $(1)/usr/bin
72
73         rm -f \
74                 $(1)/usr/bin/opannotate \
75                 $(1)/usr/bin/oparchive \
76                 $(1)/usr/bin/opgprof
77
78         $(INSTALL_DIR) $(1)/usr/lib/oprofile
79         $(CP) \
80                 $(PKG_INSTALL_DIR)/usr/lib/oprofile/*.so* \
81                 $(1)/usr/lib/oprofile/
82
83         $(INSTALL_DIR) $(1)/usr/share/oprofile
84         $(CP) \
85                 $(PKG_INSTALL_DIR)/usr/share/oprofile/stl.pat \
86                 $(PKG_INSTALL_DIR)/usr/share/oprofile/$(patsubst x86,i386,$(LINUX_KARCH)) \
87                 $(1)/usr/share/oprofile/
88 endef
89
90 $(eval $(call BuildPackage,oprofile))
91 $(eval $(call BuildPackage,oprofile-utils))