trace-cmd: update to latest version
[openwrt.git] / package / devel / trace-cmd / Makefile
1 include $(TOPDIR)/rules.mk
2
3 PKG_NAME:=trace-cmd
4 PKG_VERSION:=v2.2.1
5 PKG_RELEASE=1
6
7 PKG_SOURCE_PROTO:=git
8 PKG_SOURCE_URL:=git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/trace-cmd.git
9 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
10 PKG_SOURCE_VERSION:=8c10a774f1f8586cd8b0e3ce8666a376cb1d98e3
11 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
12 # PKG_MIRROR_MD5SUM:=6a08dfa2519a969d184e7bb5bb390620
13 PKG_INSTALL:=1
14
15 PKG_BUILD_PARALLEL:=1
16
17 include $(INCLUDE_DIR)/package.mk
18
19 define Package/trace-cmd
20   SECTION:=devel
21   CATEGORY:=Development
22   TITLE:=Linux trace command line utility
23   DEPENDS:=
24 endef
25
26 define Package/trace-cmd-extra
27   SECTION:=devel
28   CATEGORY:=Development
29   TITLE:=Extra plugins for trace-cmd
30   DEPENDS:=
31 endef
32
33 MAKE_FLAGS += \
34         NO_PYTHON=1 \
35         prefix=/usr
36
37 PLUGINS_DIR := $(PKG_INSTALL_DIR)/usr/lib/trace-cmd/plugins
38 PLUGINS_MAIN := function hrtimer mac80211 sched_switch
39
40 TARGET_CFLAGS += --std=gnu99
41
42 define 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
48 endef
49
50 define 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
58 endef
59
60 $(eval $(call BuildPackage,trace-cmd))
61 $(eval $(call BuildPackage,trace-cmd-extra))