2961e2dfc5cdd54c30d0881a9b90e8086a2fb0eb
[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.4
12 PKG_RELEASE:=2
13
14 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
15 PKG_SOURCE_URL:=@SF/oprofile/
16 PKG_MD5SUM:=82b059379895cf125261d7d773465915
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 KernelPackage/oprofile
26   SUBMENU:=Other modules
27   TITLE:=OProfile profiling support
28   KCONFIG:=CONFIG_OPROFILE @!LINUX_2_4
29   FILES:=$(LINUX_DIR)/arch/$(LINUX_KARCH)/oprofile/oprofile.$(LINUX_KMOD_SUFFIX)
30   DEPENDS:=@KERNEL_PROFILING
31 endef
32
33 define KernelPackage/oprofile/description
34   Kernel module for support for oprofile system profiling.
35 endef
36
37 define Package/oprofile
38   SECTION:=devel
39   CATEGORY:=Development
40   TITLE:=OProfile System Profiler
41   URL:=http://oprofile.sourceforge.net
42   DEPENDS:=+libpopt +kmod-oprofile +libstdcpp +objdump
43 endef
44
45 define Package/oprofile/description
46  A transparent low-overhead system-wide profiler.
47 endef
48
49 define Package/oprofile-utils
50   SECTION:=devel
51   CATEGORY:=Development
52   TITLE:=OProfile System Profiler (extra utilities)
53   URL:=http://oprofile.sourceforge.net
54   DEPENDS:=oprofile
55 endef
56
57 define Build/Configure
58         $(call Build/Configure/Default, \
59                 --with-kernel-support \
60                 --without-x \
61         )
62 endef
63
64 TARGET_LDFLAGS := -L$(STAGING_DIR)/usr/lib $(TARGET_LDFLAGS)
65
66 define Package/oprofile-utils/install
67         $(INSTALL_DIR) $(1)/usr/bin
68         $(INSTALL_BIN) \
69                 $(PKG_INSTALL_DIR)/usr/bin/opannotate \
70                 $(PKG_INSTALL_DIR)/usr/bin/oparchive \
71                 $(PKG_INSTALL_DIR)/usr/bin/opgprof \
72                 $(1)/usr/bin
73 endef
74
75 define Package/oprofile/install
76         $(INSTALL_DIR) $(1)/usr/bin
77         $(INSTALL_BIN) \
78                 $(PKG_INSTALL_DIR)/usr/bin/* \
79                 $(1)/usr/bin
80
81         rm -f \
82                 $(1)/usr/bin/opannotate \
83                 $(1)/usr/bin/oparchive \
84                 $(1)/usr/bin/opgprof
85
86         $(INSTALL_DIR) $(1)/usr/lib/oprofile
87         $(CP) \
88                 $(PKG_INSTALL_DIR)/usr/lib/oprofile/*.so* \
89                 $(1)/usr/lib/oprofile/
90
91         $(INSTALL_DIR) $(1)/usr/share/oprofile
92         $(CP) \
93                 $(PKG_INSTALL_DIR)/usr/share/oprofile/stl.pat \
94                 $(PKG_INSTALL_DIR)/usr/share/oprofile/$(LINUX_KARCH) \
95                 $(1)/usr/share/oprofile/
96 endef
97
98 $(eval $(call BuildPackage,oprofile))
99 $(eval $(call BuildPackage,oprofile-utils))
100 $(eval $(call KernelPackage,oprofile))