e611d5eca3269c33d960c3e36fe281f7eb97cd3e
[openwrt/openwrt.git] / package / devel / perf / Makefile
1 #
2 # Copyright (C) 2011-2013 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 include $(INCLUDE_DIR)/kernel.mk
10
11 PKG_NAME:=perf
12 PKG_VERSION:=$(LINUX_VERSION)
13 PKG_RELEASE:=3
14
15 PKG_USE_MIPS16:=0
16 PKG_BUILD_PARALLEL:=1
17 PKG_MAINTAINER:=Felix Fietkau <nbd@nbd.name>
18 PKG_FLAGS:=nonshared
19
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)
23
24 include $(INCLUDE_DIR)/package.mk
25 include $(INCLUDE_DIR)/nls.mk
26
27 define Package/perf
28 SECTION:=devel
29 CATEGORY:=Development
30 DEPENDS:= +libelf +libdw +PACKAGE_libunwind:libunwind +libpthread +librt +objdump @!IN_SDK @!TARGET_arc770 @KERNEL_PERF_EVENTS
31 TITLE:=Linux performance monitoring tool
32 VERSION:=$(LINUX_VERSION)-$(PKG_RELEASE)
33 URL:=http://www.kernel.org
34 endef
35
36 define Package/perf/description
37 perf is the Linux performance monitoring tool
38 endef
39
40 HOST_CFLAGS += -I$(LINUX_DIR)/tools/include
41
42 TARGET_LDFLAGS += $(INTL_LDFLAGS)
43
44 MAKE_FLAGS = \
45 ARCH="$(LINUX_KARCH)" \
46 NO_LIBPERL=1 \
47 NO_LIBPYTHON=1 \
48 NO_NEWT=1 \
49 NO_LZMA=1 \
50 NO_BACKTRACE=1 \
51 NO_LIBNUMA=1 \
52 NO_GTK2=1 \
53 NO_LIBAUDIT=1 \
54 NO_LIBCRYPTO=1 \
55 NO_LIBUNWIND=1 \
56 NO_LIBCAP=1 \
57 CROSS_COMPILE="$(TARGET_CROSS)" \
58 CC="$(TARGET_CC)" \
59 LD="$(TARGET_CROSS)ld" \
60 CFLAGS="$(TARGET_CFLAGS) $(TARGET_CPPFLAGS)" \
61 LDFLAGS="$(TARGET_LDFLAGS)" \
62 KBUILD_HOSTCFLAGS="$(HOST_CFLAGS)" \
63 $(if $(findstring c,$(OPENWRT_VERBOSE)),V=1,V='') \
64 WERROR=0 \
65 O=$(PKG_BUILD_DIR) \
66 prefix=/usr
67
68 define Build/Compile
69 +$(MAKE_FLAGS) $(MAKE) $(PKG_JOBS) \
70 --no-print-directory \
71 -C $(LINUX_DIR)/tools/perf
72 endef
73
74 define Package/perf/install
75 $(INSTALL_DIR) $(1)/usr/bin
76 $(INSTALL_BIN) $(PKG_BUILD_DIR)/perf $(1)/usr/bin/
77 endef
78
79 $(eval $(call BuildPackage,perf))