Root/package/devel/trace-cmd/Makefile

1include $(TOPDIR)/rules.mk
2
3PKG_NAME:=trace-cmd
4PKG_VERSION:=v2.0.1
5PKG_RELEASE=1
6
7PKG_SOURCE_PROTO:=git
8PKG_SOURCE_URL:=git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/trace-cmd.git
9PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
10PKG_SOURCE_VERSION:=1776cf9a24f95b2623fe7ee380d708bb8c6d8a73
11PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
12# PKG_MIRROR_MD5SUM:=6a08dfa2519a969d184e7bb5bb390620
13PKG_INSTALL:=1
14
15PKG_BUILD_PARALLEL:=1
16
17include $(INCLUDE_DIR)/package.mk
18
19define Package/trace-cmd
20  SECTION:=devel
21  CATEGORY:=Development
22  TITLE:=Linux trace command line utility
23  DEPENDS:=
24endef
25
26define Package/trace-cmd-extra
27  SECTION:=devel
28  CATEGORY:=Development
29  TITLE:=Extra plugins for trace-cmd
30  DEPENDS:=
31endef
32
33MAKE_FLAGS += \
34    NO_PYTHON=1 \
35    prefix=/usr
36
37PLUGINS_DIR := $(PKG_INSTALL_DIR)/usr/lib/trace-cmd/plugins
38PLUGINS_MAIN := function hrtimer mac80211 sched_switch
39
40TARGET_CFLAGS += --std=gnu99
41
42define Package/trace-cmd/install
43    $(INSTALL_DIR) $(1)/usr/bin $(1)/usr/lib/trace-cmd/plugins
44    $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/trace-cmd $(1)/usr/bin/
45    $(CP) \
46        $(patsubst %,$(PLUGINS_DIR)/plugin_%.so,$(PLUGINS_MAIN)) \
47        $(1)/usr/lib/trace-cmd/plugins
48endef
49
50define Package/trace-cmd-extra/install
51    $(INSTALL_DIR) $(1)/usr/lib/trace-cmd/plugins
52    $(CP) \
53        $$(patsubst %,$(PLUGINS_DIR)/plugin_%.so, \
54            $$(filter-out $(PLUGINS_MAIN), \
55                $$(patsubst $(PLUGINS_DIR)/plugin_%.so,%, \
56                    $$(wildcard $(PLUGINS_DIR)/plugin_*.so)))) \
57        $(1)/usr/lib/trace-cmd/plugins
58endef
59
60$(eval $(call BuildPackage,trace-cmd))
61$(eval $(call BuildPackage,trace-cmd-extra))
62

Archive Download this file



interactive