ugps: update to latest git HEAD
[15.05/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_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 +kmod-oprofile +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                 --without-x \
54         )
55 endef
56
57 TARGET_CXXFLAGS += -fpermissive
58 TARGET_LDFLAGS := -L$(STAGING_DIR)/usr/lib $(TARGET_LDFLAGS)
59
60 define Package/oprofile-utils/install
61         $(INSTALL_DIR) $(1)/usr/bin
62         $(INSTALL_BIN) \
63                 $(PKG_INSTALL_DIR)/usr/bin/opannotate \
64                 $(PKG_INSTALL_DIR)/usr/bin/oparchive \
65                 $(PKG_INSTALL_DIR)/usr/bin/opgprof \
66                 $(1)/usr/bin
67 endef
68
69 define Package/oprofile/install
70         $(INSTALL_DIR) $(1)/usr/bin
71         $(INSTALL_BIN) \
72                 $(PKG_INSTALL_DIR)/usr/bin/* \
73                 $(1)/usr/bin
74
75         rm -f \
76                 $(1)/usr/bin/opannotate \
77                 $(1)/usr/bin/oparchive \
78                 $(1)/usr/bin/opgprof
79
80         $(INSTALL_DIR) $(1)/usr/lib/oprofile
81         $(CP) \
82                 $(PKG_INSTALL_DIR)/usr/lib/oprofile/*.so* \
83                 $(1)/usr/lib/oprofile/
84
85         $(INSTALL_DIR) $(1)/usr/share/oprofile
86         $(CP) \
87                 $(PKG_INSTALL_DIR)/usr/share/oprofile/stl.pat \
88                 $(PKG_INSTALL_DIR)/usr/share/oprofile/$(patsubst x86,i386,$(LINUX_KARCH)) \
89                 $(1)/usr/share/oprofile/
90 endef
91
92 $(eval $(call BuildPackage,oprofile))
93 $(eval $(call BuildPackage,oprofile-utils))