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