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