2 # Copyright (C) 2011-2013 OpenWrt.org
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
8 include $(TOPDIR
)/rules.mk
9 include $(INCLUDE_DIR
)/kernel.mk
12 PKG_VERSION
:=$(LINUX_VERSION
)
15 PKG_BUILD_FLAGS
:=no-mips16 no-lto
17 PKG_MAINTAINER
:=Felix Fietkau
<nbd@nbd.name
>
20 # Perf's makefile and headers are not relocatable and must be built from the
21 # Linux sources directory
22 PKG_BUILD_DIR
:=$(LINUX_DIR
)/tools
/perf-
$(TARGET_DIR_NAME
)
24 include $(INCLUDE_DIR
)/package.mk
25 include $(INCLUDE_DIR
)/nls.mk
30 DEPENDS
:= +libelf
+libdw
+PACKAGE_libunwind
:libunwind
+libpthread
+librt
+objdump @
!IN_SDK @KERNEL_PERF_EVENTS \
31 +PACKAGE_libbfd
:libbfd
+PACKAGE_libopcodes
:libopcodes
+libtraceevent
32 TITLE
:=Linux performance monitoring tool
33 VERSION
:=$(LINUX_VERSION
)-r
$(PKG_RELEASE
)
34 URL
:=http
://www.kernel.org
37 define Package
/perf
/description
38 perf is the Linux performance monitoring tool
41 HOST_CFLAGS
+= -I
$(LINUX_DIR
)/tools
/include
43 TARGET_LDFLAGS
+= $(INTL_LDFLAGS
)
46 ARCH
="$(LINUX_KARCH)" \
59 CROSS_COMPILE
="$(TARGET_CROSS)" \
61 LD
="$(TARGET_CROSS)ld" \
62 EXTRA_CFLAGS
="$(TARGET_CFLAGS) $(TARGET_CPPFLAGS)" \
63 LDFLAGS
="$(TARGET_LDFLAGS)" \
64 KBUILD_HOSTCFLAGS
="$(HOST_CFLAGS)" \
65 $(if
$(findstring c
,$(OPENWRT_VERBOSE
)),V
=1,V
='') \
66 PKG_CONFIG
="$(PKG_CONFIG)" \
67 PKG_CONFIG_PATH
="$(PKG_CONFIG_PATH)" \
68 EXCLUDE_EXTLIBS
="-lstdc++" \
69 EXTRA_PERFLIBS
="$(shell $(TARGET_CC) -print-file-name=libstdc++.a)" \
74 ifeq ($(LINUX_KARCH
),powerpc
)
75 MAKE_FLAGS
+= NO_AUXTRACE
=1
79 +$(MAKE
) $(PKG_JOBS
) $(MAKE_FLAGS
) \
80 --no-print-directory \
81 -C
$(LINUX_DIR
)/tools
/perf \
85 define Package
/perf
/install
86 $(INSTALL_DIR
) $(1)/usr
/bin
87 $(INSTALL_BIN
) $(PKG_BUILD_DIR
)/perf
$(1)/usr
/bin
/
90 $(eval
$(call BuildPackage
,perf
))