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